Confidence Intervals: What They Really Mean

simulator intermediate ~8 min
Loading simulation...
95% CI: [94.5, 105.5] — margin of error ≈ 5.5

With n=50 and σ=20, the 95% confidence interval has a margin of error of about 5.5 units around the sample mean. Approximately 95% of such intervals contain the true mean.

Formula

CI = x̄ ± z* × (σ / √n)
Margin of Error = z* × (σ / √n)
Required n = (z* × σ / E)² for desired margin E

The Interval That Doesn't Mean What You Think

Confidence intervals are one of the most widely used and most widely misunderstood tools in statistics. When a poll reports "52% ± 3%," most people interpret this as a 95% probability that the true value is between 49% and 55%. This interpretation, while intuitive, is technically incorrect — and the correct interpretation reveals a deep philosophical distinction between frequentist and Bayesian probability.

How Confidence Intervals Work

A confidence interval is constructed by taking the sample mean and adding or subtracting a margin of error. The margin depends on three things: the z-score corresponding to your chosen confidence level, the population standard deviation, and the sample size. The key insight is that the interval is random (it depends on the sample), while the true parameter is fixed. Different samples produce different intervals, and the confidence level tells you what fraction of those intervals capture the truth.

The Square Root Law

The margin of error shrinks with the square root of the sample size — one of the most important relationships in statistics. To halve the margin of error, you need four times the sample size. This explains why opinion polls use about 1,000 respondents: going from 1,000 to 10,000 would only reduce the margin from ±3% to ±1%, rarely worth the tenfold increase in cost. This simulator lets you see this diminishing-returns curve in real time.

Coverage and Calibration

The ultimate test of a confidence interval procedure is its coverage rate — does a 95% interval actually contain the true value 95% of the time? This simulator draws many intervals from repeated samples, letting you verify that roughly 95 out of 100 intervals capture the true mean. The ones that miss are not "wrong" — they are the expected 5% that any honest procedure must produce.

FAQ

What does a 95% confidence interval actually mean?

It means that if you repeated the sampling process many times, about 95% of the resulting intervals would contain the true population parameter. It does NOT mean there is a 95% probability that the true value lies in this specific interval — the true value is fixed, not random.

How does sample size affect the confidence interval?

The margin of error is proportional to 1/√n, so quadrupling the sample size halves the width of the interval. This is why large studies give more precise estimates, but there are diminishing returns — going from n=100 to n=10,000 only narrows the interval by a factor of 10.

What is the difference between confidence level and confidence interval?

The confidence level (e.g., 95%) is the long-run coverage probability you choose before collecting data. The confidence interval is the specific range computed from your sample. Higher confidence levels produce wider intervals — you pay for more confidence with less precision.

When should I use a confidence interval instead of a p-value?

Confidence intervals are generally more informative because they show both the estimated effect size and its uncertainty. A p-value only tells you whether an effect is statistically significant, not how large it is. Many journals now require confidence intervals alongside or instead of p-values.

Sources

Embed

<iframe src="https://homo-deus.com/lab/statistics/confidence-intervals/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub