E = t · s/√n
Holds when the values are a random sample from a roughly normal population, or when the sample is large
enough for the mean to be roughly normal anyway.
E is the margin of error, s the sample’s
standard deviation, n the number of values and t the critical value
for the chosen confidence level, with n − 1 degrees of freedom. The interval itself is the mean plus and minus the margin:
x̄ − E to x̄ + E. The formula is a definition of how wide the interval is made.
The critical value comes from the t-table. It is t rather than the
normal distribution’s z (1.96 at 95%) because s is
estimated from the same sample: the uncertainty in s widens the interval, and the t distribution accounts
for it. The larger the sample, the closer t gets to z. At 95% and 30 degrees of freedom t = 2.04, and at a
few hundred degrees of freedom the difference from 1.96 is negligible.
Worked examples
The margin at 95%. The sample 2, 4, 4, 4, 5, 5, 7, 9 has n = 8, x̄ = 5 and s ≈ 2.1381.
- s/√n = 2.1381 / √8 ≈ 0.7559.
- With n − 1 = 7 degrees of freedom, t = 2.365 at 95%.
- E = 2.365 · 0.7559 ≈ 1.79.
The interval. 5 − 1.79 = 3.21 and 5 + 1.79 = 6.79. The interval is roughly 3.21 to 6.79.
At 99%. With t = 3.499, E = 3.499 · 0.7559 ≈ 2.64, and the interval is 2.36 to 7.64. A higher
confidence level gives a wider interval.
A bigger sample. Had the same spread been measured on 32 values, four times as many, s/√n =
2.1381 / √32 ≈ 0.378. With 31 degrees of freedom t = 2.040, so E ≈ 0.77 at 95%. Four times the values
halves s/√n, and t shrinks too, so the margin ends up less than half.
Common mistakes
- Using the population standard deviation. A sample takes s, which divides by n − 1. Dividing by n
gives a slightly too small spread and a too narrow interval.
- Reading 95% as a chance for this one interval. The true mean either lies in the interval or it does
not. 95% says the method, repeated on new samples, hits in 95 cases out of 100 in the long run.
- Using z = 1.96 with a small sample. With s taken from the sample it should be t. At n = 8, 1.96
gives a margin about a sixth too narrow.
- Expecting twice the values to halve the margin. The margin shrinks with √n. Halving it takes four
times the values.
Common questions
When is z = 1.96 used?
When the population’s standard deviation σ is known rather than estimated from the sample. Then 95% of
the normal distribution’s area lies between −1.96 and 1.96. For 90% the matching number is 1.645, and
for 99% it is 2.576. With a large sample, t is so close to z that both give nearly the same answer.
What is the actual interval, not just the margin?
The mean minus the margin to the mean plus the margin. For the example above that is 5 ± 1.79, so
roughly 3.21 to 6.79. The card works out the margin; the rest is one subtraction and one addition.
Why n − 1 and not n?
Because the sum of squares around the sample’s own mean comes out smaller than around the population’s
true mean. Dividing by n would therefore understate the spread on average, and n − 1 corrects for it.
The sample variance page explains it further.