Power, false alarms, and twenty jelly beans. How testing many things, peeking early, or publishing only the hits turns noise into findings — and how to stop it
A significance test is honest only if you run one test, decided in advance, and report it whatever happens. Test twenty things, or keep trying analyses until one looks good, or publish only the wins, and “p < 0.05” stops meaning what it says. This lesson lets you break the machinery yourself.
Drag the sample size up and watch the two curves pull apart, then drag the rose line to trade false alarms against misses. Set a small effect and a small sample, and look at where the significant studies sit in the bottom panel.
Top: the sky curve is where the test statistic falls if there is no effect, the violet curve where it falls if the effect is d. Drag the rose line: rose is the false-alarm area α, violet the misses β, emerald the power. Middle: power against sample size for this d (emerald), with Cohen’s small, medium and large effects in grey; drag the teal marker to change n. Bottom: each bar counts simulated studies by their estimated effect; solid amber ones were significant, the dashed white line is the truth and the amber triangle is the average of the significant estimates. The test is a two-sided z test with the standard deviation known, so the curves are exact.
Jerzy Neyman and Egon Pearson set out the framework in 1933. A test can go wrong in two ways. A Type I error is a false alarm: declaring an effect when there is none. Its probability, α, is chosen by the researcher. A Type II error is a miss: failing to declare an effect that is real. Its probability is written β, and 1 − β is the power of the test. Power is not one number: it depends on how large the real effect is.
Four quantities are tied together: the effect size, the sample size, α and the power. Any three fix the fourth. In the demo the test statistic z has a normal distribution with standard deviation 1, centred at 0 if there is no effect and at d·√(n/2) if the true difference between the groups is d standard deviations with n people in each. For 80% power at α = 0.05 the centre must sit about 2.8 from zero, which gives n ≈ 2 × (2.8/d)²: about 63 per group for d = 0.5, and about 393 for d = 0.2. A t test, which has to estimate the standard deviation from the data, needs one more in each case: the familiar table values 64 and 394.
Jacob Cohen proposed the conventions d = 0.2, 0.5 and 0.8 for small, medium and large effects, and in a 1962 survey of a year of published research in one psychology journal he found that typical studies had about an even chance of detecting a medium-sized effect. This is why a non-significant result from a small study says little. A miss was a likely outcome whether or not the effect is real, so “not significant” is not evidence of “no effect”.
Low power also damages the results that do reach significance. To clear the bar, an estimate must be at least about twice its standard error, and in a small study that is larger than the true effect. So the significant estimates are the lucky overestimates. Andrew Gelman and John Carlin (2014) named the two consequences: a Type M (magnitude) error, the factor by which significant estimates exaggerate the truth, and a Type S (sign) error, a significant estimate pointing the wrong way. Both shrink towards harmlessness as power rises.
No bean does anything, yet press Run the study a few times and count how often one lights up. Then make some effects real, reveal them, and switch between the corrections to see which beans each one keeps.
Magenta jelly beans linked to louder yawns (p = 0.020)
| Over 1 studies | Studies with any false alarm | Average share of discoveries that are false | Real effects found | Studies with a headline |
|---|---|---|---|---|
| No correction | 100.0% | 100.0% | — | 100.0% |
| Bonferroni | 0.0% | 0.0% | — | 0.0% |
| Holm | 0.0% | 0.0% | — | 0.0% |
| Benjamini–Hochberg | 0.0% | 0.0% | — | 0.0% |
Each bean is one hypothesis, tested once, with its p-value underneath when there is room. Bright beans with a solid ring are declared discoveries; a dashed grey ring marks p < 0.05 that the chosen correction does not accept. Rings and points are amber until you reveal the truth, then emerald for a real effect found and rose for a false alarm, and a white dot marks every real effect. Bean colours are only labels. In the chart the rose line is the bar in use and the grey lines are the other three. The tests are independent two-sided z tests, and all the data are simulated.
The scenario comes from Randall Munroe’s xkcd comic “Significant” (no. 882, 2011): scientists test twenty colours of jelly bean for a link with acne, one colour gives p < 0.05, and that colour makes the front page. If every null hypothesis is true and the m tests are independent, the chance that at least one is significant at level α is 1 − (1 − α)m. For m = 20 and α = 0.05 that is 1 − 0.9520 ≈ 64%. This probability of any false alarm in the whole family of tests is the family-wise error rate.
The oldest remedy takes its name from Carlo Bonferroni’s inequality of 1936: the chance that any of m events happens is at most the sum of their chances. Holding each test to α/m therefore keeps the family-wise rate at or below α, with no assumption about how the tests depend on one another. Sture Holm’s step-down method (1979) gives the same guarantee and is never less powerful: compare the smallest p-value with α/m, the next with α/(m − 1), the next with α/(m − 2), and stop at the first that fails.
With thousands of tests, avoiding even one false alarm costs nearly all the power. Yoav Benjamini and Yosef Hochberg (1995) proposed a different target: the false discovery rate, the expected proportion of the announced discoveries that are false. Sort the p-values, find the largest rank k with p(k) ≤ k·q/m, and reject the k smallest. For independent tests this holds the false discovery rate at q times the share of hypotheses that are truly null. It is the working standard in genomics and other fields that test thousands of hypotheses at once.
The arithmetic does not care what the twenty things are. Twenty subgroups, twenty outcome measures or twenty time points within a single study behave like twenty jelly beans, though tests on the same people are usually correlated, which lowers the family-wise rate somewhat without making it 5%.
You have run a study of a treatment that does nothing, and it shows nothing. Pull the levers one at a time until Publish lights up, then see how 2,000 researchers fare with the same levers and what a publication filter does to 500 honest studies.
Everything here is simulated, and the treatment never does anything. Top: sky dots are the control group and orange dots the treatment group in the analysis with the smallest p-value so far; amber bars are the group means and rose crosses are values dropped as outliers. On the track below, the teal ring is the planned analysis, each amber dot another analysis the levers allow, and the rose zone is p < 0.05. Every test is Welch’s two-sample t test. Middle: each bar is the share of researchers whose best p-value fell below 0.05; the dashed sky line is the 5% the test promises. Bottom: each dot is one study; the dashed sky curves hold about 95% of honest studies of a zero effect, amber dots are significant and positive, and the amber line and band are the average of the studies shown with its 95% confidence interval.
Everything in this demo is simulated. Each study has two groups of 20, two outcome measures with correlation 0.5, a subgroup label unrelated to either, and a treatment with no effect at all. The four levers together open 36 analyses of the same data, and a researcher who reports the best of them finds p < 0.05 in roughly 43% of studies in this simulation, against the 5% that a single planned test delivers. No single lever does much more than double the rate; it is the combinations that multiply.
Joseph Simmons, Leif Nelson and Uri Simonsohn made this point in “False-Positive Psychology” (Psychological Science, 2011). They showed by simulation that a few common and individually defensible choices, which they called researcher degrees of freedom, can together raise the false-positive rate above 60%. Andrew Gelman and Eric Loken’s “garden of forking paths” adds that none of this needs conscious cheating. A researcher who runs only one analysis, but chooses it after seeing the data, has still walked one path out of many that were open.
Selection also operates between studies. If journals print mainly significant results, the published record of a non-existent effect is a set of confident overestimates that agree with each other, as the funnel plot shows. John Ioannidis argued in his 2005 essay “Why Most Published Research Findings Are False” that low power, flexible analysis and selective publication together could make false findings the majority in some fields. In 2015 the Open Science Collaboration repeated 100 published psychology studies: 97% of the originals had reported statistically significant results, and 36% of the replications did.
The remedies all remove the freedom to choose after looking. Pre-registration fixes the hypothesis, the sample size and the analysis in advance. Registered reports have journals accept a study on its design, before the results exist. Reporting every analysis that was run, replicating important findings, and judging evidence by estimates and their intervals instead of by which side of a threshold a p-value fell all help too.
Spot a mistake or have an idea?