Understanding the confidence interval for a mean — concept and principle
A confidence interval gives a range of plausible values for a population mean, based on a sample mean, its standard deviation and the sample size. Instead of reporting "the average is 50", you report "the average is 50, with a 95% confidence interval of 47.0 to 53.0". It is standard in research reports, quality control and survey summaries.
How it is calculated
- Standard error: SE = s ÷ √n, where s is the sample standard deviation and n the sample size.
- t interval: x̄ ± t* × SE, where t* is the critical value of Student's t distribution with n − 1 degrees of freedom that leaves (1 − C)/2 in each tail for confidence level C.
- Margin of error = t* × SE.
- z interval: x̄ ± z* × SE using the normal distribution (z* = 1.96 for 95%), shown for comparison.
The interval is in the same unit as the mean.
The principle
Sample means vary from sample to sample with spread SE. Because the true σ is unknown and estimated by s, the standardised mean follows a t distribution, which has heavier tails than the normal, especially for small n. William Sealy Gosset published this result in 1908 under the pseudonym "Student". As n grows, t* approaches z*, and the two intervals converge.
Worked example
- Inputs: x̄ = 50, s = 8, n = 30, confidence 95%.
- SE = 8 ÷ √30 = 1.460593.
- Degrees of freedom = 29, so t* = 2.045229642.
- Margin of error = 2.045230 × 1.460593 = 2.987249094.
- t interval: 50 ± 2.987249 = 47.01275091 – 52.98724909.
- z interval: 50 ± 1.959964 × 1.460593 = 50 ± 2.862711 = 47.13728937 – 52.86271063.
How to read the result
"95% confidence" describes the method: if you repeated the sampling many times, about 95% of the intervals built this way would contain the true mean. The z interval is slightly narrower and therefore too optimistic when σ is estimated from the sample. A narrower interval needs a larger sample: halving the margin of error requires about four times as many observations.
Common mistakes
- Saying "there is a 95% probability the true mean is in this interval" for one specific interval.
- Entering the standard error instead of the standard deviation.
- Using the interval for individual values; it is about the mean, not the spread of individuals.
Frequently asked questions
Should I use t or z?
Use t whenever the standard deviation comes from the sample, which is almost always. Use z only when σ is truly known.
Why does a 99% interval come out wider?
Higher confidence requires a larger critical value (t* ≈ 2.756 for 99% with 29 df), so the range widens.
Two intervals overlap; are the means different?
Overlap does not prove the means are equal. Use a two-sample t-test to compare them directly.
Sources: Student (1908). The probable error of a mean. Biometrika, 6(1), 1–25. · NIST/SEMATECH e-Handbook of Statistical Methods.