Section 1.11

Confidence Intervals

A single estimate ("the average is 102") says nothing about how far off it might be. A confidence interval adds that: it reports a range of plausible values, like "somewhere between 99 and 105." The phrase "95% confident" trips almost everyone up, so let's pin down what it means.

From estimate to interval

Recall that a sample mean has a sampling distribution with a known spread (the standard error). A confidence interval just wraps a margin around the estimate:

estimate ± (critical value) × (standard error)

Pick a higher confidence level and the critical value grows, so the interval gets wider. You trade precision for a better chance of being right. The playground below shows that trade-off, and what "95%" means. (To build an interval from your own numbers, paste a column into the descriptives calculator, which returns the interval and every quantity that goes into it. The tables calculator gives the critical value on its own.)

🎮 Confidence Interval Coverage

The dashed line is the true mean (normally unknown, though here we cheat and show it). Each horizontal bar is one study's interval. Green bars caught the truth; red ones missed.

Intervals built0
Captured the truth0
Capture rate—
Target95%

What "95% confident" really means

Keep drawing studies and watch the capture rate settle near your chosen level. The confidence level is that long-run capture rate:

"95% confidence" is a statement about the procedure, not about any single interval. If you repeated the study endlessly, about 95% of the intervals you'd build would contain the true value. Any one interval either contains it or doesn't, so you cannot say a single interval has a 95% probability of containing it.

The red bars are expected. At 95% confidence, roughly 1 interval in 20 misses entirely, and that 5% miss rate is built into the method. Switch to 99% and misses become rare, but every interval gets wider (less precise). Switch to 90% and intervals tighten, but you miss more often.

What changes the width

  • Confidence level ↑ → wider. A higher level needs a larger critical value.
  • Sample size ↑ → narrower. More data shrinks the standard error, so the margin shrinks. Slide n up and watch the bars tighten around the truth.

When σ is known: the z-interval

Textbooks usually introduce the interval in a simpler setting than the playground above. The setting is artificial, but it makes each step clear. Suppose the population standard deviation σ (sigma) is already known and only the mean is in doubt. A factory that has measured its filling machine for years knows how much its boxes vary, but the average fill can shift from batch to batch. With σ known, the standard error is exactly σ/√n, with nothing estimated, and the critical value comes from the normal curve:

x̄ ± z* · σ/√n

Three values of z* cover almost every exam question, so learn them by heart: 1.645 for 90% confidence, 1.960 for 95%, 2.576 for 99%. They are printed along the foot of Table D, under the confidence levels, and they are also that table's bottom row, the one labeled ∞. The same three numbers appear in both places because a t distribution with infinitely many degrees of freedom is the normal distribution.

The quantity after the ± sign is the margin of error, m = z*·σ/√n. It is the half-width of the interval, and a poll's "±3 points" is a margin of error. Only three things change it. More confidence raises z* and widens the margin, as the coverage playground showed. A noisier population widens it too, and you can rarely change σ. Sample size is the one you control. It works through √n, so halving a margin takes four times the data.

Solved for n, the same formula plans a study. Choose the largest margin you can accept, then solve for the sample size that gives it:

n = (z* · σ / m)²

Always round the answer up. Rounding down leaves a margin slightly wider than the one you planned for.

Worked, on a calculator. A machine is supposed to put 227 g of cereal in a box, and years of records give σ = 5 g. Four boxes off this morning's line average x̄ = 222 g. The standard error is 5/√4 = 2.5, the 95% margin is 1.960 × 2.5 = 4.90, and the interval is 222 ± 4.90, or [217.1, 226.9] grams. The target value 227 is outside it. A hypothesis test uses the same evidence from the other side: it starts at 227 and asks how far the sample mean is from it.

🎮 Interval Builder

Type in a sample mean, a known σ and a sample size to see the interval in the units of the measurement. The curve shows how x̄ varies from sample to sample: a normal with spread σ/√n, centered on this sample's mean. The shaded middle area is your confidence level, and the bar under its two edges is the interval.

Standard error of the mean—
Critical value z*—
Margin of error—
Interval—

Three cautions the formula does not show. The data have to come from a simple random sample of the population you want to describe. No interval corrects a biased sample, and a larger biased sample only gives the wrong answer more precisely. σ has to be known from outside this dataset, not estimated from the same four boxes. And an interval measures sampling variation only: it says nothing about a miscalibrated scale or a question that measured the wrong thing. In the usual case σ is unknown, s takes its place, and z* becomes t*. §1.13 covers that case.

Why it matters: a confidence interval reports an estimate with its uncertainty, as a range plus a stated long-run success rate. It is also closely tied to hypothesis tests, which come next: a 95% interval for a mean holds exactly the values that a two-sided test at α = .05 would not reject.

Two practice problems run on this lesson. Problem 8 builds a 95% interval from 25 students by hand and shows how much quadrupling the sample narrows it. Problem 17 works the σ-known version at two confidence levels, then solves for the sample size a stated margin needs.

Common questions

Does a 95% confidence interval mean there's a 95% chance the true value is inside?

Not quite: the 95% describes the procedure, not any single interval. If you repeated the study endlessly, 95% of the intervals built this way would capture the truth; the one interval in front of you either contains it or doesn't. If you want a statement like "95% probability the parameter is in this range," that's what Bayesian credible intervals provide.

Can I tell whether two groups differ by seeing if their confidence intervals overlap?

Half of that inference is safe and the other half is not. If two 95% intervals do not overlap, the difference is significant at the .05 level, always. The reverse does not follow: overlapping intervals are perfectly compatible with a significant difference, because the interval around a difference is narrower than the two individual intervals side by side. For two equally precise means, the difference reaches p = .05 while the intervals still overlap by about 29% of their length. Any smaller overlap also means p < .05, even though the eyeball test would call it non-significant. Test the difference itself, or plot the interval around the difference rather than two intervals around the means. For paired or repeated measures the eyeball test is worse still, since the two intervals ignore the within-person correlation that the test uses.

What does it mean if my confidence interval contains zero?

For a difference or an effect, an interval like [−1.2, +3.5] says "zero effect is among the plausible values," so the result is not statistically significant at the matching α. That's a statement of uncertainty, not proof of no effect: the interval also contains plenty of non-zero values. Wide intervals containing zero usually mean the study was underpowered.