Confidence Intervals

Draw a thousand intervals from a known population and count how many contain the answer. The confidence is a property of the procedure.

Confidence Intervals

This module needs JavaScript: the numbers are computed in the page rather than recorded.

Worth knowing

A 95% interval does not mean the parameter is 95% likely to be inside your interval. It is inside or it is not.
It means the procedure produces intervals that contain the parameter 95% of the time.
The width is z · SE, so it shrinks like √n.
Higher confidence buys a wider interval and nothing else. A 99% interval says less about where the answer is, not more.

Overview

Construct and interpret the interval

For a sample mean with known population standard deviation under a normal model (or an appropriate large-sample approximation), a two-sided confidence interval is x̄ ± z*σ/√n. In practice, σ is often unknown and a t critical value with estimated standard error is used under the relevant assumptions.

estimate ± critical value × standard error

A 95% confidence procedure produces intervals that contain the fixed parameter in about 95% of repeated samples under the model. After one interval is calculated, frequentist interpretation does not assign a 95% probability to the fixed parameter being inside that particular interval.

In this guide
  1. Width and assumptions
  2. Work through an interval calculation
  3. Try this above
  4. Sources and next steps

Confidence Intervals

A confidence interval is a procedure that uses sample data to produce a range for an unknown population quantity.

Width and assumptions

Larger samples usually narrow the interval because standard error shrinks; greater variability or higher confidence widens it. The interval’s validity depends on the sampling design, model, and method. A narrow interval from biased or dependent data is not reliable. See sampling distributions, standard deviation, and hypothesis testing.

Work through an interval calculation

The pattern is estimate ± critical value × standard error. For a sample mean with known population σ, suppose x̄=50, σ=10, and n=100. Then SE=10/√100=1. A 95% normal critical value is about 1.96, giving 50±1.96, or approximately (48.04, 51.96). In most real problems σ is unknown; a t critical value and sample standard deviation are used when the design and assumptions support them. For a proportion or a complex survey, the formula may be different.

The confidence level describes repeated performance of the procedure: under the model, about 95% of intervals from repeated samples would cover the fixed parameter. It is not a 95% probability statement about this already-calculated interval in the usual frequentist interpretation. A confidence interval also differs from a prediction interval for an individual future observation, which includes individual variation and is wider. State the parameter and method along with the endpoints. A narrow interval cannot fix bias, nonresponse, or dependence in the sample.

Try this above

Increase the sample size and then the confidence level. Observe how each change affects the interval width.

The half-width in the example is 1.96 standard errors. If the confidence level stays fixed, quadrupling n halves the standard error and approximately halves the interval's width. To make a margin of error half as large, one generally needs about four times as many independent observations. This planning rule addresses random sampling variation only. If participants self-select or the measurement systematically misses the target, collecting more of the same biased data can produce a narrower but still misleading interval.

Two intervals can overlap while a test of their difference is statistically significant, or appear separate while a formal comparison has different assumptions. Comparing separate confidence intervals is not always equivalent to a confidence interval for the difference. If the scientific question is a contrast between groups, calculate an interval for that contrast directly. Also distinguish a confidence interval for a population mean from a prediction interval for a new measurement; they target different quantities and have different widths.

Sources and next steps

Check yourself

0 of 3

Answer without scrolling back up.

  1. What does the 95% in a 95% confidence interval describe?

  2. Why does a nominal 95% interval cover only about 89% at n = 5 here?

  3. Two 95% intervals overlap. What follows?

Cheat sheet

Confidence Intervals

Draw a thousand confidence intervals and count how many capture the true mean. See what the ninety-five percent actually refers to.

MATHS · vizlearn.in/maths/confidence_intervals.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.

Teaching a course with this? Individual teachers can use it freely; for a whole department or programme, see institutional licences.