Evidence by Numbers
the philosophy of statistics
When the numbers come in, how much do they tell us, and is a significant result real?
In 2015 the Open Science Collaboration repeated a hundred psychology studies: ninety-seven originals had been significant, thirty-six replications were. To ask whether the method, its use or its reading is at fault, the part first says what the numbers mean. Fisher, Neyman and Pearson, and Jeffreys give three verdicts on one coin with 60 heads in 100. A p-value is defined and six misreadings are refuted by simulation; base rates, Ioannidis's positive predictive value, the garden of forking paths and optional stopping show how noise becomes discovery. Then the part turns to principle. Two experimenters with the same nine heads and three tails get p = 0.073 and p = 0.033, and Birnbaum's theorem shows that sufficiency and conditionality together force the likelihood principle, under which the sampling plan cannot matter: the Wall's sixteenth brick. Lindley's paradox, Mayo's severity, Simpson's paradox at Berkeley and the reference class problem mark how far apart the schools land. It ends in practice and at the frontier: A/B tests ruined by peeking, testing by betting with Ville's inequality, and AIC against BIC.
What you need. Bayes' rule and credences as in Part 13; the normal curve and a sample mean from a first statistics course help but are shown.
- The calculation
- likelihoods, p-values, e-values
- The wall
- Birnbaum; Lindley
- Built toy
- p-hacking garden; testing by betting
What you will be able to do
Introductory
- State what a p-value is, and refute by a simulation or a count the reading 'the probability that the null hypothesis is true'.
- Compute the chance that a positive result is a true one from the base rate, the power and the false positive rate, in natural frequencies.
- Exhibit Simpson's reversal in a two-by-two-by-two table and say which comparison answers which question.
Advanced
- Simulate optional stopping and show the false rejection rate rising with the number of looks.
- Compute a Bayes factor for a point null against a normal alternative and reproduce Lindley's paradox at fixed z as n grows.
- Draw a severity curve for a significant and a non-significant result and name the fallacy each one blocks.
Research
- Prove Birnbaum's theorem on the mixture experiment, and locate the step that Durbin, Kalbfleisch and Mayo each reject.
- Prove Ville's inequality for a nonnegative martingale and derive the Kelly stake that maximizes an e-process's growth rate.
Applied
- Run an A/B test with a rule that stays valid under peeking, and say what a fixed-horizon p-value means after ten looks.
- Report a result with its design: the stopping rule, the number of analyses tried, and an interval, and say which of these a p-value alone hides.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Introductory 24 min · Advanced 43 min · Research 51 min · Applied 27 min.
- 0Is the result real?Introductory2 min
- 1Three schoolsIntroductory5 min
- 2What a p-value isIntroductory5 min
- 3Base ratesIntroductory4 min
- 4The garden of forking pathsIntroductory4 min
- 5Optional stoppingAdvanced3 min
- 6The likelihood principleResearch4 min
- 7Lindley's paradoxAdvanced4 min
- 8Severe testingAdvanced3 min
- 9Simpson's paradoxIntroductory3 min
- 10The reference classAdvanced2 min
- 11Tests in industryApplied3 min
- 12Testing by bettingResearch4 min
- 13Choosing a modelAdvanced3 min
- Recap, problems, and where this comes backAll tracks2 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.
Is the result real?Introductory2 min
Part 15 asked whether experience can justify any expectation at all. This part asks a narrower, practical question: when numbers come in, how much do they tell us? Ronald Fisher put the twentieth century's answer in one sentence: every experiment exists only to give the facts a chance of disproving the null hypothesis. A century later, that machinery is in crisis.
In 2015 the Open Science Collaboration repeated a hundred studies from three leading psychology journals. Ninety-seven of the originals had reported a significant result. Thirty-six of the replications did. The average effect size halved. Four years earlier, Daryl Bem had published nine experiments in a top journal, eight of them significant, apparently showing that people can feel the future. In medicine, a team at Amgen could confirm only six of fifty-three landmark cancer studies. Is the method broken, or its use, or our reading of what it says? To answer, we need to know what the numbers mean. That is the philosophy of statistics.
The plan. Three schools of statistics, giving three different verdicts on the same coin. What a p-value is, and six things it is not, each refuted by simulation. Base rates, why most published findings may be false, and a machine that turns noise into discoveries. Optional stopping, and the likelihood principle, with Birnbaum's theorem: this part's brick in the Wall. Lindley's paradox, severe testing, Simpson's paradox and the reference class. Tests in industry, and the newest idea in the field: testing by betting. And choosing a model for prediction.
What it establishes: Fisher (1935); the replication crisis; the plan.
1Three schoolsIntroductory5 min
Ronald Fisher's founding example. A lady claims she can tell whether the milk or the tea was poured first. Fisher gives her eight cups, four of each, in random order, and she must pick the four with milk first. If she is merely guessing, the chance that she picks all four correctly is one in seventy, about point zero one four. That number is the p-value: the probability, if the null hypothesis is true, of a result at least as extreme as the one observed. When it is small, Fisher said, either an exceptionally rare chance has occurred, or the theory is not true. It measures evidence against a single hypothesis, and it needs no alternative.
Jerzy Neyman and Egon Pearson rebuilt testing around decisions. There are two hypotheses, the null and an alternative, and a rule that rejects the null when the data fall beyond a cutoff. Two errors are possible. Rejecting a true null happens with probability alpha, fixed in advance at five percent. Keeping a false null happens with probability beta; one minus beta is the power. Their lemma of 1933 says which rule is best: reject when the likelihood ratio of the alternative to the null exceeds a constant. The guarantee is about the rule, in the long run: not about how strong the evidence is in this particular case.
The third school is older and newer at once. Harold Jeffreys, in his Theory of Probability of 1939, made Bayes's theorem a method for testing. The posterior odds of the null against the alternative equal the prior odds times the Bayes factor: the ratio of how well each hypothesis predicted the data. For a composite alternative, its prediction is an average over a prior on its parameter. Jeffreys gave a scale for reading Bayes factors: three is substantial, ten strong, a hundred decisive. Two differences from Fisher stand out. Data can be evidence for the null, not just fail to be evidence against it. And the alternative has to be spelled out.
Fisher also wanted what the Bayesians had, a probability for the parameter itself, without a prior. He started from a statement about the data: the sample mean exceeds the true mean by more than one point six four five standard errors only five percent of the time. Then, once the mean is observed, he read the statement the other way round, as a probability distribution for the unknown mean. He called it fiducial probability. Neyman took the same numbers and read them as a confidence statement about the procedure, not about the parameter. For problems with several parameters, Fisher's argument gave inconsistent answers, and Bradley Efron called it Fisher's biggest blunder. It has recently been revived, in confidence distributions and generalized fiducial inference.
Give the three schools the same data: sixty heads in a hundred tosses. Is the coin fair? Fisher's p-value is point zero five seven. Not quite significant; some evidence against fairness. Neyman and Pearson fix the rule in advance: reject if heads are at most thirty-nine or at least sixty-one. Sixty falls short, so the null is not rejected, and the test had less than even power against a coin biased to point six. Jeffreys, with a uniform prior on the bias, finds a Bayes factor of one point one in favour of the fair coin: the data very slightly support fairness. Evidence against, no decision, evidence for: the same numbers, three readings.
The founders fought bitterly. Fisher wrote in 1955 that Neyman and Pearson's tests were acceptance procedures, fit for quality control in a factory, not for reasoning in science. Neyman replied that there is no such thing as inductive inference, only inductive behaviour: following rules whose error rates are known. What reached the textbooks was a hybrid: Fisher's p-value, compared with Neyman's fixed five percent, and then read as if it were the Bayesian probability that the null is true. Gerd Gigerenzer called it the null ritual, a procedure neither founder would have recognized. Much of the replication crisis begins here.
What it establishes: Fisher (1925, 1935), Neyman and Pearson (1933), Jeffreys (1939); fiducial probability; the feud; the null ritual.; Computed on screen: the lady tasting tea (1/70); α and β; three verdicts on 60 heads in 100
2What a p-value isIntroductory5 min
The p-value is the probability, computed as if the null hypothesis were true, of a test statistic at least as extreme as the one observed. Simulate a hundred thousand studies in which the null is true. Their p-values are spread evenly between zero and one: under the null, p is uniform, and five percent of studies fall below point zero five by construction. Now simulate studies with a real effect of half a standard deviation and twenty subjects. The p-values pile up near zero; sixty-one percent fall below point zero five. That share is the test's power. A single p-value is one draw from one of these distributions. Almost every misreading of p comes from forgetting which.
Six common misreadings, and a simulation that refutes each. First: that p is the probability that the null hypothesis is true. Take all simulated studies whose p-value landed between point zero four and point zero five. If half of all tested nulls are true, about a fifth of these studies have a true null; if ninety percent of nulls are true, seventy percent of them do. The probability of the null depends on what else is being tested, and p does not see it. Second: that p above point zero five means there is no effect. With a real but small effect and twenty subjects, eighty-five percent of studies give p above point zero five. Absence of evidence is not evidence of absence. Third: that a smaller p means a bigger effect. A tiny effect in a sample of a hundred thousand gives a p-value of ten to the minus ten; a large effect in a sample of ten gives one percent.
Fourth: that p equal to point zero five means a five percent chance that the result is a false positive. The share of false positives among significant results depends on how many of the tested hypotheses are true and on the power, and it is often far above five percent. The next chapter computes it. Fifth: that p is the probability that the result is due to chance. But p is computed by assuming that chance alone is at work; it cannot also be the probability of that assumption. Sixth: that one study with p of point zero three and another with point zero seven disagree. Their estimates are point two two and point one eight, each with a standard error of point one. A test of their difference gives p of point eight. As Andrew Gelman and Hal Stern put it, the difference between significant and not significant is not itself statistically significant.
Confidence intervals, Neyman's invention of 1937, are often offered as the cure for p-values. But they have their own misreading. Draw a hundred samples of twenty, and compute each sample's ninety-five percent interval. Ninety-five of the hundred cover the true mean; five, in red, miss it. In the long run the procedure succeeds ninety-five percent of the time. But it is a misreading to say that a particular interval, once computed, contains the mean with probability ninety-five percent. It either does or it does not; Richard Morey and his colleagues call this the fundamental confidence fallacy. The ninety-five percent belongs to the procedure. The statement people want to make is a Bayesian one, about a credible interval, and it needs a prior.
In 2016 the American Statistical Association issued its first statement on a matter of statistical practice. P-values can indicate how incompatible the data are with a specified model. They do not measure the probability that a hypothesis is true. Conclusions should not rest only on whether p crosses a threshold. Proper inference requires full reporting. A p-value does not measure the size or importance of an effect. And by itself a p-value is not a good measure of evidence. Three years later its editors urged a world beyond p less than point zero five; others proposed instead a stricter threshold, point zero zero five.
What it establishes: the definition; six misreadings; confidence intervals (Neyman 1937; Morey et al. 2016); the ASA statement (2016).; Computed on screen: p under null and alternative; each misreading simulated; 95 of 100 intervals
3Base ratesIntroductory4 min
Before asking what significance means for science, consider a medical test. A disease affects one percent of people. The test catches ninety percent of cases, and gives a false alarm for nine percent of healthy people. Picture a thousand people. Ten have the disease, and nine of them test positive. Nine hundred and ninety do not, but eighty-nine of them test positive anyway. So of the ninety-eight positives, only nine are sick: about nine percent. When Gerd Gigerenzer put this question to a hundred and sixty gynaecologists in 2007, most answered around ninety percent. Stated as natural frequencies, as here, the answer becomes easy. Stated as conditional probabilities, it defeats experts.
Base rates decide lives as well as diagnoses. In 1999 Sally Clark was convicted in England of murdering her two baby sons. An expert witness told the jury that the chance of two cot deaths in such a family was one in eight thousand five hundred, squared: one in seventy-three million. The first error was squaring: it assumes the two deaths are independent, when genes and household are shared. The second error was worse. The number was the probability of the evidence if she were innocent, and it was heard as the probability that she was innocent, given the evidence. That is the prosecutor's fallacy, the base-rate fallacy in a courtroom. The relevant comparison is with the alternative explanation, double murder of infants, which is rarer still. The mathematician Ray Hill estimated that the odds favoured natural causes. The Royal Statistical Society protested, and Sally Clark was freed on appeal in 2003.
An older case shows the same mistake with an extra twist. In 1964 a woman was robbed in Los Angeles, and witnesses described a couple fleeing in a partly yellow car. At trial, a mathematics instructor multiplied six frequencies: a man with a moustache, a woman with a ponytail, blond hair, a beard, and so on. The product was one in twelve million, and the jury convicted. The traits were not independent, and the numbers were guesses. But grant them. In 1968 California's Supreme Court asked the right question: given that one couple in the area fits, how likely is it that another does too? With twelve million couples in the area, the Reasoner computes it exactly: forty-two percent. One in twelve million was never the probability of innocence. The court reversed the conviction, and attached a mathematical appendix.
John Ioannidis saw that science itself is a screening test. Of all the hypotheses a field tests, some fraction are true: call the odds R. A significant result is a positive. The share of positives that are true is the positive predictive value: power times R, over power times R plus alpha. Plot it against the prior odds. With high power and even odds, most significant results are true. With low power, or long odds, most are false. Ioannidis's own examples, recomputed with his allowance for bias: a well-powered trial, point eight five. A meta-analysis of small studies, point four one. An underpowered early trial, point two three. Underpowered epidemiology, point one two. And discovery research testing thousands of hypotheses, one in a thousand. Hence the title of his paper: why most published research findings are false.
Ioannidis drew corollaries from the formula. A claimed finding is less likely to be true when the studies are smaller, and the effects smaller; when more relationships are tested, with less pre-selection; when designs, definitions and analyses are more flexible; when there are financial interests, or many teams racing in a hot field. And all of it is made worse when only significant results are published, and the rest go into what Robert Rosenthal called the file drawer.
What it establishes: natural frequencies (Gigerenzer and Hoffrage 1995); Sally Clark; People v. Collins (1968); Ioannidis (2005).; Computed on screen: a 1,000-person grid: PPV 9%; a second matching couple (42%); Ioannidis's table and PPV curves
4The garden of forking pathsIntroductory4 min
Andrew Gelman and Eric Loken gave the problem its name: the garden of forking paths. Here is one experiment in which nothing is going on: two conditions, twenty subjects each, pure noise. A researcher makes reasonable choices. Which outcome to analyse: the first measure, the second, or their average. Whether to stop at twenty per group or collect ten more. Whether to analyse everyone, men only, women only, or control for gender. Whether to drop an outlier. Forty-eight paths. The planned analysis gives p of point eight seven. But four of the forty-eight paths give p below point zero five, the best of them point zero one. No one needs to cheat. Each path, taken alone, has a five percent error rate. The trouble is that the path is chosen after seeing the data.
The Reasoner turns this into a machine. Four thousand studies of pure noise. With no freedom at all, about five percent reach significance, as they should. Allow a choice between two correlated outcomes and their average: nearly ten percent. Add ten more subjects when the first look fails: eight percent. Use gender, by subgroup or as a control: eleven percent. Drop an outlier: seven. Allow all four, and more than a third of studies of nothing find something. Joseph Simmons, Leif Nelson and Uri Simonsohn ran this experiment in 2011, and to make the point they also showed, with real data and honest-looking statistics, that listening to a Beatles song makes people younger.
There is a second reason replications find smaller effects, even without any p-hacking. Take a real but small effect, a fifth of a standard deviation, and keep only the studies that reach significance. With twenty subjects per group, the power is ten percent, and the studies that do reach significance overestimate the effect nearly four times over. Four percent of them even get its sign wrong. With fifty per group, the exaggeration is two and a half. Only with four hundred per group, and power of eighty percent, do significant results report roughly the truth. Andrew Gelman and John Carlin call these type M and type S errors. Low power plus a significance filter means that honest replications must find smaller effects.
The garden is not hypothetical. In psychology, thirty-six of ninety-seven significant results replicated, with effects about half as large. Of twenty-one social science experiments published in Nature and Science, thirteen replicated. In laboratory economics, eleven of eighteen. In cancer biology, replicated effects were on average eighty-five percent smaller than the originals. And a striking twist: when researchers bet in prediction markets on which studies would replicate, the markets were largely right. Scientists could tell, collectively, which results were fragile.
The remedies are now standard. Preregistration: fix the analysis before seeing the data, or better, have the journal accept the study before the results exist. Correction for multiple tests, by Bonferroni's method or by controlling the false discovery rate. Power: larger samples mean fewer missed effects and a higher share of true positives. Openness: share data and code, and report the whole multiverse of reasonable analyses. Notice what every remedy assumes: that the evidence in the data depends on what would have been done had the data been different. A Bayesian or a likelihoodist denies exactly that. Chapter six explains why, and what it costs.
What it establishes: forking paths (Gelman and Loken); Simmons, Nelson and Simonsohn (2011); Gelman and Carlin (2014); the replication record; remedies.; Computed on screen: 48 analyses of one noise data set; the p-hacking simulator; type M and S errors
5Optional stoppingAdvanced3 min
Suppose an experimenter tests after every ten observations, and stops as soon as p drops below point zero five. And suppose the null hypothesis is true: there is no effect at all. Here is one run. The p-value wanders up and down as data accumulate. Sooner or later it dips below point zero five, and the experimenter stops, and reports a significant result. Every individual test was done correctly.
Run it two thousand times under the null. With one look, five percent of runs reject, as promised. With ten looks, about nineteen percent. With a hundred looks, thirty-five percent. With unlimited patience, the experimenter is certain to reach significance eventually: the law of the iterated logarithm guarantees that a random walk crosses any fixed significance boundary. Peter Armitage and his colleagues computed these numbers in 1969. A test's error rate is a property of the whole plan, including the plan for stopping.
Now look at the same data through the likelihood. For a normal mean, the likelihood depends on the data only through their sum and their number. It is the same function of mu whether the sample size was fixed in advance or chosen by peeking. Ward Edwards, Harold Lindman and Leonard Savage drew the conclusion in 1963: the rules governing when data collection stops are irrelevant to data interpretation. And the likelihood ratio has a guarantee of its own. Under the null, the chance that it ever reaches k, at any sample size, is at most one over k. A stopper that waits for a likelihood ratio of ten errs in five percent of runs, never more than ten, however long it is allowed to look.
So whose evidence is it? The frequentist says that two experimenters with the same data but different stopping plans have tests with different error rates, and so different evidence. The critic replies that evidence would then depend on intentions locked in the experimenter's head, which no reader can see. Deborah Mayo answers that intentions fix which other results would have counted as significant, and that is exactly what makes a test severe or not. And Peter Armitage pointed out that a Bayesian with a flat prior who peeks can be sure to see a credible interval that excludes zero, even when the null is true. Chapter twelve offers a way out: tests by betting, which stay valid whatever the stopping rule.
What it establishes: optional stopping (Armitage et al. 1969); the stopping rule principle (Edwards, Lindman and Savage 1963); the debate.; Computed on screen: a p-value path; rejection rate by number of looks; a likelihood-ratio stopper
6The likelihood principleResearch4 min
Richard Royall separated three questions that statistics runs together. What should I believe? That needs prior probabilities: Bayes. What should I do? That needs decisions with controlled error rates: Neyman and Pearson. And what do the data say? For that, Royall argued, only the likelihood matters. Ian Hacking's law of likelihood: evidence favours one hypothesis over another if it was more probable under the first, and the ratio measures how strongly. The likelihood principle goes further: all the evidence that an outcome provides about a parameter is contained in its likelihood function, up to a constant factor. What else might have happened does not matter.
Here is the classic illustration, due to Dennis Lindley and Lawrence Phillips. Ann planned to toss a coin twelve times, and got nine heads. Bo planned to toss until the third tail, which came on the twelfth toss: also nine heads and three tails. Their likelihood functions are identical in shape: both proportional to theta to the ninth times one minus theta cubed. The likelihood ratio of a biased coin, point seven five, against a fair one is four point eight for both. But their p-values for the fair coin differ. For Ann, the chance of nine or more heads in twelve is point zero seven three: not significant. For Bo, the chance of needing twelve or more tosses is point zero three three: significant. Same data, same likelihood, different verdicts, because the experiments they did not do differ.
In 1962 Allan Birnbaum proved that the likelihood principle follows from two principles almost every statistician accepts. Imagine a mixed experiment: flip a fair coin, and do Ann's experiment on heads, Bo's on tails. Within this mixture, Ann's outcome and Bo's outcome have proportional likelihoods, so a statistic that merges them is sufficient. The principle of sufficiency says the two outcomes of the mixture carry the same evidence. The principle of conditionality says that once you know which experiment the coin chose, the evidence is just the evidence of that experiment; the coin flip tells you nothing about theta. Chain the equalities: Ann's outcome and Bo's carry the same evidence. That is the likelihood principle. Accept sufficiency and conditionality, and p-values, which differ between Ann and Bo, cannot measure evidence.
Birnbaum's theorem is a Price List. Sufficiency; conditionality; and the conviction that the sampling plan matters, that Ann's data and Bo's are different evidence. Together they are inconsistent, and giving up any one restores consistency. Leonard Savage, Richard Royall, and James Berger and Robert Wolpert give up the third. They accept the likelihood principle, and with it the conclusion that p-values are not evidence. Savage called Birnbaum's paper a really historic occasion. James Durbin restricted conditionality, so that the mixture's coin flip no longer qualifies. John Kalbfleisch restricted sufficiency instead. And Deborah Mayo argued in 2014 that the proof itself equivocates, using the principles in two different senses, so that no price is owed at all. The debate is still open.
This is the sixteenth brick in the Wall. The dream: one account of statistical evidence that controls long-run error rates and also tells us what this particular data set means. The wall: Birnbaum's theorem. Respect sufficiency and conditionality, and the evidential meaning of data is fixed by the likelihood alone, which ignores error rates. What it forces: choose your principle. Keep error control and give up a principle that seems obvious, or keep the principles and give up error rates as evidence. Lindley's paradox, in the next chapter, shows how far apart the two sides can land.
What it establishes: Royall's three questions; the law of likelihood (Hacking 1965); Birnbaum's theorem (1962); Price List; the Wall's sixteenth brick.; Computed on screen: binomial and negative binomial likelihoods and p-values
7Lindley's paradoxAdvanced4 min
Dennis Lindley's paradox of 1957, anticipated by Jeffreys, shows how far the schools can disagree. Suppose every study reports the same test statistic, z equals two: p of point zero four five, significant at five percent. The alternative says the mean is drawn from a standard normal prior, and the two hypotheses start at even odds. With ten observations, the Bayes factor mildly favours the alternative. With a thousand, it favours the null by four to one. With a million, by more than a hundred to one, and the posterior probability of the null is ninety-nine percent. The p-value never changed. The evidence, by Bayes's lights, swung from against the null to overwhelmingly for it.
Why does this happen? Compare how well each hypothesis predicted the data. With a thousand observations, z of two means the observed mean is tiny: point zero six. The null predicted means close to zero, so it gave this one a reasonable probability density. The alternative spread its predictions over effects of every size, large and small, so it gave this particular small effect very little; here it is drawn thirty times taller just to be visible. The ratio is the Bayes factor: about four to one for the null. The p-value asks only whether the data are surprising under the null. The Bayes factor asks whether they are more surprising under the alternative. With large samples, a fixed p threshold lets ever smaller effects count as discoveries.
But the Bayes factor depends on the prior for the effect under the alternative. Keep z equal to two with a hundred observations, and vary the prior's width tau. A very narrow prior barely differs from the null, and the Bayes factor is near one. Moderate widths favour the alternative, but never by more than about two to one. Wide priors favour the null, up to sixty-eight to one. And no prior whatever, not even a point mass placed exactly at the observed effect, can favour the alternative by more than e to the z squared over two: seven point four to one. Ward Edwards, Harold Lindman and Leonard Savage proved this bound in 1963. A significant result at five percent is, at best, modest evidence.
Thomas Sellke, Maria Bayarri and James Berger turned this into a rule of thumb. For p below one over e, the Bayes factor for the null is at least minus e times p times the log of p, over a wide class of reasonable alternatives. So p equal to point zero five is worth odds of at most two and a half to one against the null. Point zero one is worth at most eight to one; point zero zero one, about fifty to one. This is why seventy-two statisticians and scientists proposed in 2018 to call results significant only below point zero zero five. Particle physicists already ask for five sigma, a p-value near three in ten million, before announcing a discovery, as they did for the Higgs boson in 2012.
Lindley's lesson was tested on the most famous result of the replication crisis. In 2011 Daryl Bem reported nine experiments, eight of them significant, suggesting that people can sense future events. Eric-Jan Wagenmakers and colleagues re-analysed them with default Bayes factors, and found that most gave only anecdotal evidence, and some favoured the null. Jeffrey Rouder and Richard Morey pooled the studies and found that the data, taken together, did favour an effect, and then asked how plausible precognition was beforehand. Significant results from many modest studies need not be strong evidence; and a claim that contradicts physics starts with prior odds that no such evidence can overcome.
What it establishes: Lindley's paradox (1957); prior sensitivity; Edwards–Lindman–Savage; Sellke–Bayarri–Berger (2001); Benjamin et al. (2018); Bem re-analysed.; Computed on screen: B₀₁ against n at fixed z; B₀₁ against prior width; the bound table
8Severe testingAdvanced3 min
Deborah Mayo has spent forty years defending error statistics against the likelihood principle, and she reinterprets what tests are for. Her severity requirement: data are good evidence for a claim only if the claim passed a test that would very probably have failed, had the claim been false. For a normal mean, the severity with which the claim mu greater than mu one passes is the probability of a result no bigger than the one observed, if mu were exactly mu one. Error probabilities are then used to assess this particular inference, not just the long-run behaviour of a rule. That answers Neyman's critics, and it depends on what other results could have occurred.
Take a significant result: an observed mean of point four, with twenty-five observations, so z is two. Plot, for each mu one, the severity with which the claim mu greater than mu one has passed. That mu is positive passed with severity point nine eight: had mu been zero, so large a result would have been very unlikely. That mu exceeds point one, with severity point nine three. That mu exceeds point four, only point five: a coin flip. That it exceeds point six, point one six: poorly warranted. Mayo calls the mistake of reading a significant result as a large effect the fallacy of rejection. Severity says how large an effect the data actually warrant.
Now a result that is not significant: an observed mean of point two, z of one, p of point one six. Here the question is which upper bounds on mu passed severely. That mu is below point six passed with severity point nine eight: large effects are ruled out. That mu is below point four, only point eight four. And that mu is below point one, a third: the data come nowhere near showing that there is no effect. This is the fallacy of acceptance, misreading number two from chapter two, now with a number attached.
There is a twist. For a normal mean, the severity of the claim mu greater than mu one equals the posterior probability of that claim under a flat prior. Bayesians conclude that severity is a posterior in disguise, and should therefore obey the likelihood principle. Mayo replies that the agreement is a coincidence of this simple case: once the experimenter may stop optionally, severity changes and the posterior does not, and that difference is the whole point. The stakes are the same as in chapter six: whether evidence depends on the experiment that could have been run, or only on the one that was.
What it establishes: Mayo's severity requirement; fallacies of rejection and acceptance; severity and the flat-prior posterior.; Computed on screen: severity curves for a significant and a non-significant result
9Simpson's paradoxIntroductory3 min
In 1973 the graduate division of the University of California at Berkeley looked at its admissions. In its six largest departments, forty-five percent of men who applied were admitted. Only thirty percent of women were. The gap was large, the numbers were thousands, and a lawsuit seemed likely.
Peter Bickel, Eugene Hammel and William O'Connell looked department by department. In department A, women were admitted at eighty-two percent, men at sixty-two. In B, C, D, E and F the rates were close, and women came out ahead in three of them. Women did better in four of the six departments. The reversal comes from where people applied. More than half the men applied to A and B, which admitted most applicants. Almost all the women applied to C through F, which admitted few applicants of either sex. Aggregating mixes the departments in different proportions for the two groups. This is Simpson's paradox, described by Edward Simpson in 1951, and earlier by Yule and Pearson.
The pattern is not a curiosity of one university. Early in the COVID-19 pandemic, a larger share of confirmed cases died in Italy than in China. Yet within every age group, a smaller share died in Italy. Italy's confirmed cases were much older, and age drives both who becomes a confirmed case and who dies. Julius von Kügelgen, Luigi Gresele and Bernhard Schölkopf documented the reversal from the national reports. A reversal needs nothing more than groups mixed in unequal proportions. It is arithmetic, and it is everywhere.
So which table answers the question, the aggregate or the departments? Judea Pearl's answer is that the numbers alone cannot say. At Berkeley, sex influences which department one applies to, and the department influences admission. To ask whether departments discriminate, condition on the department, as Bickel did. Now take numbers with exactly the same pattern, about a drug that works by lowering blood pressure. Blood pressure is on the causal path. To ask whether the drug helps, you must not condition on it, and the aggregate table is the right one. The same numbers, two causal stories, two different right answers. As Nancy Cartwright put it, no causes in, no causes out. Part 17 builds the graphs that decide.
What it establishes: Berkeley 1973 (Bickel et al. 1975); COVID-19 case fatality (von Kügelgen et al. 2021); the causal reading.; Computed on screen: the six departments, aggregate and by department
10The reference classAdvanced2 min
Frequencies belong to classes, but decisions are about individuals. Bob is sixty, smokes, and runs every day. Will he be alive in ten years? Among sixty-year-olds, say ninety percent are. Among sixty-year-old smokers, eighty. Among sixty-year-old runners, ninety-five. And the class that fits him best, smoking runners of sixty, has twelve people on record: too few to trust. Which number is Bob's probability? John Venn saw the problem in 1866. Reichenbach advised using the narrowest class for which reliable statistics exist, which is a rule of thumb, not an answer.
Alan Hájek argued in 2007 that the reference class problem is everyone's problem. For a frequentist, a frequency is relative to a class, and the question is which class. For a propensity theorist, a chance is relative to a chance set-up, and the question is which description of the set-up. For the classical view, equal possibilities are relative to a partition, as Bertrand's paradox showed in Part 13. And a subjective Bayesian must say which evidence to condition on. All of your evidence is the official answer, but it is itself a reference class, and usually too fine to use. Hájek's conclusion: probability is fundamentally conditional, and the reference class is part of the question, not a defect in the answer.
The problem is now built into machines. An insurance premium is a frequency in a reference class: drivers of your age, postcode and car. Personalized medicine asks what happens to patients like you, and every feature that makes the class more like you also makes it smaller. A recidivism risk score is a frequency in a class that someone chose, and the 2016 controversy over the COMPAS score was partly about which class. In machine learning, a model's features are its reference class, and choosing them is not only a statistical act but a normative one. Part 41 shows that calibrated scores for different groups cannot, in general, be fair in every sense at once.
What it establishes: Venn (1866); Reichenbach; Hájek (2007); reference classes in insurance, medicine, risk scores.
11Tests in industryApplied3 min
Fisher's randomized experiment now runs the internet. Visitors to a web site are randomly split. Half see the old page, half see a new button, and the company compares conversion rates: say ten percent against ten point six. The largest firms run tens of thousands of such experiments a year. And their experience, summarized by Ron Kohavi, Diane Tang and Ya Xu, is humbling: most ideas fail to improve the metric they were designed to improve. Telling small real effects from noise is the whole job.
Chapter five's problem, at industrial scale. Run two thousand A/A tests, in which both arms are identical, with a dashboard that shows the p-value after every hundred visitors. A team that looks once, at the planned end, declares a false win five percent of the time. A team that stops as soon as the dashboard shows p below point zero five declares a false win in thirty-one percent of experiments that changed nothing. A team that instead tracks a betting e-process, which chapter twelve explains, and stops when it reaches twenty, is wrong four percent of the time, however often it looks.
Statisticians have long known how to look repeatedly and stay honest. Abraham Wald invented the sequential probability ratio test during the Second World War, to inspect munitions with fewer samples. Comparing to one point nine six at every look is invalid. Stuart Pocock's design, for five planned looks, raises the bar to two point four one at each of them. Peter O'Brien and Thomas Fleming spend almost no error early, demanding a z of four and a half at the first look, and almost two at the last. And in 2017 Ramesh Johari and colleagues gave A/B platforms always-valid p-values, which may be watched continuously.
Experimentation teams have rediscovered the philosophy of this part as rules of thumb. Twyman's law: any figure that looks interesting or different is usually wrong. Check the randomization itself before believing the result. Watch fifty metrics and one will move by chance: the garden of forking paths again. And because most ideas fail, the base rate is low. If one idea in ten really works, about one win in five is false when tests have power point eight, and one in three when power is point five, as Ioannidis's formula predicts.
What it establishes: A/B testing (Kohavi et al. 2020); peeking; Wald (1945), Pocock (1977), O'Brien–Fleming (1979), always-valid p (Johari et al. 2017).; Computed on screen: 2,000 A/A tests with and without peeking; an e-process
12Testing by bettingResearch4 min
The newest idea in the field is also one of the oldest in probability. Glenn Shafer and Vladimir Vovk rebuilt probability itself as a game. A null hypothesis sets prices: it says which bets are fair. A skeptic starts with one dollar and bets against it, round by round, at those prices. If the null is right, the skeptic cannot expect to gain. So a large fortune is evidence against the null. The payoff of such a bet is called an e-value: a nonnegative number whose expectation under the null is at most one. By Markov's inequality, the chance under the null that it reaches one over alpha is at most alpha.
Here is a test by betting. To test whether a coin is fair, stake a fifth of your current wealth on heads at even odds, every toss. Your wealth is the product of the factors. If the coin is fair, the bet is fair, and on this logarithmic scale wealth drifts downward. If the coin lands heads sixty percent of the time, wealth grows exponentially. Reaching twenty dollars is evidence at the five percent level. Ninety-six percent of biased-coin runs get there within four hundred tosses, in a median of about a hundred and ten.
How much should the skeptic stake? John Kelly answered in 1956, for a gambler with inside information: maximize the expected growth rate of log wealth. For even-odds bets on heads with probability p, the best stake is two p minus one. Plot the growth rate against the stake. If heads come sixty percent of the time, growth peaks at a stake of point two, exactly the one we used. If the coin is fair, every stake loses growth, which is why the null cannot be beaten on average. And over-betting is ruinous: beyond about point three nine, even a sixty-percent coin shrinks your wealth. Choosing e-values to maximize growth under the alternative is now a design principle, called GROW by Peter Grünwald and his colleagues.
The guarantee holds at every moment at once. Jean Ville proved it in 1939, in the thesis that introduced the word martingale into probability. If wealth is a nonnegative martingale under the null, starting at one, the chance that it ever reaches c is at most one over c. The proof takes two lines. Stop the first time wealth reaches c. A fair game stopped at any such time still has expected value one. And on the event that wealth ever reached c, the stopped wealth is at least c. So one is at least c times that probability. The Reasoner checks it on four thousand fair-coin runs: wealth ever reached five in eighteen percent, under the bound of twenty; ever reached a hundred in six tenths of a percent, under the bound of one.
Why has this idea spread so quickly? Tests by betting are anytime-valid: look as often as you like and stop when you like, and the error guarantee holds. The problems of chapters five and eleven disappear. A promising study can be continued, and its e-values simply multiply. Independent studies combine the same way, which p-values never could. Likelihood ratios are themselves e-values, so Royall's bound in chapter five was Ville's inequality in disguise, and betting reconciles part of the likelihoodist's view with error control. Shafer proposes a philosophy to go with the mathematics: the evidence against a hypothesis is what a skeptic could have won by betting against it.
What it establishes: Shafer and Vovk; e-values; Kelly (1956) and GROW; Ville's inequality (1939), proved; optional continuation.; Computed on screen: wealth under the null and the alternative; growth curves; Ville checked
13Choosing a modelAdvanced3 min
Part 15 ended with the curve-fitting problem: more parameters always fit better. Statistics offers two standard penalties. Hirotugu Akaike's criterion of 1973 subtracts two for every adjustable parameter from twice the log-likelihood. He derived it as an estimate of how well the fitted model will predict new data. Gideon Schwarz's criterion of 1978 charges log n per parameter instead. It approximates the Bayesian evidence for the model. For any sample of eight or more, it punishes complexity harder. Malcolm Forster and Elliott Sober argued in 1994 that Akaike had answered an old philosophical question: simplicity matters, not because simple theories are more likely true, but because they predict better.
The Reasoner tests the claim. The truth is a cubic with noise. Draw thirty points, fit polynomials of each degree, and repeat three hundred times. The fit to the training data rises with every added degree. The real test is the fit to fresh data from the same source, which rises to the true degree and then falls. Akaike's estimate, the training fit minus a penalty, is computed from the training data alone, and it tracks the fresh-data fit closely, peaking at the right place. That is the sense in which AIC estimates predictive accuracy.
Now ask which degree each criterion picks, over the three hundred training sets. Akaike's criterion picks the true degree about two thirds of the time, and a more complex model a third of the time. Schwarz's criterion picks the true degree more than eight times in ten. That is a general result. The Bayesian criterion is consistent: if one of the candidate models is true, it finds it as the data grow. Akaike's is efficient instead: when none of the models is exactly true, as in most real science, it gives the best predictions. Truth or prediction: the choice of criterion is the choice of aim.
Each criterion carries a philosophy. The Bayesian criterion aims at the true model, and assumes it is among the candidates. Akaike's aims at prediction, and needs no model to be true: Elliott Sober reads it as a kind of instrumentalism. Part 15 gave three further reasons to prefer simple models: compression, the universal prior, and Kelly's efficient path to the truth. Whether science aims at truth or only at successful prediction is the question of Part 18.
What it establishes: AIC (1973) and BIC (1978); Forster and Sober (1994); consistency and efficiency.; Computed on screen: training fit, AIC's estimate and predictive fit; which degree each picks
Recap, problems, and where this comes backAll tracks2 min
Let's gather what we built. Three schools, and three verdicts from one coin. What a p-value is, and six things it is not. Base rates, why many findings are false, and a machine that manufactures discoveries from noise. Optional stopping, and Birnbaum's theorem, this part's brick in the Wall. Lindley's paradox, the limits of a significant result, and severity. Simpson's paradox, the reference class, and statistics in industry. And testing by betting, with the choice between truth and prediction in model selection.
The Reasoner has a new module, stats. It runs the three schools on one coin, simulates p-values and their misreadings, computes base rates and Ioannidis's table, walks the garden of forking paths, peeks at data under the null, checks Birnbaum's example and Lindley's paradox, draws severity curves, reverses Berkeley, bets against a fair coin, and chooses polynomial degrees by AIC and BIC. And the Wall has its sixteenth brick.
Six problems, with full solutions in this part's notes. A rare disease and a good test; Ann and Bo under Bayes; why p is uniform under the null; combining e-values; Lindley's paradox at three sigma; and Berkeley, reweighted. Pause here, and try them.
Where this comes back. Simpson's paradox, randomized trials and causal graphs, in Part 17. Underdetermination, and the choice between truth and prediction, in Part 18. Frequencies and propensities, in Part 24. Tests as decisions, in Part 33. Reference classes and fair risk scores, in Part 41. And the statistics of evaluating machines, in the finale. Next, Part 17: cause.
The books and papers this part follows are on screen, and in the notes. Thanks for watching.
Where it goes next. Simpson's paradox, randomized trials and causal graphs follow in Part 17; underdetermination and the choice between truth and prediction in Part 18; frequencies and propensities in Part 24; tests as decisions in Part 33; reference classes and fair risk scores in Part 41; the statistics of evaluating machines in the finale.
Key results
The part's results in one place, for revision.
Try it
Lab 16 · Optional stopping breaks the p-value and not the bet
Under a true null, test after every ten observations and stop at the first p < 0.05: the Reasoner counts how often that ever happens in 100 looks. Then test a fair coin by betting, and check Ville's inequality: wealth ever reaches 1/alpha in at most a share alpha of runs. Birnbaum's two coin experiments are computed beside them.
python -m videos.philosophy.labs 16
needs numpy, scipy, matplotlib · download lab16.py ·
source on GitHubfalse rejections, 1 look 0.051 (theory 0.050)
false rejections, 10 looks 0.191
false rejections, 100 looks 0.371 (the film: about 0.35)
likelihood ratio ever reaches 10, 100 looks 0.066 (bound 0.100)
fair coin: wealth ever reaches 5 0.188 (bound 0.20)
fair coin: wealth ever reaches 10 0.097 (bound 0.10)
fair coin: wealth ever reaches 20 0.048 (bound 0.05)
fair coin: wealth ever reaches 100 0.008 (bound 0.01)
60% coin: wealth reaches 20 within 400 tosses 0.952 median toss 110
9 heads, 3 tails: likelihood ratio 0.75 vs 0.5 4.81 (12 tosses) 4.81 (to the 3rd tail)
9 heads, 3 tails: one-sided p 0.073 (12 tosses) 0.033 (to the 3rd tail)
A p-value is valid for the one look that was planned: peeking a hundred times turns 5% into about a third. A bettor's wealth is a test martingale, so its guarantee holds at every look at once.
The code (67 lines; it asserts its own result)
"""Lab 16: peek at a p-value and at a bettor's wealth under a true null, and compare the false alarms."""
import numpy as np
from videos.coursekit import labs
from explainer.philosophy.reasoner import stats as St
TITLE = "Optional stopping breaks the p-value and not the bet"
GOAL = ("Under a true null, test after every ten observations and stop at the first p < 0.05: the Reasoner counts "
"how often that ever happens in 100 looks. Then test a fair coin by betting, and check Ville's inequality: "
"wealth ever reaches 1/alpha in at most a share alpha of runs. Birnbaum's two coin experiments are computed "
"beside them.")
TASKS = [
"Change check_every from 10 to 1 and to 100. How does the share of runs that ever reject depend on the number "
"of looks, and what is it with a single look?",
"Bet a fraction lam = 0.5 instead of 0.2 on the 60% coin. Compare the share of runs reaching 20 with the "
"Kelly growth rate p ln(1 + lam) + (1 - p) ln(1 - lam).",
"In St.birnbaum's setting, compute both p-values for 10 heads and 2 tails (stop at the 2nd tail). Do the "
"verdicts at the 5% level still disagree?",
]
def run(seed=0):
lab = labs.Lab()
stop = St.optional_stopping(runs=2000, max_n=1000, check_every=10, seed=seed)
looks = np.arange(1, len(stop["looks"]) + 1)
ever = np.array(stop["ever_rejected"])
assert abs(ever[0] - 0.05) < 0.02, "one look: the nominal 5%"
assert ever[-1] > 0.25 and np.all(np.diff(ever) >= 0), "a hundred looks: far above 5%"
assert stop["lr_ever_10"] <= 0.10 + 0.01, "a likelihood ratio reaches 10 in at most 1 run in 10"
lab.row("false rejections, 1 look", f"{ever[0]:.3f} (theory 0.050)")
lab.row("false rejections, 10 looks", f"{ever[9]:.3f}")
lab.row("false rejections, 100 looks", f"{ever[-1]:.3f} (the film: about 0.35)")
lab.row("likelihood ratio ever reaches 10, 100 looks", f"{stop['lr_ever_10']:.3f} (bound 0.100)")
bet = St.betting(n=400, p_true=0.6, runs=4000, seed=seed, lam=0.2)
alphas = [0.2, 0.1, 0.05, 0.01]
ville = [bet["ville"][str(a)] for a in alphas]
for a, v in zip(alphas, ville):
assert v <= a + 0.015, "Ville's inequality"
lab.row(f"fair coin: wealth ever reaches {1 / a:g}", f"{v:.3f} (bound {a:.2f})")
assert bet["alt_reach_20"] > 0.85, "the bet has power against a 60% coin"
lab.row("60% coin: wealth reaches 20 within 400 tosses", f"{bet['alt_reach_20']:.3f} median toss {bet['median_time_to_20']:.0f}")
b = St.birnbaum()
assert b["proportional"] and b["p_binomial"] > 0.05 > b["p_negative_binomial"], "same likelihood, two verdicts"
lab.row("9 heads, 3 tails: likelihood ratio 0.75 vs 0.5", f"{b['ratio_E1']:.2f} (12 tosses) {b['ratio_E2']:.2f} (to the 3rd tail)")
lab.row("9 heads, 3 tails: one-sided p", f"{b['p_binomial']:.3f} (12 tosses) {b['p_negative_binomial']:.3f} (to the 3rd tail)")
lab.note = ("A p-value is valid for the one look that was planned: peeking a hundred times turns 5% into about "
"a third. A bettor's wealth is a test martingale, so its guarantee holds at every look at once.")
fig, ax = labs.figure(2, size=(11, 4.2))
ax[0].plot(looks, ever, color=labs.RED, label="stop at the first p < 0.05")
ax[0].axhline(0.05, color=labs.MUTED, ls="--", lw=1, label="nominal 5%")
ax[0].axhline(stop["lr_ever_10"], color=labs.GREEN, label="likelihood ratio ever reaches 10 (bound 10%)")
ax[0].set(title="Under a true null: runs that ever 'reject'", xlabel="number of looks (one every 10 observations)",
ylabel="share of 2,000 runs", ylim=(0, max(0.45, ever[-1] * 1.25)))
ax[0].legend(loc="upper left")
t = np.arange(1, len(bet["null_path"]) + 1) * 2
ax[1].semilogy(t, bet["null_path"], color=labs.BLUE, label="one fair coin")
ax[1].semilogy(t, bet["alt_path"], color=labs.GOLD, label="one 60% coin")
ax[1].axhline(20, color=labs.RED, ls="--", lw=1, label="wealth 20: evidence at the 5% level")
ax[1].axhline(1, color=labs.MUTED, lw=0.8)
ax[1].set(title="Betting a fifth of your wealth on heads", xlabel="tosses", ylabel="wealth (start: 1)")
ax[1].legend(loc="upper left")
lab.fig = fig
return lab
Now change it
- Change check_every from 10 to 1 and to 100. How does the share of runs that ever reject depend on the number of looks, and what is it with a single look?
- Bet a fraction lam = 0.5 instead of 0.2 on the 60% coin. Compare the share of runs reaching 20 with the Kelly growth rate p ln(1 + lam) + (1 - p) ln(1 - lam).
- In St.birnbaum's setting, compute both p-values for 10 heads and 2 tails (stop at the 2nd tail). Do the verdicts at the 5% level still disagree?
Problems, with solutions
Try each problem before opening its solution.
-
Prevalence 0.1%, sensitivity 99%, false positives 1%: what share of positives are sick?
Solution
In 100,000 people, 100 are sick and 99 of them test positive; 99,900 are well and 999 of them test positive. So \(99/(99 + 999) = 9.0\%\) of positives are sick. The test is good; the base rate is low, so most positives are false.
-
For Ann's and Bo's coins, show that the Bayes factor under a uniform prior is the same.
Solution
Ann's likelihood is \(\binom{12}{9}\theta^9(1-\theta)^3\) and Bo's, for the third tail on the twelfth toss, is \(\binom{11}{9}\theta^9(1-\theta)^3\): the same function of \(\theta\) up to a constant. The Bayes factor for "the chance is uniform on \([0, 1]\)" against "the coin is fair" is \(\int_0^1 c\,\theta^9(1-\theta)^3\,d\theta \,\big/\, c\,(1/2)^{12}\), and the constant \(c\) cancels. With the Beta integral \(9!\,3!/13! = 1/2860\), both get \(4096/2860 = 1.43\): weak evidence of bias, the same for both, where their \(p\)-values (0.073 and 0.033) disagreed.
-
Prove that under \(H_0\) the \(p\)-value of a continuous test statistic is uniform on \([0, 1]\).
Solution
Let the statistic \(T\) have continuous distribution function \(F_0\) under \(H_0\), and \(p = 1 - F_0(T)\). Then \(F_0(T)\) is uniform on \([0, 1]\) (the probability integral transform: \(P(F_0(T) \le u) = P(T \le F_0^{-1}(u)) = u\)), so \(P(p \le u) = P(F_0(T) \ge 1 - u) = u\) for every \(u\): \(p\) is uniform. That is why, under the null, a test at level \(\alpha\) rejects with probability exactly \(\alpha\), and why a pile of \(p\)-values from true nulls is flat.
-
If \(E_1, E_2\) are independent e-values, is \(E_1 E_2\) one? Is \((E_1 + E_2)/2\)?
Solution
Both are. For the product, independence gives \(E[E_1E_2] = E[E_1]\,E[E_2] \le 1\) under the null, and the product is nonnegative. (It is also valid when \(E_2\) is an e-value conditionally on the first study's data, which is how betting continues a study.) For the average, linearity alone gives \(E[(E_1 + E_2)/2] \le 1\), with no independence needed. The product grows fast when both studies point the same way; the average is the safe choice when the studies may be dependent.
-
Compute Lindley's \(B_{01}\) for \(z = 3\), \(n = 10^4\), \(\tau = 1\). Which way does it point?
Solution
With known unit variance and \(\theta \sim N(0, \tau^2)\) under \(H_1\), \(B_{01} = \sqrt{1 + n\tau^2}\,\exp\!\big(-\tfrac{z^2}{2}\cdot\tfrac{n\tau^2}{1 + n\tau^2}\big)\). For \(z = 3\), \(n = 10^4\), \(\tau = 1\): \(\sqrt{10001} \times e^{-4.4996} = 100.0 \times 0.0111 = 1.11\). A three-sigma result (\(p = 0.0027\)) leaves the Bayes factor slightly in favour of the null: with ten thousand observations a real effect of the size the prior expects would give a far larger \(z\), so \(z = 3\) is about as likely under the null.
-
Reweight Berkeley's six departments by total applicants: who is admitted more?
Solution
Weight each department by its total applicants (men and women together, 4,526 in all) and apply each sex's own admission rate there. Men: \(\sum_d w_d\,r^{\text{men}}_d = 38.7\%\). Women: 43.0%. Women are admitted more, reversing the raw 44.5% against 30.4%: the gap in the raw table came from women applying to the departments that admitted few applicants of either sex.
Notes and sources
Sources
Texts: Royall, Statistical Evidence: A Likelihood Paradigm (1997); Hacking, Logic of Statistical Inference (1965); Mayo, Statistical Inference as Severe Testing (2018); Sober, Evidence and Evolution (2008), ch. 1; Berger and Wolpert, The Likelihood Principle (2nd ed. 1988); Shafer and Vovk, Game-Theoretic Foundations for Probability and Finance (2019); Kohavi, Tang and Xu, Trustworthy Online Controlled Experiments (2020); Gigerenzer, Calculated Risks (2002).
Papers: Fisher (1925, 1930); Neyman and Pearson (1933); Neyman (1937); Jeffreys (1939); Ville (1939); Wald (1945); Lindley (1957); Birnbaum (1962); Edwards, Lindman and Savage (1963); Armitage, McPherson and Rowe (1969); Akaike (1973); Bickel, Hammel and O'Connell (1975); Schwarz (1978); Forster and Sober (1994); Sellke, Bayarri and Berger (2001); Ioannidis (2005); Hájek (2007); Simmons, Nelson and Simonsohn (2011); Gelman and Carlin (2014); Mayo (2014); Open Science Collaboration (2015); Wasserstein and Lazar (2016); Johari et al. (2017); Benjamin et al. (2018); Shafer (2021); Ramdas et al. (2023); Grünwald, de Heide and Koolen (2024).
About this partfrom its README
Part 16 of Philosophy, Built (series plan, syllabus): the philosophy of statistics. The replication crisis (Open Science Collaboration 2015; Bem 2011; Amgen 2012); Fisher's lady tasting tea and the p-value, Neyman and Pearson's errors and lemma, Jeffreys's Bayes factors, Fisher's fiducial argument, and three verdicts from one coin (60 heads in 100: p = 0.057, no rejection at power 0.46, B₀₁ = 1.10); the feud and the "null ritual"; the distribution of p under the null and an alternative, six misreadings each refuted by simulation, confidence intervals and their fallacy, and the ASA statement (2016); base rates on a 1,000-person grid (PPV 9%), the prosecutor's fallacy in R v. Sally Clark, People v. Collins (one in twelve million, yet a 42% chance of a second matching couple), and Ioannidis's positive predictive value, recomputed; the garden of forking paths on one noise data set (4 of 48 paths significant), a p-hacking simulator (5% → 37%), the winner's curse (type M and type S errors), the replication record and its remedies; optional stopping (35% false rejections after 100 looks) against a likelihood-ratio stopper (5%), and the debate over intentions; the likelihood principle, the binomial and negative-binomial coins (identical likelihoods, p = 0.073 and 0.033), Birnbaum's theorem proved on the mixture experiment, and its Price List (the Wall's sixteenth brick); Lindley's paradox (z = 2 at n from 10 to a million: B₀₁ from 0.54 to 135), why it happens, prior sensitivity and the Edwards–Lindman–Savage bound, the Sellke–Bayarri–Berger bound and p < 0.005, and Bem re-analysed; Mayo's severity curves and the fallacies of rejection and acceptance; Simpson's paradox at Berkeley (women ahead in 4 of 6 departments, behind overall), in COVID-19 case fatality, and its causal reading; the reference class problem (Venn, Reichenbach, Hájek) and in machines; A/B testing, peeking (31% false wins) against an e-process (4%), and group-sequential boundaries (Wald, Pocock, O'Brien–Fleming); testing by betting, Kelly's growth rate, Ville's inequality proved and checked, and why e-values compose; and AIC against BIC (Forster and Sober), with AIC's estimate tracking predictive accuracy.
The worked model results are computed by the Reasoner's new module explainer/philosophy/reasoner/stats.py (no SciPy:
its own normal and Student-t distributions), tested in tests/philosophy/test_stats.py and cached by
compute.py.
Chapter notes
| # | Scene | What it establishes | Computed on screen |
|---|---|---|---|
| 0 | Hook |
Fisher (1935); the replication crisis; the plan. | — |
| 1 | Schools |
Fisher (1925, 1935), Neyman and Pearson (1933), Jeffreys (1939); fiducial probability; the feud; the null ritual. | the lady tasting tea (1/70); α and β; three verdicts on 60 heads in 100 |
| 2 | PValue |
the definition; six misreadings; confidence intervals (Neyman 1937; Morey et al. 2016); the ASA statement (2016). | p under null and alternative; each misreading simulated; 95 of 100 intervals |
| 3 | BaseRate |
natural frequencies (Gigerenzer and Hoffrage 1995); Sally Clark; People v. Collins (1968); Ioannidis (2005). | a 1,000-person grid: PPV 9%; a second matching couple (42%); Ioannidis's table and PPV curves |
| 4 | Garden |
forking paths (Gelman and Loken); Simmons, Nelson and Simonsohn (2011); Gelman and Carlin (2014); the replication record; remedies. | 48 analyses of one noise data set; the p-hacking simulator; type M and S errors |
| 5 | Stopping |
optional stopping (Armitage et al. 1969); the stopping rule principle (Edwards, Lindman and Savage 1963); the debate. | a p-value path; rejection rate by number of looks; a likelihood-ratio stopper |
| 6 | Likelihood |
Royall's three questions; the law of likelihood (Hacking 1965); Birnbaum's theorem (1962); Price List; the Wall's sixteenth brick. | binomial and negative binomial likelihoods and p-values |
| 7 | Lindley |
Lindley's paradox (1957); prior sensitivity; Edwards–Lindman–Savage; Sellke–Bayarri–Berger (2001); Benjamin et al. (2018); Bem re-analysed. | B₀₁ against n at fixed z; B₀₁ against prior width; the bound table |
| 8 | Severity |
Mayo's severity requirement; fallacies of rejection and acceptance; severity and the flat-prior posterior. | severity curves for a significant and a non-significant result |
| 9 | Simpson |
Berkeley 1973 (Bickel et al. 1975); COVID-19 case fatality (von Kügelgen et al. 2021); the causal reading. | the six departments, aggregate and by department |
| 10 | Reference |
Venn (1866); Reichenbach; Hájek (2007); reference classes in insurance, medicine, risk scores. | — |
| 11 | AB |
A/B testing (Kohavi et al. 2020); peeking; Wald (1945), Pocock (1977), O'Brien–Fleming (1979), always-valid p (Johari et al. 2017). | 2,000 A/A tests with and without peeking; an e-process |
| 12 | Betting |
Shafer and Vovk; e-values; Kelly (1956) and GROW; Ville's inequality (1939), proved; optional continuation. | wealth under the null and the alternative; growth curves; Ville checked |
| 13 | Models |
AIC (1973) and BIC (1978); Forster and Sober (1994); consistency and efficiency. | training fit, AIC's estimate and predictive fit; which degree each picks |
| 14 | Outro |
recap; the Reasoner's module; the Wall; problems; payoffs; references. | — |
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Three schools: Fisher's significance, Neyman–Pearson's error control, Bayes; the 1930s feuds.
- The p-value defined and the six common misreadings, each refuted by simulation (the ASA statement 2016).
- The base-rate fallacy: a medical test with 1% prevalence, drawn as a population grid.
- Ioannidis (2005): positive predictive value from power, α and prior odds, computed across fields.
- The garden of forking paths. Built: a p-hacking simulator that turns pure noise into "significant" results. The replication crisis numbers (Open Science Collaboration 2015) are cited.
- Optional stopping: a frequentist test breaks, while Bayesian posteriors and the likelihood principle don't. Computed.
- The likelihood principle; Birnbaum's theorem (1962), that sufficiency plus conditionality imply it, stated and proved. Mayo's challenge (2014) and the debate.
- Lindley's paradox, computed: p < 0.05 while the Bayes factor favors the null.
- Bayes factors, priors on hypotheses, and the sensitivity to the prior.
- Severe testing (Mayo): severity curves computed.
- Simpson's paradox: the Berkeley admissions data (Bickel, Hammel and O'Connell 1975; cited) and the causal reading (previews Part 17).
- The reference class problem (Hájek).
- Industry: A/B testing; the peeking problem; sequential tests.
- Testing by betting: e-values and test martingales (Shafer and Vovk; Grünwald, de Heide and Koolen; Ramdas et al.) with Ville's inequality proved; anytime-valid inference, computed. The philosophy of evidence as betting gains.
- Model selection: AIC as an estimate of predictive accuracy (Forster and Sober 1994) vs BIC.
- Recap and Problems.
Built: reasoner.stats (p-hacking garden, PPV calculator, Lindley's paradox, e-values and betting martingales).
Wall: Birnbaum's theorem (respect sufficiency and conditionality, and you must accept the likelihood principle);
Lindley's paradox.
Visuals: the population grid of true and false positives; a p-value random walk crossing 0.05 under the null; a
betting wealth curve climbing under the alternative.
References: Royall, Statistical Evidence; Mayo, Statistical Inference as Severe Testing; Sober, Evidence and
Evolution ch. 1; Shafer and Vovk, Game-Theoretic Foundations for Probability and Finance; Ramdas et al. 2023
(Stat Sci), "Game-theoretic statistics and safe anytime-valid inference".
Build the film
python -m videos.philosophy.philosophy16.compute # the part's numbers, into .cache/philosophy16
python tools/build.py philosophy16 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py philosophy16 Hook # one chapter, silent, with a contact sheet
Scenes: videos/philosophy/philosophy16. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.philosophy.philosophy16.compute # every computed item (under a minute; .cache/philosophy16)
python tools/build.py philosophy16 -q l # 480p preview
python tools/build.py philosophy16 # 1080p30 -> renders/philosophy16.mp4
python tools/qa_scene.py philosophy16 Betting # one chapter, silent, with a contact sheet