Let \(X_1,X_2,...,X_n\) have population mean \(\mu\) and variance \(\sigma^2\)
\[
\bar{X} \sim N(\mu,\frac{\sigma^2}{n})
\]
As the sample size gets large, the sample mean becomes normally distributed, with mean \(\mu\) and standard error \(\sigma/\sqrt{n}\) , regardless of the distribution of \(X_1,...,X_n\)
Simulating the CLT in R
Recall that the rnorm function can generate values from a normal distribution
Let’s simulate taking a sample of size 10 from a population that is normally distributed with mean 10 and SD 2
Simulate the CLT in R
Let’s generate a histogram.
Simulate the CLT in R
Now, let’s simulate the process of taking 1000 different samples, each of size 10, and compute the mean of each sample.
Simulate the CLT in R
Now, let’s simulate the process of taking 1000 different samples, each of size 100
Simulate the CLT in R
Finally, let’s sample from a bimodal distribution.