R Studio Flashcards
What are the first commands to put into Rstudio?
Install.packages(‘devtools’) Devtools::install_github(“mark-andrews/psyntur”) Library(psyntur) Library(“tidyverse”) Library(ggplot2)
What does describe function do?
Gets descriptive statistics
Overall mean of the variable for all conditions
Describe(title, mean = mean(variable), stdev = sd(variable))
Describe(title, by =categoricalvariable, mean =mean(variable), stdev =sd(variable))
Does it for each one
What does the standard deviation tell you?
Higher standard deviation is more of a range around the mean - bigger variation. A lot of overlapping values.
What does the labs() function do?
Adds labels to the pox plot or histogram.
Labs(x = “title”, y = “title”)
Function for normal distributions
Plot_normal_sample(1000, mean = 100, sd = 15, bins = number)
For bars in histogram can increase that by increasing number of bins
How to look at the distribution of the means in samples ?
Function is:
Plot_repeat_normal_samples( N = 100, n = 10, sd = 15)
N= how many repetitions so 100 in this example n= each repetition we sample 10 values from the normal distribution.
What command to you put for a histogram for normal distributions ?
Hist_repeat_normal_samples()
What is sampling variability?
An estimate of the proportion will not be a perfect representation of the true proportion of the population. May be smaller or larger than the average in the population.
How to pass it through a deframe and why using a vector helps?
Counts
What does sum(counts) tell us?
The total sample size
Paired sample t test
T
Df
P-values
T- greater the t value the larger the effect ( less than 1 smaller effect)
Df- how much information the data provides.
P-value- how common the t value is if null hypothesis is true. Needs to be smaller than 0.05- to reject the hypothesis
What happens when the size of the SDs are the same as the difference between the means?
The effect size is 1
What is the command for a t_test?
t_test(y~x, data = name)
How to do you make a box plot ?
Tukeyboxplot(data =name, x = condition, y = condition)