Randomise, block, and decide the sample size before you look. The Salk vaccine trial, A/B tests, and why checking the results every day manufactures false wins
The most important statistical decisions are made before any data exist: who gets the treatment, who is compared with whom, and when you will stop. Get those right and the analysis is easy. Get them wrong and no analysis can rescue the result.
Half of these 48 plots get a fertiliser, and the land is better in some places than others in a way you cannot see. Paint your own layout or pick a systematic one, then turn the hidden gradient and compare 2,000 seasons of your layout with 2,000 seasons of randomising.
| Design, over 0 seasons | Average estimate | Bias | Standard deviation | Theory: bias, sd |
|---|---|---|---|---|
| Your layout, kept every season | — | — | — | +4.27, 0.29 |
| Completely randomised | — | — | — | 0.00, 0.76 |
| Randomised blocks (north–south strips) | — | — | — | 0.00, 0.31 |
Simulated field: every plot’s yield is 30 + its hidden fertility + the true effect if treated + noise that changes each season. Sky plots are controls and orange plots are treated; white outlines mark blocks. In the histograms each amber bar counts seasons by the estimate they produced, the dashed line is the true effect, and the amber ring is the season on the field. “Your layout” is planted identically every season; the two randomised designs draw a fresh layout each season. Bias is the average estimate minus the truth. The theory column uses the fertility map, which only the demo can see.
R. A. Fisher joined Rothamsted Experimental Station in 1919 and worked out there the principles that experiments in every science now follow. He set them out in Statistical Methods for Research Workers (1925) and The Design of Experiments (1935). There are three. Replication: each treatment goes on many plots, so that the variation between plots treated alike can be measured. Randomisation: chance, not the experimenter, decides which plots get which treatment. Blocking, which Fisher called local control: plots are grouped into blocks of similar land, and the treatments are compared within each block.
A fixed layout has a fixed imbalance. If its treated plots sit on land that is better by b, the estimate is the true effect plus b in every season, and more seasons only make the wrong answer more precise. Randomising does not remove the difference in fertility in any one season. It makes the difference equally likely to favour either treatment, so that over repetitions it averages to zero and shows up as spread instead of bias. With half of N plots treated at random, the fertility pattern contributes a variance of 4S²/N to the estimate, where S² is the variance of fertility across the field. Blocking replaces S² with the variance within blocks. When the blocks lie across the gradient, so that each is nearly uniform, most of S² disappears; when they lie along it, nothing is gained. The usual summary is “block what you can, randomise what you cannot”, a maxim usually attributed to George Box.
Randomisation does a second job: it justifies the analysis. Because the labels were assigned by chance, we know exactly how the estimate would behave if the treatment did nothing, by re-assigning the labels in every way the randomisation could have. That is the permutation test of the Hypothesis Tests lesson, and it is valid because the labels were assigned by chance. A systematic layout offers no such guarantee. The checkerboard in this demo is balanced against any straight gradient and does well on these fields, but it would fail against a pattern that alternates the way it does, and nobody can list in advance every pattern a field might hide. Randomisation is insurance against the ones nobody thought of.
The 1954 trial of the Salk vaccine ran as two designs at once. Find the puzzle in the published rates, then slide the risk in consenting families up and down and watch one design’s estimate drift while the other stays on the truth.
The top chart shows the published 1954 rates, rounded as in Freedman, Pisani and Purves. Everything below it is a simulation built to show the direction of the bias, not a reconstruction of 1954. Orange bars are vaccinated children, sky bars the comparison group, grey bars children without consent; each bar is one simulated trial and the dashed tick is its long-run rate. In the lower chart the dashed line is the true efficacy, the amber curve the long-run estimate of the randomised design, the violet curve that of the observed-control design, and the dots are the simulated trial shown above. The diagnostic shift is applied only to the randomised trial; the observed-control design had no placebo and could not be blind in any case.
The 1954 field trial of Jonas Salk’s polio vaccine was the largest public health experiment of its time, involving well over a million children. The National Foundation for Infantile Paralysis first proposed to vaccinate second-graders whose parents consented and to use all first- and third-graders as controls. Some areas ran the trial that way. Others used a randomised design: among children whose parents consented, chance decided who received the vaccine and who received a placebo, and neither the families nor the doctors diagnosing cases knew which. On 12 April 1955 Thomas Francis Jr., who directed the evaluation, announced that the vaccine was safe and effective.
Two kinds of number appear in the demo’s top chart. The counts for the two randomised arms are exact: 57 cases among 200,745 vaccinated children and 142 among 201,229 given the placebo, which are rates of 28 and 71 per 100,000. The other group sizes and rates are the rounded figures tabulated from the Francis report in Freedman, Pisani and Purves’s textbook Statistics.
The explanation usually given for the puzzle is that better-off families consented more often, and their children were more vulnerable to paralytic polio: growing up in more hygienic surroundings, they tended to meet the virus later, without the protection that an early infection gives. So the observed-control comparison set a higher-risk vaccinated group against lower-risk controls and understated the benefit. In the model, if consenters’ children have r times the risk of the rest and a share c of parents consent, a vaccine of true efficacy e appears to have efficacy 1 − r(1 − e)/(cr + 1 − c). That equals e only when r = 1. The model is a simulation built to reproduce the direction of the bias; it is not a reconstruction of 1954.
The general points outlast the vaccine. Controls must be like the treated group in everything but the treatment, and the only reliable way to arrange that is to form both groups from the same people by chance. Volunteers differ from non-volunteers, often in ways that matter for the outcome. A placebo keeps the two groups’ experience the same, and blinding keeps expectations from shaping the measurement: polio was hard to diagnose in mild cases, and a doctor who knows a child was vaccinated may read a borderline case differently.
This A/B test compares two identical versions. Press Run one experiment and stop the first time z crosses the line, then raise the number of looks and watch the false wins multiply. Switch stopping rules to repair it, and finally give B a real advantage.
| Rule, with 10 looks | Critical |z| | False positives (no difference) | Power at a difference of 0.00 | Average visitors per arm |
|---|---|---|---|---|
| Fixed horizon: look once, at the end | 1.96, once | 5.0% | — | 1,000 |
| Stop the first time |z| > 1.96 | 1.96 at every look | 19.3% | — | 881 |
| Pocock boundary | 2.56 at every look | 5.0% | — | 971 |
| O’Brien–Fleming boundary | 6.60 falling to 2.09 | 5.0% | — | 991 |
Simulated experiments: each visitor’s outcome is a score with standard deviation 1, and z compares the two arms’ averages so far. The teal path is the experiment being watched; faint grey paths are other experiments that ran to the end, and rose paths stopped where their dot is. Dashed sky lines are ±1.96, rose lines and dots are the stopping boundary at each look, and thin vertical lines are the looks. The end marker is emerald for a correct decision and rose for a wrong one. In the bar chart, rose bars are the exact false-positive rate of stopping at the first |z| > 1.96, emerald dots the rate with a Pocock boundary, and the amber line your own run. The table’s figures are exact, by numerical integration, unless marked as simulated.
A significance test at the 5% level promises a 5% false-positive rate for one test at a sample size fixed in advance. Testing again and again as the data accumulate, and stopping at the first significant result, breaks the promise. Armitage, McPherson and Rowe computed by how much in 1969: for normal data and two-sided 5% tests, the chance of at least one “significant” result is 8.3% with two equally spaced looks, 14.2% with five, 19.3% with ten, 24.8% with twenty and 32.0% with fifty. The looks are not independent, since each uses all the earlier data, which is why ten looks give 19% and not 1 − 0.9510 = 40%.
There is no ceiling. The law of the iterated logarithm says that the running z statistic of a true null hypothesis will, with probability 1, eventually exceed any fixed threshold if you wait long enough. An experimenter who can keep collecting until the result is significant is certain to get there.
The remedy is to choose the looks and the thresholds before starting, so that the chance of crossing at any of them adds up to 5%. Stuart Pocock (1977) used the same critical value at every look: 2.413 for five looks. Peter O’Brien and Thomas Fleming (1979) made the early thresholds very strict and the last one close to the usual value: for five looks, 4.562/√k at look k, which is 4.56 at the first and 2.04 at the last. Gordon Lan and David DeMets (1983) introduced alpha-spending functions, which allow the number and timing of looks to change as the trial goes on. These group-sequential designs are standard in clinical trials, where an independent data monitoring committee reviews interim results because it would be unethical to continue a trial whose answer is already clear.
A sequential design trades a little power, or a slightly larger maximum sample, for the chance to stop early when the effect is large, and on average it needs fewer participants than a fixed design of the same power. The same problem is endemic in online A/B testing, where dashboards update continuously and it is tempting to stop the moment a result turns significant. What makes early stopping honest is that the stopping rule was fixed in advance.
Spot a mistake or have an idea?