Math paradoxes

Glossary / Confidence interval

Glossary · confidence interval

Of twenty honest intervals, one misses. Which one?

A report says: "conversion 5.2%, 95% confidence interval 3.8% to 6.6%". The interval is an honest admission: we don't know the exact number, here is a range. But the 95% is not about this range, it is about the method. If you repeat the measurement again and again, about 19 intervals in 20 will cover the true conversion rate and one will miss. And from the inside, none of them knows whether it is that twentieth one.

In plain wordspictures, analogies, small numbers

“In plain words” is hidden on all puzzles.

The hundred intervals paradox

The page's true conversion rate is 5.0%. Only the simulation knows it. A hundred marketers each measure it on their own sample of visitors and each draws an interval. The vertical line is the truth. The intervals that missed it are coloured.

covers the truthmissesthe true 5.0%

Missed in this hundred–
–
Cover · exact calculation–

The net, not the fish

This is a simplified picture, but an accurate one. The method that builds the interval is a net cast into the water. The true number is a fish that stays put. The 95% is the quality of the net: out of every 100 casts, 95 catch the fish. Once the net is pulled out, the fish is either in it or not; "95% chance" no longer applies to this particular catch. But without knowing where the fish is, you can't see whether this catch was a good one. Press "Hide the truth" above: the intervals that missed look exactly like the rest.

  • Right: the method catches the truth in 95% of samplesThat is what the interval was designed for: if everyone in a company computes 95% intervals, about one in twenty of them will be wrong.
  • Wrong: "a 95% chance the truth is in this interval"Almost everyone says this, and for everyday work it is often harmless. But strictly speaking, the truth isn't random; only the interval is.
  • Wrong: "95% of visitors are within these limits"The interval is about one number, the conversion rate or the average order, not about the spread of individual people. It narrows as the sample grows, while people do not become more alike.
  • Four times the data, half the widthSwitch between 1,000, 4,000 and 16,000 visitors: each time the intervals get half as long. Precision grows as the square root of the sample size, so every further gain costs more.
  • A higher level means a wider netMove the confidence level to 99%: fewer misses, but wider intervals. To 80%: narrower, but one in five misses. Certainty doesn't come free.
Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

The width of the interval: ±z · SE

p̂ ± z · √(p̂ (1 − p̂) / n)  ·  z = 1.28 (80%), 1.64 (90%), 1.96 (95%), 2.58 (99%)

p̂ is the measured conversion rate, n the number of visitors. The square root is the standard error SE: how far the measured rate usually strays from the true one. z says how many such errors to lay off on each side so that the normal curve covers the chosen share. Here is half the width of a 95% interval at a 5% conversion rate:

VisitorsConversions± in pp± of 5%
1,000501.3527%
4,0002000.6813.5%
16,0008000.346.8%

With 1,000 visitors, "5%" really means "somewhere from 3.6% to 6.4%". The "±3%" printed under poll results is also half the width of a 95% interval. How many people a poll needs for that, and why it barely depends on the size of the country, is the subject of the election poll puzzle.

Compute your own interval

The overlap paradox

A common rule: "if the intervals of A and B overlap, there is no difference". It is wrong. Version A: 500 conversions out of 10,000. Move B's result. At the top are each version's intervals, at the bottom the interval of the difference B − A. Significance is decided by the bottom one: whether it covers zero.

Intervals of A and B–
Difference B − A, 95%–
p–

Why: the uncertainties of A and B add not as segments but as squares. The interval of the difference is only √2 ≈ 1.41 times wider than each one, not twice. So the intervals can overlap a little while the difference is already significant: here that is B from 563 to 588 conversions. If the intervals don't overlap at all, the difference is certainly significant. Nathaniel Schenker and Jane Gentleman pointed out this trap in a 2001 article in The American Statistician.

Deepergeneralisations, theory, history

“Deeper” is hidden on all puzzles.

Why the simple interval doesn't cover exactly 95%

The formula p̂ ± 1.96 · SE leans on the normal curve, while conversions are whole numbers. The exact calculation for 5% shows that the "95%" interval with 1,000 visitors covers the truth in 94.2% of samples, and with 100 visitors (only five expected conversions) in 87.7%. On top of that, coverage jumps like a saw: add a dozen visitors and it can shift by several points. Lawrence Brown, Tony Cai and Anirban DasGupta showed in Statistical Science in 2001 that this chaos is more persistent than textbooks claimed, and recommended the Wilson interval.

simple interval p̂ ± 1.96 · SEWilson intervalthe promised 95%

True conversion 5%, from 30 to 500 visitors. Each point is the exact sum of binomial probabilities of all outcomes whose intervals cover 5%.

Wilson: (p̂ + z²/2n ± z · √(p̂ (1 − p̂)/n + z²/4n²)) / (1 + z²/n)

Neyman and Kharkiv

The theory of confidence intervals was created by Jerzy Neyman. He was born in 1894 in Bendery and from 1912 studied at Kharkiv University, where Serhiy Bernstein taught him probability. Neyman published the main paper, "Outline of a Theory of Statistical Estimation Based on the Classical Theory of Probability", in 1937 in the Philosophical Transactions of the Royal Society. That is where the idea shown by the simulation above appeared: the probability is not about the unknown number but about the procedure that builds intervals again and again.

You can say "a 95% chance the truth is in this interval" in a different, Bayesian approach: there the unknown number has a distribution even before measuring, and a different, Bayesian kind of interval is computed with it. With plenty of data the two intervals usually almost coincide, so the everyday reading rarely does harm. The mistakes happen where data are scarce.

Where it shows up

Other terms