Math paradoxes

Glossary / p-value

Glossary · p-value

The pages are identical. Which p comes up most often?

You show the same page to two halves of your visitors and compute p, a number from 0 to 1 that every A/B testing tool reports. It seems that with no difference, p should be close to 1. In fact every value is equally likely: p below 0.05 turns up as often as p between 0.50 and 0.55. That is why even between identical pages about one test in twenty looks "significant".

In plain wordspictures, analogies, small numbers

“In plain words” is hidden on all puzzles.

The flat p paradox

Each test here is two versions of a landing page with 10,000 visitors each and a 5% base conversion rate. The computer computes p the way ordinary tools do (a two-proportion z-test) and drops it into one of 20 bars. Start with identical pages, then give version B a real advantage.

p < 0.05: the tool says "significant"the other testsexact calculation

Tests run0
p < 0.05–
p from 0.50 to 0.55–

What p means in plain words

This is a simplified explanation, but it holds the whole idea. p answers one question: if the pages were identical, how often would chance alone produce a gap at least as big as the one you see? p = 0.03 means "three times in a hundred". The smaller p is, the stranger your result would be in a world with no difference. The 0.05 line, "one time in twenty", is just a convention.

That is where the flat histogram comes from. In a world with no difference your test is just one more random draw from the very draws it is compared against. So it is equally likely to land among the 5% strangest, the 5% most ordinary, or anywhere in between.

What p is not

  • Not the probability that there is no differencep is computed by assuming there is no difference. It cannot also judge whether that assumption is true. p = 0.03 does not mean "a 3% chance the pages are the same".
  • "97% confidence" is not the chance B is betterDashboards often show 1 − p as "confidence". On identical pages "confidence" above 95% comes out in one test in twenty, above 90% in one in ten.
  • Not the size of the effectA tiny difference on millions of visitors gives a tiny p. A big improvement on a hundred visitors can give p = 0.4. p says how far a result stands out from the noise, not how much it is worth.
  • p > 0.05 doesn't prove there is no effectChoose "B truly 10% better" above. With 10,000 visitors per version, p comes out above 0.05 in about two tests out of three, though the improvement is real. The test is simply too small to notice it.
  • Honest only for one lookThe flat histogram holds if the test size was chosen in advance and p was looked at once. Checking every day or going through many segments means many tries, and the chance of a false "win" grows.
Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

Where p comes from

Version A: 500 conversions out of 10,000 visitors, 5.0%. Move how many conversions B collected. The bell shows how the difference B − A would scatter if the pages were identical. The shaded area of the tails, where the gap is at least as large as yours (in either direction), is p.

B's lift over A–
z: the gap in standard errors–
p–

p̄ = (kA + kB) / 2n  ·  SE = √(p̄ (1 − p̄) · 2 / n)  ·  z = (kB − kA) / n / SE  ·  p = 2 · (1 − Φ(|z|))

SE is the standard error of the difference: how far B − A usually wanders by chance alone. Φ is the area under the normal curve to the left of z. At |z| = 1.96 you get exactly p = 0.05.

p < 0.05 doesn't mean "5% of wins are false"

The 0.05 line promises something else: of the ideas that really do nothing, 5% will slip through the filter. What share of all "winners" is false depends on how many ideas really work and how often the test spots a real effect (its power). Here are 1,000 ideas a team checked with A/B tests.

works, the test spotted itworks, the test missed itdoesn't work, yet p < 0.05doesn't work, the test stays quiet

"Winners"–
Of them false–
Share false–

This is the same logic as in the false positive puzzle: an accurate filter applied to a rare event gives many false alarms. The rarer real improvements are, the more "winners" are noise.

Deepergeneralisations, theory, history

“Deeper” is hidden on all puzzles.

Why the histogram is flat, and why the last bar is lower

p is the share of possible results of the "no difference world" that are stranger than yours. So p ≤ 0.2 exactly when your result landed among the strangest 20%. If there really is no difference, your result is drawn from that same distribution, so it lands in those 20% with probability exactly 0.2. The same for any threshold t: P(p ≤ t) = t. That is the uniform distribution from 0 to 1. In the same way, your height as a percentile of a random crowd is equally likely to be any percentile.

The exact calculation for identical pages gives 4.99% of tests with p < 0.05 and 4.8–5.3% in each of the following bars. The last one, from 0.95 to 1, gets only 3.9%: conversions are whole numbers, and p above 0.95 only happens when the counts of A and B are equal or differ by one. Flatness is a property of the continuous model; on whole numbers it is almost exact.

When there is an effect, the distribution of p squeezes toward zero: with 10,000 visitors and a real +10%, p < 0.05 comes out in 35.4% of tests, with +20% in 87.4%. That share is called the power of the test.

Where p and the 0.05 line came from

The first known calculation of this kind was made by the Scottish physician John Arbuthnot in 1710. He went through London christening records for 82 years and saw that every year more boys than girls were christened. If the chances were equal, this would happen with probability (½)82, about 2 · 10−25. Arbuthnot concluded it was not chance.

The 0.05 line comes from Ronald Fisher, in his 1925 book "Statistical Methods for Research Workers". Fisher noted that p = 0.05 corresponds to a deviation of about 1.96, nearly two standard deviations, and that it is "convenient to take this point as a limit" in judging whether a deviation is significant. A convenient limit later hardened into a rule.

In March 2016 the American Statistical Association, for the first time on behalf of the whole community of statisticians, issued a statement on p-values (Ronald Wasserstein and Nicole Lazar, The American Statistician). Its six principles in our own words:

  1. p shows how incompatible the data are with a given model, such as "no difference".
  2. p is not the probability that the hypothesis is true, or that the data came from chance alone.
  3. Conclusions and business decisions should not rest only on whether p crossed a threshold.
  4. Honest inference needs full reporting: how many checks were made, and which.
  5. p measures neither the size of an effect nor its importance.
  6. By itself, p is a weak measure of evidence.

Where it shows up

Other terms