Measured in Standard Errors
Sampling distributions, z-scores, and when to use a t-statistic instead. Uses means, standard deviations and square roots; no code.
Both curves are drawn to the same height; compare their widths.
The n slider appears here once you lock in your prediction.
1. How spread out are averages?
On a lab's standard reaction-time test, people's times have mean μ = 250 ms and standard deviation σ = 30 ms (ms: milliseconds). Pick n people at random and average their times: that average, x̄, changes from sample to sample. The curve of all possible x̄ values is the sampling distribution of the mean. Its SD is the standard error.
The chart shows samples of n = 4 people. If each sample had 16 people instead, what would happen to the spread of the averages?
You predicted it would halve, and it does. Move n from 4 to 16: the standard error falls from 15 to 7.5 ms. The spread of an average is σ ÷ √n, and √16 is twice √4.
One more: with n = 64, the standard error is 30 ÷ √64 = 30 ÷ 8 = 3.75 ms.
You predicted a quarter, the natural guess when n is 4 times bigger. Move n from 4 to 16: the standard error falls from 15 to 7.5 ms, only to half. The spread of an average is σ ÷ √n, not σ ÷ n, and √16 is just twice √4. To quarter it, you need 16 times the people (n = 64).
One more: with n = 64, the standard error is 30 ÷ √64 = 30 ÷ 8 = 3.75 ms.
You predicted no change. The dashed curve, one person, does stay the same: σ is still 30 ms. But move n from 4 to 16 and the solid curve, the average, narrows: its SD falls from 15 to 7.5 ms. In a bigger sample, fast and slow people cancel out more. The spread of an average is σ ÷ √n.
One more: with n = 64, the standard error is 30 ÷ √64 = 30 ÷ 8 = 3.75 ms.
You predicted it would grow. A bigger sample does include more extreme people, but they are averaged with everyone else. Move n from 4 to 16: the solid curve narrows and its SD falls from 15 to 7.5 ms. The spread of an average is σ ÷ √n.
One more: with n = 64, the standard error is 30 ÷ √64 = 30 ÷ 8 = 3.75 ms.
One person's time, in ms and as a z-score
Each step of one SD (30 ms) along the top axis is one unit of z along the bottom axis.
2. How far from the mean, in SDs?
A z-score says how many standard deviations a value sits above (+) or below (−) the mean:
z = (value − mean) ÷ SD
One person's reaction time: mean μ = 250 ms, SD σ = 30 ms.
One person's time is 301 ms. What is their z-score?
Another person's time is 238 ms. What is their z-score?
The chart for averages of 9 appears here once you check an answer to the first question.
Averages of 9 people, in ms and as z-scores
The same z-scale as step 2, but now one unit of z is one standard error (10 ms), not one person's SD (30 ms).
3. How unusual is a sample's average?
For a sample mean, measure the distance in standard errors, the SD of the sampling distribution:
standard error = σ ÷ √n z = (x̄ − μ) ÷ (σ ÷ √n)
Reaction times: μ = 250 ms, σ = 30 ms. 9 people who have just drunk coffee average x̄ = 232 ms.
What is the standard error for an average of 9 people, in ms?
What is the z-score of their average, 232 ms?
A chart comparing the two curves appears here once you lock in your prediction.
4. What if σ is unknown?
The z for a sample mean needs σ, the SD of the whole population. In practice σ is almost never known, so we estimate it from the sample. That forces two changes:
1. Estimate σ with the sample SD, dividing by n − 1, not n:
s = √( Σ(xᵢ − x̄)² ÷ (n − 1) )
The deviations are measured from x̄, the sample's own mean, not from μ, and the sum of squared deviations from x̄ is never larger than the sum from μ. So dividing that sum by n would give a variance that is too small on average. Dividing by n − 1 corrects this exactly on average: s² is an unbiased estimate of σ². (R's sd() already divides by n − 1.)
2. Compare with the t-distribution, not the normal curve:
t = (x̄ − μ) ÷ (s ÷ √n), df = n − 1
s changes from sample to sample, so t does not follow the normal curve. If the observations are independent draws from a normal population whose mean really is μ, t follows the t-distribution with n − 1 degrees of freedom exactly; for other populations that is an approximation, which improves as n grows. The t-distribution assumes s was computed with n − 1, so the two changes go together.
Compared with z-scores, how often will t‑statistics land far from 0 (beyond −2 or +2)?
You predicted more often, and the chart agrees: the t curve's tails (shaded) are thicker than the normal curve's. In a small sample s often comes out below σ; dividing by that too-small standard error pushes t far from 0. Its shape depends on the degrees of freedom, df = n − 1. With df = 3 (4 people), 13.9% of t-statistics land beyond ±2, against 4.6% for z.
Slide df up to 30: the t curve moves almost onto the normal curve. Try it: with 16 people, df = 15; what share lies beyond ±2?
You predicted about as often. s is close to σ on average, but in a small sample it often comes out well below σ (with 4 people, about 6 times in 10), and dividing by too small a standard error pushes t far from 0. The chart shows it: with df = 3 (4 people), 13.9% of t-statistics land beyond ±2, against 4.6% for z. The shape depends on the degrees of freedom, df = n − 1.
Slide df up to 30: the t curve moves almost onto the normal curve. Try it: with 16 people, df = 15; what share lies beyond ±2?
You predicted less often. It is the other way round: an s that comes out below σ shrinks the standard error and pushes t far from 0, and in small samples that happens often. The chart shows it: with df = 3 (4 people), 13.9% of t-statistics land beyond ±2, against 4.6% for z. The shape depends on the degrees of freedom, df = n − 1.
Slide df up to 30: the t curve moves almost onto the normal curve. Try it: with 16 people, df = 15; what share lies beyond ±2?
Where the numbers go
| Symbol | Meaning | Here |
|---|---|---|
| x̄ | the sample's average | 262 ms |
| μ | the mean we compare with | 250 ms |
| s | the sample SD (divided by n − 1) | 24 ms |
| n | people in the sample | 16 |
σ for the app is unknown, so s stands in for it.
5. Work out a t-statistic
t = (x̄ − μ) ÷ (s ÷ √n) df = n − 1
A new phone app measures reaction time; nobody knows its σ. 16 people try it: their average is x̄ = 262 ms and the SD of their 16 times is s = 24 ms. Compare with the lab test's mean, μ = 250 ms.
What is the t-statistic?
How many degrees of freedom does this t have?
The two statistics
z = (x̄ − μ) ÷ (σ ÷ √n): σ, the population's SD, is known. Compare with the normal curve.
t = (x̄ − μ) ÷ (s ÷ √n): σ is unknown, so (1) s is the sample SD, dividing by n − 1, and (2) compare with the t-distribution, df = n − 1.
6. z or t?
The lab test has decades of records: its σ is 30 ms. Assume coffee can shift reaction times but not their spread, so σ = 30 ms still applies. Nine people who have just drunk coffee average 232 ms; the SD of their 9 times is 26 ms. To compare their average with 250 ms, which should you compute?
A café's machine manual says an espresso shot takes 25 seconds. The café times 50 shots: their average is 27 seconds and the SD of the 50 times is 4 seconds. There are no other records of shot times. To compare their average with 25 seconds, which should you compute?
You should now be able to:
- say why averages of n vary less than single values, by σ ÷ √n (step 1);
- turn a value or a sample mean into a z-score (steps 2 and 3);
- choose z or t by asking whether σ is known; when it is not, do both things: compute s by dividing by n − 1, and use the t-distribution with df = n − 1 instead of the normal curve (steps 4 to 6).
Assumptions
- dataAll numbers are made up: the lab test (μ = 250 ms, σ = 30 ms), the coffee sample (n = 9, x̄ = 232 ms, s = 26 ms), the app sample (n = 16, x̄ = 262 ms, s = 24 ms) and the café's 50 shots (mean 27 s, SD 4 s).
- distributionReaction times are drawn as normal with mean 250 ms and SD 30 ms. Real reaction times are somewhat skewed right; the normal shape is a simplification.
- simplificationPeople are sampled at random and independently, so the average's SD is σ ÷ √n. The t curve's shape assumes a roughly normal population, which matters most for small n.
- simplificationIn step 1 both curves are scaled to the same peak height so their widths can be compared; steps 2 to 4 draw true densities.
- parameterStep 1: n from 1 to 64 (default 4). Step 4: df from 1 to 30 (default 3); shares beyond ±2 are 2·P(T < −2), computed by numerical integration of the t density (R: 2*pt(-2, df)).
Left out: confidence intervals, hypothesis tests and p-values, which use the same z and t curves.