Section 1.11

Confidence Intervals

A single estimate ("the average is 102") pretends to a precision it doesn't have. A confidence interval is more honest: instead of one number, it reports a range of plausible values, like "somewhere between 99 and 105." But the phrase "95% confident" trips almost everyone up. Let's pin down what it actually 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 makes that trade-off, and the real meaning of "95%," impossible to miss. (To build one from your own numbers rather than a slider, paste a column into the descriptives calculator, which returns the interval along with everything that goes into it; the tables calculator supplies 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. That is the meaning of confidence:

"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. There is no "95% probability" hiding inside a single result.

This is why the red bars matter. At 95% confidence, roughly 1 interval in 20 misses entirely, and that's not a bug, it's the advertised failure rate. 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. More certainty demands more room.
  • 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 introduce the interval one rung below the playground above, in a setting that is artificial and clarifying at the same time. 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; what shifts from batch to batch is where that variation is centered. With σ in hand the standard error is σ/√n exactly, with nothing estimated, and the critical value comes straight off the normal curve:

x̄ ± z* · σ/√n

Three values of z* cover almost every question an exam will ask, and they are worth knowing without looking them up: 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 ∞. A t distribution with infinitely many degrees of freedom is the normal distribution, which is why the same three numbers appear in both places.

The quantity after the ± sign has a name of its own. The margin of error, m = z*·σ/√n, is the half-width of the interval, and it is what a poll means by "±3 points". Only three things move it. Asking for more confidence raises z* and widens the margin, which is the trade the coverage playground makes visible. A noisier population widens it too, and σ is rarely yours to change. Sample size is the lever you actually control, and it works through √n, so halving a margin takes four times the data.

Read backwards, that same relationship is how a study gets planned. Fix the margin you are willing to live with, then solve for the sample size that delivers it:

n = (z* · σ / m)²

Round that answer up, always. Rounding down leaves you with a margin slightly wider than the one you promised, and a fraction of a participant is not a participant.

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 sits outside it. That is the same evidence a hypothesis test works with, arriving from the other direction.

🎮 Interval Builder

Type in a sample mean, a known σ and a sample size, and watch the interval assemble itself in the original units of the measurement. The curve is what x̄ does from sample to sample, a normal with spread σ/√n, drawn centered on the mean this one sample happened to give. The shaded middle is your confidence level, and the bar underneath its two edges is the interval.

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

Three cautions the formula hides. The data have to come from a simple random sample of the population you mean to describe, because no interval repairs a biased sample and a larger biased sample only states the wrong answer more precisely. σ has to be genuinely known from outside this dataset rather than estimated from the same four boxes. And an interval quantifies sampling variation, nothing else: it says nothing about a miscalibrated scale or a question that measured the wrong thing. The honest everyday case, where σ is unknown and s stands in for it, replaces z* with t* and is what §1.13 is about.

Why it matters: confidence intervals are how good science reports uncertainty: not a false-precision point estimate, but a range plus a stated reliability. They're also two sides of the same coin as hypothesis tests, which come next.

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, and Problem 17 works the σ-known version at two confidence levels before solving 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, so a whole band of genuinely significant results looks non-significant to the eyeball test. 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.