Concept map / Central limit theorem
Share
The central limit theorem for sample means
Draw repeated samples to compare the distribution of their means with the population distribution and a normal approximation.
1Draw a sample, keep its mean, repeat
Draw n values from a population and average them. Do it again and the mean comes out a little different. Pile up thousands of such means and you have the sampling distribution of the mean. It centers on the population mean μ, and its spread is σ / √n, where σ is the population’s standard deviation.
The central limit theorem says the pile also turns into a bell as n grows, whatever the population’s shape, as long as the draws are independent and the variance is finite. Start with the skewed population at n = 5, then try n = 1 and n = 30.
Most values are small and a long tail runs to the right, like response times or incomes.
No samples yet. The theorem predicts that means of 5 values will center on 1.49 with a spread of 1.46 / √5 = 0.65.
More controls
Zoomed in, the lower chart runs from 0.00 to 4.75, the shaded band in the population chart.
2Means of 30 from a skewed population
The skewed population has mostly small values, a long tail to the right and a mean of 1.49. Draw 30 values, record their mean, and repeat 2,000 times. What does the pile of means look like?
3Four times the data, half the error
The spread of the pile of means is the standard error of the mean. With independent draws it is the population's standard deviation σ divided by √n. Going from 1 value to 4 halves it, and so does going from 25 to 100, at a cost of 75 more values.
1.46 / √5 = 1.46 / 2.24 = 0.65. Draw some samples to compare it with the pile. At n = 20 it would be 0.33.
Point at a symbol in the formula to light up its bar in section 1. The coin toss page has the same square-root rule.
4Skewed populations need bigger samples
The center and spread of the pile follow the formulas at any n. The shape does not. The skewness of the mean is the population's skewness divided by √n, so a very lopsided population keeps a visible lean in its means long after a mild one has lost it. The flat and two-humped populations are symmetric, so their piles never lean.
Expected skewness of the pile at n = 5: 1.77 for skewed and 2.88 for rare outliers, divided by √5. A bell has 0.
Most samples of 10 hold no outlier or just one, so at n = 10 the means fall into separate clusters. At n = 100 the clusters merge, though a lean to the right is still there.
5Check yourself
The tasks use the lab in section 1 and tick themselves when you meet them.
- Choose Two humps, set n to 1 and draw at least 1,000 samples. A mean of one value is that value, so the pile should copy the population, humps and all.Now: Skewed, n = 5, 0 samples
- With the flat population and n = 16 the standard error is 0.72. Find the sample size that halves it, then draw at least 500 samples to check the pile agrees.Now: Skewed, n = 5: predicted spread 0.65, observed n/a from 0 samples
- Choose Rare outliers and raise n until a pile of at least 2,000 means has a skewness below 0.40. The skewed population gets there by about n = 20. This one needs far more.Now: Skewed, n = 5: skewness n/a from 0 samples
6Simulate the means in R
The snippet draws from the skewed population and takes 10,000 samples of n = 5, the lab’s starting size. The spread of the means matches σ / √n = 0.65, and their skewness, 0.80, is close to the population’s 1.77 divided by √5.
Simulate sample means from a skewed populationShow the code
# The page's skewed population: density proportional to
# exp(-x / 1.5) between 0 and 10
k <- 1 - exp(-10 / 1.5)
dpop <- function(x) exp(-x / 1.5) / (1.5 * k)
rpop <- function(m) -1.5 * log(1 - runif(m) * k)
mu <- integrate(function(x) x * dpop(x), 0, 10)$value
v <- integrate(function(x) (x - mu)^2 * dpop(x), 0, 10)
sigma <- sqrt(v$value)
round(c(mu = mu, sigma = sigma), 2)
# 10,000 samples of n = 5, keeping the mean of each
set.seed(1)
n <- 5
means <- replicate(10000, mean(rpop(n)))
# Center and spread of the means against mu and sigma / sqrt(n)
round(c(mean = mean(means), sd = sd(means),
rule = sigma / sqrt(n)), 2)
# Skewness of the population, that value divided by sqrt(n),
# and the skewness of the pile of means
m3 <- integrate(function(x) (x - mu)^3 * dpop(x), 0, 10)
g <- m3$value / sigma^3
skew <- function(x) mean((x - mean(x))^3) / sd(x)^3
round(c(pop = g, rule = g / sqrt(n), means = skew(means)), 2)Uses base R only.
What the theorem gives you
- At n = 1 the pile of means is the population itself. Averaging is what makes the bell.
- The standard error σ / √n halves only when n quadruples. For the flat population it is 0.72 at n = 16 and 0.36 at n = 64.
- The skewness of a mean is the population’s skewness over √n. The skewed population drops below 0.40 by about n = 20; the rare-outliers population needs about 52.
- A confidence interval multiplies the estimated standard error by a t or z value, which is why confidence intervals narrow with √n.
- The reliability page uses normal errors around each true score to read the standard error of measurement as a band that holds about 68% of repeated scores.
Recommended reading
- Introductory Statistics 2eBarbara Illowsky and Susan DeanChapter 7, the central limit theorem