Interactive statistics

56 free interactive lessons: from mean and median to A/B tests and Bayes. Drag the charts and build intuition. No sign-up.

Module 4: From sample to world

Confidence intervals

A single sample mean is a point estimate, and it is almost surely slightly off. It is more honest to state not a point but a range in which the true value plausibly lies. That is a confidence interval. But what exactly does "95%" mean?

true value ⟷ (drag it)
β–¬ blue β€” interval covered the truth: 0β–¬ red β€” MISSED it: 0covered β€”% (expected β‰ˆ 95%)
CI = xΜ„ Β± zΒ·SE = xΜ„ Β± 1.96Β·(Οƒ/√n)
for a share (A/B): pΜ‚ Β± 1.96·√( pΜ‚(1βˆ’pΜ‚)/n )
z depends on the confidence level: 90% β†’ 1.645, 95% β†’ 1.96, 99% β†’ 2.576. Higher level β€” wider interval.
Level:

The white dashed line is the true value (unknown to us in real life). Take a sample: it yields a mean and an interval around it. Press "take a sample" a few times β€” each segment is the interval from one sample.

What it means

That is why reports say not "conversion 12%" but "12% Β± 2%": the interval honestly shows how confident we are. Two estimates with overlapping intervals are too early to tell apart β€” we'll see this in the A/B test lesson.

And remember: a wide interval is not an error but a signal that "data is scarce". Want it narrower β€” collect more observations.

Where it shows up

Confidence intervals stand behind the "margin of error" in poll coverage ("45% Β± 3%"), behind forecast ranges and error bars on dashboard charts.

It is the same thing everywhere: don't pretend the estimate is exact β€” show its uncertainty honestly.

Definitions
Point estimate
a single number β€” e.g. the sample mean. Almost always slightly off the truth.
Confidence interval
a range around the estimate built so that, over repeated experiments, a set share of intervals (e.g. 95%) covers the true value.
Confidence level
that very share (95%, 99%): how often the method produces a covering interval over the long run.
When the method lies (assumptions)

The formula CI = xΜ„ Β± zΒ·SE relies on the normality of the sampling distribution (the CLT) and a sample-based estimate of Οƒ; for small n use the t-distribution instead of z (slightly wider). For a share you need enough successes and failures.

The interval captures only RANDOM error. Systematic bias (an unrepresentative sample) is invisible to it β€” you can get a narrow but wrong interval around a biased estimate.

Next β†’
Enjoying the materials?

This site is built by the DataSlice Telegram channel: data analytics in plain words β€” real cases, metrics, careers. The channel is in Russian.

Open the Telegram channel