Simulate a population of 10,000 individual values for a variable x:
x <- rnorm(10000, mean=50.5, sd=5.5)
Take 1000 random samples of size 20, take the mean of each sample, and plot the distribution of these 1000 sample means.
x_sample_means <- NULL
for(i in 1:1000){
x_samp <- sample(x, 20, replace=FALSE)
x_sample_means[i] <- mean(x_samp)
}
For one of your samples, use the equation from the previous slide to transform the values to z-scores.
Plot the distribution of the z-scores, and calculate the mean and the standard deviation.