Thousands of Questions
Ask enough questions and chance will answer some: which answers are real?
A dead salmon in a scanner appears to respond to photographs: in a toy fish of 9,141 voxels of pure noise, 446 have p below 0.05, and none survives a correction. The World's gene study makes the problem a table: 5,000 genes, 250 truly differential, and 430 uncorrected discoveries of which 214 are false. Bonferroni, Holm and Westfall-Young control the chance of any false discovery and find about fifty genes. Benjamini and Hochberg change the promise to the expected share of false discoveries, and the proof that the rate is pi0 times q under independence is given; Storey's estimate, Efron's local fdr and knockoffs extend it. The part turns from procedures to practice: the false discovery proportion spreads widely under correlation, and a p-hacking simulator shows four small analytic freedoms raising the false-positive rate from 5% to 61%. Ioannidis's calculation, the replication projects and publication bias are measured, and the remedies are argued. It ends with the false coverage rate: intervals reported only for selected effects cover 79% until they are widened.
What you need. Testing and p-values from Part 10, and the empirical Bayes of Part 25.
- Hook
- the dead salmon in the scanner
- Mathematics
- FWER, BH proved, q-values, local fdr, knockoffs, forking paths, replication, publication bias
- Built
- a p-hacking simulator
What you will be able to do
Bachelor's
- Compute how many false positives to expect from m tests at level alpha, and apply Bonferroni's and Benjamini-Hochberg's rules to a sorted list of p-values.
- Compute the positive predictive value of a significant finding from the prior, the power and alpha.
Master's
- Prove that Benjamini-Hochberg has FDR equal to pi0 times q for independent uniform nulls, and derive Holm's procedure from closed testing.
- Estimate pi0 and q-values, and a local fdr with a theoretical and an empirical null.
- Construct FCR-adjusted intervals for the selected parameters.
PhD
- Prove the knockoff filter's FDR bound by the coin-flip argument, stating the exchangeability it needs.
- Explain why FDR control says little about the realized FDP under dependence, and state the conditions (PRDS, arbitrary dependence) under which BH and BY hold.
Practice
- Diagnose a literature with a funnel plot, Egger's test and a p-curve, naming the other explanations each pattern admits.
- Write a preregistration that fixes the outcomes, the stopping rule, the covariates and the exclusions the p-hacking simulator varies.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Bachelor's 18 min · Master's 50 min · PhD 55 min · Practice 26 min.
- 0The dead salmonBachelor's4 min
- 1The problemBachelor's4 min
- 2Family-wise errorMaster's5 min
- 3The false discovery rateMaster's5 min
- 4Adaptive FDRMaster's3 min
- 5Empirical BayesMaster's4 min
- 6FDR is an averageMaster's4 min
- 7KnockoffsPhD5 min
- 8The garden of forking pathsBachelor's4 min
- 9ReplicationBachelor's4 min
- 10Publication biasPractice4 min
- 11Remedies arguedPractice4 min
- 12The false coverage rateMaster's3 min
- Recap, problems, and the road aheadAll tracks3 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.
The dead salmonBachelor's4 min
In 2009 the neuroscientist Craig Bennett and his colleagues put a salmon into an MRI scanner. It was a mature Atlantic salmon, and, as their poster put it, not alive at the time of scanning. They showed it photographs of people in social situations and asked it to judge what emotion each person felt. A standard analysis found a small cluster of voxels in the salmon's brain that responded to the photographs. The salmon was not thinking. Its brain was tested at thousands of locations at once, and at thousands of locations, chance alone will light some up. The work became a widely discussed demonstration of multiple testing.
We can illustrate the statistical problem with a toy simulation. Here is a fish-shaped brain of nine thousand one hundred and forty-one voxels, each measured in fifteen independent Gaussian noise images, smoothed in space. This is not a reconstruction of the original task design. At each voxel, a one-sample t-test asks whether its mean is zero. By construction, none does: every null hypothesis is true.
Threshold the map at p below one in a hundred, uncorrected. Seventy-eight voxels light up, in twenty-seven separate blobs. At the conventional five percent, four hundred and forty-six do. They form blobs rather than isolated dots because the noise at neighbouring voxels is correlated, which makes chance activity look like anatomy.
The salmon study used a stricter threshold, p below one in a thousand, and required a cluster of at least three voxels. In our fish three voxels survive this realization, against an expectation of about nine. Correlation makes the count fluctuate. In the salmon's real scan, a cluster of three survived. A stricter per-voxel threshold reduces false positives, but it is not a correction for the number of tests: with a hundred and thirty thousand voxels in a human brain scan, p below a thousandth still lights up about a hundred and thirty by chance.
Bennett's real point came next: correct for the number of tests. With Bonferroni's correction, chapter two, no voxel survives. With a false discovery rate correction, chapter three, none either. The dead fish is dead again. The example shows why a per-voxel threshold alone cannot support a whole-map claim.
The arithmetic is simple. With exactly uniform null p-values, testing m true nulls at alpha gives m times alpha expected false positives, even under dependence. With super-uniform p-values this is an upper bound. For the fish, four hundred and fifty-seven expected at five percent; we saw four hundred and forty-six. The chance of at least one false positive is one minus one minus alpha to the m, for independent tests. With twenty tests that is already sixty-four percent; with a hundred, ninety-nine point four. Part 10's single test, multiplied.
Modern science asks thousands of questions at once: twenty thousand genes, a hundred thousand voxels, dozens of metrics in every online experiment. And quietly, many analyses of a single data set, which is the same problem in disguise. When chance answers some of the questions, which answers are real? And what should we even promise about a list of thousands of discoveries? This part changes what error control means.
Numbers: 446 of 9,141 at p < .05; 0 corrected
1The problemBachelor's4 min
The World has a gene-expression study. Twenty-five patients and twenty-five healthy controls, with the expression of five thousand genes measured in each. Genes come in pathways of twenty-five whose expression is correlated. For each gene, a two-sample t-test asks whether patients and controls differ. Because this is the World, we know the truth: two hundred and fifty genes, in ten pathways, really differ; the other four thousand seven hundred and fifty do not.
Here are all five thousand p-values, one cell per gene, in pathway order. Brighter cells have smaller p-values. The real effects show up as bright runs, whole pathways at a time. But scattered bright cells appear everywhere else too: noise, answering some of our five thousand questions.
The naive analysis declares every gene with p below five percent a discovery. That gives four hundred and thirty discoveries. Two hundred and sixteen are real, and two hundred and fourteen are false. Half this particular list is noise. Across repeated studies, five percent of four thousand seven hundred and fifty null genes is about two hundred and thirty-eight.
The histogram of all five thousand p-values tells the story. Under a true null, a p-value is uniformly distributed, so null genes fill a flat floor. Real effects pile up near zero. If alternatives rarely produce large p-values, the upper histogram estimates the null share, about point nine six here, against a truth of point nine five. Chapter four uses exactly this idea.
Why is a null p-value uniform? For a one-sided test, the p-value is one minus the null distribution function at the observed statistic, and the chance that this is at most u is exactly u, the probability integral transform of Part 7. So under the null, p-values are uniform on zero to one. For these well-powered alternatives, small p-values are more common. A decreasing density is not a universal property of alternatives. For discrete tests, like Fisher's exact test, the p-value is super-uniform: the chance it is below u is at most u, This supports p-value error bounds when each procedure’s other assumptions, including dependence conditions, hold.
The bookkeeping, in Benjamini and Hochberg's notation. Of m hypotheses, m zero are true nulls and m one are not. Of the R we reject, V are false discoveries and S are true ones. Only R is ever observed. V and S are hidden, and every error rate in this part is a promise about them. For the genes: R four hundred and thirty, V two hundred and fourteen, S two hundred and sixteen.
Three promises one can make. Testing each hypothesis at level alpha controls the expected share of all m hypotheses that are falsely rejected, which says almost nothing about the list. The family-wise error rate is the probability of even one false discovery. The false discovery rate is the expected proportion of discoveries that are false. That proportion itself, the FDP, is random; the FDR is only its average, a distinction chapter six takes seriously.
Numbers: 430 discoveries, 214 false
2Family-wise errorMaster's5 min
The oldest correction is Bonferroni's: test each hypothesis at alpha over m. The chance of any false discovery is the chance of a union of events, which is at most the sum of their chances: m zero times alpha over m, at most alpha. No assumption about dependence is needed. Zbyněk Šidák's version is exact for independent tests, and barely different: for five thousand genes both test each gene at about one in a hundred thousand.
Sture Holm’s step-down procedure of 1979 can improve power without weakening the guarantee. Sort the p-values. Compare the smallest with alpha over m, the next with alpha over m minus one, and so on: the first true null encountered must face a threshold no larger than alpha divided by the number of true nulls. Stop at the first failure. Holm rejects everything Bonferroni does, and sometimes more, with the same guarantee and still no dependence restriction, provided the marginal p-values are valid.
Holm's procedure is a special case of a powerful principle, closed testing. Form every intersection hypothesis: that all the nulls in a set I are true. Reject an individual hypothesis only if every intersection containing it is rejected by its own level alpha test. This controls the family-wise error rate whatever local tests are used: to make any false rejection you must first reject the intersection of all the true nulls, which happens with probability at most alpha. With Bonferroni tests for every intersection, the closed procedure is exactly Holm's, a shortcut through two to the m tests.
A small example: three hypotheses with p-values point oh one, point oh four and point oh three. The closure has seven intersections, each tested by Bonferroni. The top intersection is rejected, three times the smallest p being point oh three; so are H one two and H one three. But H two three, at twice point oh three, point oh six, survives. So only H one is rejected. H two and H three would each pass alone, but both sit under the surviving H two three. Holm's steps say the same: point oh one beats point oh one seven, then point oh three fails against point oh two five.
Two refinements. R. J. Simes's test of 1986 rejects the global null if any sorted p-value falls below i alpha over m. Yosef Hochberg turned it into a step-up procedure: find the largest k whose p-value is below alpha over m minus k plus one, and reject all up to it. It is more powerful than Holm's but needs independence or suitable positive-dependence conditions for its intersection tests. And Westfall and Young's method uses the actual dependence among the tests, estimated by permutation.
Under an exchangeable global null, shuffling patient and control labels simulates a joint null reference while retaining gene dependence. Record the largest absolute t statistic over all genes, and repeat a thousand times. We use a plus-one Monte Carlo correction to the share of permutation maxima exceeding each statistic, refined step by step down the sorted list. Strong family-wise control also requires subset pivotality. When tests are correlated, joint calibration can improve on the union bound. Bonferroni itself makes no assumption about the maximum’s distribution.
The genes. Uncorrected: four hundred and thirty discoveries, half false. Bonferroni: forty-nine, none false. Holm adds one, as it happens a false one, still within its guarantee. Westfall and Young find fifty-three, using the correlation. Each makes zero or one false discoveries in this realization. Their promise bounds the chance of any false discovery across studies, not the number allowed in one study. But they find only about a fifth of the two hundred and fifty real effects.
Family-wise control is the right promise when a single false claim is costly: a drug's primary endpoints, a legal finding, a confirmatory trial. For exploratory discovery, a less stringent average error criterion may be more useful when candidates receive independent follow-up. There, a list with a few false entries is perfectly useful, when the chosen average error criterion suits the scientific loss. That is the false discovery rate.
Numbers: Bonferroni 49, Holm 50, WY 53
3The false discovery rateMaster's5 min
Yoav Benjamini and Yosef Hochberg, in Tel Aviv in the late 1980s, proposed changing the promise: control not the chance of any false discovery, but the expected share of discoveries that are false. The idea was resisted; the paper was turned down by several journals over five years. It appeared in the Journal of the Royal Statistical Society in 1995, just before genomics made it indispensable, and it is now among the most cited papers in statistics.
The procedure is as simple as Holm's. Sort the p-values. Find the largest i for which the i-th smallest p-value is below q times i over m: below a straight line through the origin with slope q over m. Reject everything up to that point, even hypotheses whose own p-values sit above the line. For independent tests, the false discovery rate is then at most pi zero times q.
The p-value sea of the genes, zoomed to the three hundred smallest p-values, sorted. The Benjamini–Hochberg line, at q of ten percent, rises with slope q over m. The sorted p-values stay below it up to rank one hundred and eighty-four, and above it after: BH rejects those one hundred and eighty-four. Coloured by the truth: most are real, with false ones scattered through the list, more of them towards the end.
Against Holm's fifty discoveries, BH at five percent makes a hundred and fifty-five, with six false; at ten percent, a hundred and eighty-four, with nineteen false, a false discovery proportion of ten point three percent. Three to four times as many real genes found, and a realized false share near q. This does not establish FDR control from one dataset.
There is a second way to see BH. Reject every p-value below a threshold t, and count the rejections. Since null p-values are uniform, the expected number of false rejections is m zero times t, at most m times t. So m t over the number of rejections is a plug-in estimate of the false share; it is not an upper confidence bound for this realized list. BH chooses the largest threshold for which that estimate is below q: at the i-th sorted p-value it is exactly m p over i. This is Storey's reading of the procedure, and the reason replacing m by an estimate of m zero gives chapter four's adaptive version.
The proof under independence is short. Write V over R as a sum over the true nulls of the indicator that each is rejected, divided by R. A null H i is rejected with exactly k rejections when its p-value is below q k over m and the procedure, run with p i replaced by zero, would also reject k. That second count depends only on the other p-values. So under independence it is independent of p i, which is uniform.
For one true null, condition on the count: the expected value is a sum over k of one over k, times the chance that p i is below q k over m, times the chance of the count. A uniform p-value is below q k over m with probability q k over m. The k's cancel, and the sum of probabilities is one: each true null contributes exactly q over m. Adding over the m zero true nulls, the false discovery rate is exactly pi zero times q. Not a bound: an equality, for independent continuous p-values.
What about dependence? Benjamini and Daniel Yekutieli proved in 2001 that BH still controls the false discovery rate under positive regression dependence on the true nulls. One-sided jointly Gaussian tests with suitable nonnegative correlations are an example; positive correlation alone is not a general certificate. For arbitrary dependence, dividing q by the harmonic sum restores the guarantee: the BY procedure. For five thousand tests that factor is about nine. In practice BH is remarkably robust to dependence, and BY is very conservative.
On the genes, whose pathways are correlated, at q of ten percent: BH makes a hundred and eighty-four discoveries, nineteen of them false. BY makes a hundred and twelve, two of them false. BY's guarantee holds whatever the dependence, and it costs about a third of the discoveries.
Numbers: BH 184 (19 false); BY 112
4Adaptive FDRMaster's3 min
Adaptive false discovery rates. With independent uniform null p-values, BH’s false discovery rate is pi zero times q. If half the hypotheses are false, it spends only half the error budget. If pi zero is known and q over pi zero is at most one, that rescaling gives FDR q. But pi zero is unknown, so John Storey proposed in 2002 to estimate it.
The idea is the flat floor of chapter one's histogram. When alternatives rarely produce p-values above a fixed lambda, such as a half, this region mostly reflects nulls. Uniform null p-values put a share one minus lambda of themselves there. So count the p-values above lambda and divide by m times one minus lambda. For a fixed lambda and uniform nulls, the uncapped estimator has expectation at least pi zero. Clipping it at one can bias it down. Plugging it into BH does not by itself give a finite-sample FDR guarantee.
On the genes, with lambda a half: the p-values above a half fill the grey bars, and their level gives pi zero hat of point nine six two, close to the true point nine five. Since that is so close to one, the adaptive procedure rejects the same hundred and eighty-four genes as BH. Adaptivity matters when many hypotheses are false.
Storey's q-value attaches a number to each gene: the smallest false discovery rate at which that gene would be called significant, pi zero hat times the BH adjusted p-value. It is an estimated list-level error threshold, not a known error probability for this gene. A p-value is about one test; a q-value is about a list. Reporting genes with q-values below ten percent, after Storey and Tibshirani's paper of 2003, became the standard of genomics.
Benjamini, Abba Krieger and Yekutieli gave an adaptive procedure with a finite-sample guarantee. First run BH at a slightly reduced level, q over one plus q. Estimate the number of true nulls as m minus the number of first-stage rejections. If the first stage rejects none, stop; if it rejects all, retain all. Otherwise run BH at the reduced level inflated by m over the estimated number of nulls. Under independence its false discovery rate is at most q, exactly, and it can improve power when many hypotheses are false. It need not contain every ordinary BH rejection.
Adaptive procedures help most when many hypotheses are false; with pi zero a half they roughly double the error budget actually used. Guarantees require a specified adaptive procedure and assumptions; independence alone does not validate every plug-in estimator. There are many estimators of pi zero: Storey's bootstrap choice of lambda, convex density fits, and Efron's central matching. Efron's approach goes further, from tail areas to densities: the next chapter.
Numbers: π̂0 = 0.962
5Empirical BayesMaster's4 min
Bradley Efron recast the problem as Part 25's empirical Bayes. Each test statistic, turned into a z-value, comes either from the null, with probability pi zero and density f zero, or from the alternative, with density f one. The null density is the standard normal. Then by Bayes's rule, the probability that a gene with this exact z-value is null is pi zero f zero over f: the local false discovery rate. The same ratio with tail areas is the tail-area false discovery rate, which BH estimates.
The point is that with thousands of genes, the mixture density f can be estimated directly from the data. With a specified null density, setting pi zero to one increases the numerator, but density estimation error still prevents a guaranteed bound. Their ratio estimates the local false discovery rate of each gene, and Efron's convention is to report genes whose local fdr is below point two.
Real data: Dinesh Singh and colleagues' prostate cancer microarray of 2002, six thousand and thirty-three genes measured on fifty healthy men and fifty-two with cancer. Each gene gets a two-sample t statistic, converted to a z-value through its distribution with a hundred degrees of freedom. These are Efron's running example in his book on large-scale inference. Ninety genes have z beyond three in size, where chance alone would give about sixteen.
The histogram of the six thousand z-values. In grey, what six thousand standard normals would give. The bulk matches closely, but both tails are heavier than the null curve: that excess is where the differentially expressed genes are.
To estimate f, Efron uses Lindsey's method: bin the z-values and treat each bin's count as Poisson. Model the log of its mean as a smooth function of the bin centre, here a polynomial of degree seven. The fitted means, rescaled, estimate the density. It is just a Poisson GLM from Part 24, on ninety counts, so we can check its convergence against an independent Poisson GLM fit. The polynomial describes the fitted finite histogram window, not an integrable density over the whole real line.
The estimated local false discovery rate, with the theoretical null. pi zero is estimated at point nine five four. In the middle, the fitted model assigns a high null probability; the curve falls away in both tails. Fifty-one genes have local fdr below point two.
Efron's most important observation is about the null itself. The standard normal is the right null only if every null test is exactly calibrated. In real studies, batch effects and unmeasured covariates can miscalibrate tests. Gene correlation can also shift or reshape one study’s histogram without invalidating its marginal null distributions. His remedy is the empirical null: assuming the central region is predominantly null and approximately Gaussian, fit its shift and width. These modeling assumptions need scrutiny. For the prostate data it is centred at zero but four percent wider than the standard normal.
The consequences. Bonferroni finds two genes. BH at ten percent finds fifty-nine. Local fdr below point two with the theoretical null finds fifty-one. With the empirical null, only twenty-seven. A null just four percent wider halves the list, which is Efron's point: in large-scale inference, the choice of null can materially change the reported list.
With thousands of parallel tests, the data can estimate their own null distribution. Under the two-groups model, local fdr estimates each gene’s posterior null probability, and the model’s tail-area null probability is the conditional average of its local fdr in that tail. This is related to, but distinct from, finite-family FDR. It is Part 25's idea of borrowing strength, applied to testing.
Numbers: σ0 = 1.041; 51 → 27 genes
6FDR is an averageMaster's4 min
A simulation: a thousand one-sided tests, nine hundred true nulls and a hundred real effects of size two and a half. First with independent tests. Then with every pair of tests correlated one half, through one shared factor, like a batch effect that shifts every measurement in a study together. BH at ten percent, two thousand studies each way, recording the false discovery proportion of each study.
With independent tests the false discovery proportions cluster tightly around the promised average, point oh nine. With correlated tests the average is even lower, point oh six, comfortably within the promise. But look at the shape: a spike at zero, from studies where the shared factor pushed everything down and few or no discoveries were made, and a long tail of studies where it pushed everything up and a third or more of the discoveries were false.
In numbers. The averages are point oh nine and point oh six. But the chance that a study's list is more than twenty percent false, twice the promise, is under one percent with independence and nine percent with correlation. One correlated study in five makes no discoveries at all, and the number of discoveries has a standard deviation of eighty-seven, against eight. Same procedure, same average promise, very different guarantees for the one study you actually ran.
Why? When the shared factor is large, every z-value is pushed up and many nulls cross the line together. When it is small, everything is pushed down and even the real effects are missed. The false discovery rate averages over the shared factor, so its promise survives. But the average hides a mixture of very good and very bad studies, as Efron emphasized in 2007. A central-null fit may estimate the shared shift under additional assumptions; it does not automatically control this study’s realized false share.
Seen from inside one study, given the shared factor, each null z-value is normal with mean root rho times W and variance one minus rho. So the histogram of the nulls in this study is shifted by the batch and narrower than the standard normal. The conditional null differs from the marginal standard normal. The original tests remain marginally valid, which is the conditioning used by the FDR theorem. The empirical null of chapter five estimates the shift and the width from the middle of this study's own histogram, under a central-null model. Correlation alone does not guarantee this fit repairs conditional error rates.
On the Board, as error rates, with a thousand independent simulated studies each. Monte Carlo uncertainty uses the variability of study-level false proportions, not a binomial approximation. No correction, every p below ten percent: a false discovery rate of fifty percent, broken. BH with independent tests: conservative relative to the nominal ten percent, at point oh nine. With correlated tests: conservative, point oh six five. BY: very conservative, one percent. The Board judges averages; the histograms remind us what an average hides.
If you care about your own study rather than the average, control the false discovery proportion directly: the probability that it exceeds some gamma at most alpha. Erich Lehmann and Joseph Romano, and Christopher Genovese and Larry Wasserman, built such procedures. Jelle Goeman and Aldo Solari went further, with confidence bounds on the false discovery proportion of every possible list at once, so the list can be chosen after looking. Stronger promises cost discoveries, as always.
Numbers: P(FDP > 0.2) 0.9% vs 9.2%
7KnockoffsPhD5 min
Testing variables in a regression is harder. We ask whether each variable matters given all the others. The lasso selects variables but promises nothing about errors. Valid p-values for each variable are hard to get after selection, and impossible by classical means when p exceeds n. Rina Foygel Barber and Emmanuel Candès found a way, in 2015, to control the false discovery rate of a selection made by almost any method: knockoffs.
Construct a fake copy of every variable, a knockoff, with two properties. Swapping any set of variables with their knockoffs leaves the joint distribution of all of them unchanged: each knockoff relates to the other variables exactly as its original does. And the knockoffs are made without looking at the outcome, so they are independent of it given the real variables. Each knockoff is a perfect matched control: it looks like its original in every way, but is certainly null.
When the variables are multivariate normal with a known covariance, the model-X knockoffs of Candès, Yingying Fan, Lucas Janson and Jinchi Lv have a closed form: draw each knockoff row from a normal whose mean and covariance are set by sigma and a diagonal matrix D. The simplest choice makes D a multiple of the identity, as large as positive definiteness allows. The larger D, the less each knockoff resembles its original, and the easier it is to tell a real variable from its fake.
The original knockoffs of 2015 were fixed-X: constructed from the observed design so that the knockoffs have the same correlations among themselves as the originals, and with the originals except on the diagonal. That version needs at least twice as many observations as variables and a linear model with Gaussian errors. Model-X knockoffs instead treat the rows of X as random with a known distribution, and allow any relationship between y and X. In practice the distribution of X is estimated, and often only its means and covariances are matched, an approximation whose robustness is an active research question.
Now fit any model to the real variables and their knockoffs together, for example a lasso on two p columns. For each variable, W j is the size of its coefficient minus the size of its knockoff's. A large positive W means the real variable clearly beat its fake. Any statistic works, provided the statistic obeys the joint flip-sign property: swapping a subset flips exactly those W signs and leaves the others unchanged.
The proof is a coin flip. For a null variable, swapping it with its knockoff changes nothing about the data's distribution but flips the sign of W. Conditional on all magnitudes and nonnull statistics, the nonzero null signs are independent fair coins. Hence the number of nulls with W above t is mirrored by the number of W's below minus t. That count, plus one, over the number selected, estimates the false discovery proportion. Choose the smallest nonzero observed absolute W where the estimate is below q, or select none if there is no such threshold, and the false discovery rate is at most q, exactly, in finite samples, with no p-values, for any n and p.
A simulated regression: four hundred observations, a hundred and fifty correlated variables, twenty real effects. The sixty largest W statistics, in order of size. Real variables in green stand tall above zero. Null variables come in both signs, as the coin-flip argument says. The knockoff+ threshold at ten percent selects twenty-three variables, three of them false.
Over twenty simulated regressions: the cross-validated lasso finds every real variable, but sixty-two percent of what it selects is false, Part 32's lesson again. The estimated knockoff FDR is eight point two percent, with a one point seven percentage-point Monte Carlo standard error across only twenty studies and still find ninety-seven percent of the real variables.
The striking feature of model-X knockoffs is where the assumption sits: on the distribution of the variables, not on how the outcome depends on them. Any outcome model, any machine-learning method, can produce the W's. In genetics, where genotypes along a chromosome are modeled by fitted hidden Markov models, this has been used at genome scale. The price is that the distribution of X must be right. A different exchangeability assumption, across observations, powers conformal prediction, in Part 34.
Numbers: FDR 8.2%, power 97% vs lasso 62%
8The garden of forking pathsBachelor's4 min
In 2011 the psychologists Joseph Simmons, Leif Nelson and Uri Simonsohn published a paper called False-Positive Psychology. In a real experiment, students listened either to the Beatles' When I'm Sixty-Four or to a control song. Afterwards, those who heard the Beatles were, by their reported birth dates, a year and a half younger, with a p-value of point oh four. An impossible result, constructed deliberately as a demonstration, by a handful of entirely common choices in the analysis, each reported as though it had been planned.
Every analysis involves choices: which outcome to report, which covariates to adjust for, which observations to exclude, which subgroups to examine, when to stop collecting data. When those choices are made after seeing the data, each can be perfectly reasonable on its own. But the effective number of tests is far larger than the one reported. Andrew Gelman and Eric Loken called this the garden of forking paths, to stress that it needs no deliberate fishing: a single analysis, chosen in light of the data, has the same problem.
One fork is when to stop. A study with no effect at all, tested after every ten subjects per group. The rule: stop as soon as p is below five percent. This selected illustrative trajectory first crosses the threshold at the highlighted look. The reported nineteen percent rate uses all four thousand simulated studies. With ten looks, the chance of ever succeeding is nineteen percent, almost four times the nominal five. Part 58 builds tests that can be checked at every look, honestly.
This part's build is a simulator of Simmons, Nelson and Simonsohn's four flexibilities, with no true effect anywhere. A: two correlated outcome measures, reporting either one or their average. B: twenty subjects per group, and ten more if the first look fails. C: adjusting for gender, or its interaction with the condition, or not. D: three conditions, reporting any two or the linear trend.
Five thousand simulated studies with no effect. Gold bars from our simulator, white marks from the 2011 paper's table; they are broadly similar; the combined A, B and C strategy differs by about two and a half Monte Carlo standard errors. This is an illustrative simulator, not a bit-for-bit reproduction. Each flexibility alone roughly doubles the false-positive rate, to between eight and thirteen percent. All four together give sixty-one percent. A researcher with these four ordinary freedoms will find a significant result in a null world more often than not.
Remedies follow from the diagnosis. Simmons and colleagues proposed simple rules: decide when to stop in advance, report every measure and condition, and show results with and without covariates and exclusions. A multiverse analysis runs every reasonable path and shows them all. And when twenty-nine teams were given the same data and the same question, whether football referees give more red cards to dark-skinned players, their odds ratios ranged from point nine to two point nine. Or fix the path before seeing the data, as chapter eleven discusses.
Numbers: 61.3% false positives
9ReplicationBachelor's4 min
In 2005 the physician and epidemiologist John Ioannidis published an essay with a provocative title: Why Most Published Research Findings Are False. It was a calculation, not a measurement. It became an influential discussion of how prior plausibility and power affect positive findings. Its logic is Bayes's rule, Part 15, applied to the stream of hypotheses a field tests.
Let R be the pre-study odds that an effect a field tests is real. Real effects come out significant with probability equal to the power, one minus beta; null effects with probability alpha. So the share of significant findings that are real, the positive predictive value, is power times R over power times R plus alpha: the same formula as a medical screening test in Part 3. Ioannidis added bias: a share u of analyses that should have been negative are turned positive by the forking paths of chapter eight.
Some cases. A confirmatory trial of a plausible treatment, with even odds, good power and no bias: ninety-four percent of positive results are true. A well-powered field with a quarter of tested effects real and some bias: about two thirds. An exploratory, underpowered field: one in seven. Uncorrected discovery among thousands of candidates: under two percent. Low priors and low power make most positive findings false, with no misconduct at all.
How low is power in practice? Katherine Button and colleagues estimated the median statistical power of studies in neuroscience meta-analyses at about twenty-one percent. For a two-sided Gaussian test near twenty percent power, selected absolute estimates can average more than twice the true effect: a type M error. When power is very low, a significant estimate can even have the wrong sign, a type S error. A central remedy is larger, well-designed studies, planned with Part 10's power analysis for the effect one realistically expects.
Then it was measured. The Open Science Collaboration, two hundred and seventy researchers, re-ran a hundred studies from three leading psychology journals of 2008, with larger samples, preregistered plans and the original materials. Ninety-seven of the originals had been significant; thirty-six percent of the replications were. The average effect size halved, from a correlation of point four to point two. Fewer than half of the original effect sizes fell inside the replication's ninety-five percent interval.
Other fields followed. Colin Camerer and colleagues replicated twenty-one social-science experiments published in Nature and Science between 2010 and 2015; thirteen replicated, with effects about half their original size. In experimental economics, eleven of eighteen. Strikingly, prediction markets among researchers forecast which studies would replicate rather well: researchers’ forecasts contained useful predictive information. In preclinical cancer biology, the median replication effect across fifty experiments was eighty-five percent smaller.
How to read this. A single failed replication does not prove the original false; both are noisy. But effect sizes that shrink on replication are exactly what selection predicts: Part 32's winner's curse. Andrew Gelman and John Carlin call it a type M error, an error of magnitude: when power is low, the significant estimates are the exaggerated ones. The cures lie in design and reporting, the subject of the next two chapters.
Numbers: PPV 94% … 1.5%; OSC 36%
10Publication biasPractice4 min
Robert Rosenthal named it in 1979: the file-drawer problem. Studies with significant results are published; studies without them stay in the file drawer. A meta-analysis of the published record then partly measures the filter rather than the effect. Part 25's careful pooling, fed a biased sample.
A simulated literature: eight hundred studies of an effect whose true size is point two, with sample sizes from ten to two hundred per group, so standard errors from point one to point four five. The funnel plot shows each study's estimate against its standard error, precise studies at the top. Every study significant in the positive direction is published, along with one in ten of all others. The two hundred and seventy-eight published studies, in gold. The red line marks p equal to point oh five: small, imprecise studies are preferentially published to its right, with large estimates; ten percent of the other studies are still published. The funnel is hollowed out on the left at the bottom.
The consequences. Pooling all eight hundred studies recovers point one nine four, close to the truth. Pooling only the published ones gives point three oh one, half as large again. Matthias Egger's regression test of 1997 detects the asymmetry: regress each study's z statistic on its precision; in this common-effect simulation without selection the intercept is zero. Heterogeneity and other small-study effects can also cause asymmetry. For the published studies it is one, with a p-value of ten to the minus five. And the slope of that regression, the PET estimate, extrapolates to a perfectly precise study: point one seven six, closer to the truth here. This extrapolation depends on the regression model and does not generally remove publication bias.
A different diagnostic uses only the significant results, which is all the published record may contain: the p-curve of Simonsohn, Nelson and Simmons. If there is no effect, significant p-values are uniform between zero and point oh five: the curve is flat. If the effect is real, very small p-values are more common: the curve is skewed to the right. Some forms of p-hacking can produce excess mass near the threshold; neither a bump nor right skew uniquely identifies the mechanism.
Exact p-curves under two-sided z-tests with known variance and thirty subjects per group. No effect: twenty percent of significant p-values in each bin of width point oh one. A modest effect, with only twenty-one percent power: already thirty-seven percent of significant results fall below point oh one. A large effect: seventy-two percent. A literature whose significant p-values pile up near point oh five, rather than near zero, deserves suspicion.
The most principled corrections model the filter directly: the probability that a study is published, as a function of its p-value, estimated jointly with the effect. Larry Hedges proposed this in 1984; Isaiah Andrews and Maximilian Kasy recently showed how to identify the filter from replications. Trim-and-fill imputes the missing studies to make the funnel symmetric. None of these fully repairs a filtered record. The real cure is to make the record complete: register every study before it is run.
Numbers: 0.301 vs 0.2; Egger p ≈ 10⁻⁵
11Remedies arguedPractice4 min
The first remedy is preregistration: write down the hypotheses, outcomes, sample size and analysis plan before collecting the data. Since 2005, ICMJE journals have required prospective registration for trial publication; legal requirements depend on jurisdiction and trial type. Robert Kaplan and Veronica Irvin found that among large trials funded by the US heart, lung and blood institute, the share reporting a benefit on the primary outcome fell from fifty-seven percent before registration became mandatory in 2000 to eight percent after. That before-and-after comparison does not isolate a causal effect of registration. A detailed, adhered-to plan limits undisclosed flexibility; exploratory analysis remains allowed, as long as it is labelled as such.
Registered reports, championed by Chris Chambers from 2013, go further: the study is peer reviewed on its question and methods before any results exist, and the journal gives in-principle acceptance conditional on an approved protocol and other stated publication requirements. Anne Scheel and colleagues found that forty-four percent of registered reports in psychology supported their first hypothesis, against ninety-six percent of comparable standard papers. Acceptance based on the question and protocol reduces results-dependent publication, although attrition and reporting still matter.
In 2018 seventy-two researchers, led by Daniel Benjamin, proposed redefining statistical significance: call p below point oh oh five significant, and between that and point oh five merely suggestive. Their argument: a p-value of point oh five corresponds at best to a Bayes factor of about two and a half to three and a half, weak evidence, under the calibration classes and assumptions discussed in Part 26; a p-value alone does not determine a Bayes factor. A stricter line raises the positive predictive value. Eighty-eight others, led by Daniël Lakens, replied: justify your alpha instead. A new line needs larger samples, keeps the false dichotomy, and invites hacking just below it.
Other proposals replace the p-value's role. Bayes factors grade the evidence for both hypotheses, as in Part 26. Estimation-based reporting, Geoff Cumming's new statistics, puts effect sizes and their intervals first, and plans studies for precision rather than significance. Equivalence tests can show that an effect is too small to matter, something a non-significant p-value cannot. But every one of these needs the same honesty about the forking paths: no statistic is immune to selective reporting.
Others want no line at all. Blakeley McShane, Andrew Gelman and colleagues argued in 2019 for abandoning statistical significance, and Valentin Amrhein, Sander Greenland and McShane's comment in Nature gathered eight hundred signatures. Report estimates with intervals, treat the p-value as one continuous measure among others, and draw no bright lines. Critics answer that many decisions are binary whatever we call them, and that a threshold fixed in advance disciplines the hopeful. The debate is not settled.
The American Statistical Association weighed in, for the first time in its history, with a statement on p-values in 2016, already met in Part 10. Among selected principles: a p-value is not the probability that the hypothesis is true; conclusions should not rest only on whether it passes a threshold; proper inference requires full reporting; the p-value does not measure the size of an effect; and by itself it is not a good measure of evidence.
This course's position, for what it is worth. Count your questions, including the analyses you tried and did not report. Control an error rate that matches the use: family-wise to confirm, false discovery to discover. Report estimates with honest intervals, and register what you can. And for evidence that stays valid however often you look, Part 58 builds e-values.
Numbers: 57% → 8%; 44% vs 96%
12The false coverage rateMaster's3 min
After the discoveries come the estimates. Select the genes BH calls discoveries, and report a ninety percent interval for the effect of each. Each interval would be right for a gene chosen in advance. But these genes were chosen because their estimates were large, so they are biased away from zero and the intervals cover less often than promised.
Benjamini and Yekutieli defined the false coverage rate in 2005: the expected share of the reported intervals that miss their parameter. Their remedy is to widen each selected interval, building it at level one minus R alpha over m, where R is the number selected. That controls the false coverage rate at alpha for simple selection rules such as this BH rule, with independent estimates and valid marginal intervals. Arbitrary selection requires a different, minimum-selection-count adjustment. If everything is selected, no adjustment; if one thing is, Bonferroni's.
Why R alpha over m? The proof needs the simple-selection property, not independence alone. Split the expected share of non-covering intervals by parameter and by the number selected. For each parameter, the chance that it is selected with k selections and its interval misses is at most the interval's miss rate, k alpha over m, times the chance of k selections computed without it, by independence and a count fixed by the other coordinates while this parameter remains selected. The k's cancel and each parameter contributes at most alpha over m, giving an overall bound of alpha.
A simulation: a thousand effects, a hundred of them real, one estimate each. BH at ten percent selects about forty-one per study. Unadjusted ninety percent intervals for the selected effects give a study-averaged covered fraction of about seventy-nine percent. The FCR-adjusted intervals use a multiplier of two point eight eight instead of one point six four, three quarters wider, and give a study-averaged covered fraction of ninety-one percent. Empty reported families have noncoverage zero; the Board displays one minus FCR, not pooled interval coverage.
On the Board: unadjusted intervals for selected effects, broken; FCR-adjusted intervals, slightly conservative. These rows average each study’s covered share; their uncertainty is calculated across studies.
FCR intervals are honest but wide, and still centred on the biased estimates. Empirical Bayes shrinkage, through Tweedie's formula from Part 25, corrects the selection bias of the estimates themselves, as Efron showed in 2011. And intervals that condition on the selection event, from William Fithian, Dennis Sun and Jonathan Taylor, can be exact under their specified sampling and selection models. Part 56 develops inference after selection in full.
Numbers: 78.7% vs 90.7%
Recap, problems, and the road aheadAll tracks3 min
Part thirty-three in twelve lines. A dead salmon responded to photographs because thousands of voxels were tested without correction. In the World's five thousand genes, half the uncorrected list was noise. Bonferroni, Holm, closed testing and Westfall and Young control the chance of any false discovery, and find a fifth of the real genes. Benjamini and Hochberg control the share of false discoveries instead, and find three times as many. Storey estimates the share of nulls; Efron estimates the null itself, and the local false discovery rate of each gene. The false discovery rate is only an average, and dependence spreads the proportion widely. With valid knockoffs and flip-sign statistics, knockoff+ controls FDR by a coin-flip argument. Forking paths turn a five percent error rate into sixty-one. Replication rates near a third and effects halved are what selection predicts. Funnels, Egger’s test and p-curves can diagnose patterns consistent with selection; they do not uniquely identify publication bias. And intervals for selected effects must be widened to keep their promise.
A promise for later. This part controlled the error rates of lists: family-wise, false discovery and false coverage. It assumed that the family of hypotheses and the selection rule were fixed before the data arrived. Part 56 drops that: inference when the questions themselves are chosen by looking at the data.
Where it comes back. Part 34's conformal prediction rests on the exchangeability that made knockoffs work. Part 35 handles many outcomes in one trial. Part 41 meets multiplicity in imputation. Part 46 extends Neyman and Pearson to many hypotheses. Part 50 asks when sparse signals can be detected at all, with higher criticism. Part 56 develops selective inference. Part 58's e-values control the false discovery rate at any stopping time. And Part 62 tests thousands of causal hypotheses at once.
Six problems, with full solutions in the README. Holm under any dependence; BH's exact false discovery rate; the Benjamini–Yekutieli bound; Storey's conservative estimate; the knockoff coin flip; and Ioannidis's formula. Pause here if you want to try them.
The books this part follows: Efron's Large-Scale Inference; Westfall and Young on resampling-based multiple testing; Dudoit and van der Laan for genomics; and the Introduction to Meta-Analysis; with the papers from Holm to the Open Science Collaboration.
Thirty-three parts of sixty-five. We can ask thousands of questions and still say how many of our answers are likely wrong. Knockoffs controlled errors without trusting any model for the outcome, using valid model-X knockoffs and the flip-sign property. Part 34 asks how far that goes: can a black-box predictor, a forest or a neural network, come with honest uncertainty? Prediction with guarantees.
Where it goes next. Exchangeability returns as conformal prediction in Part 34; many outcomes in one trial in Part 35; optimal multiple testing in Part 46; higher criticism in Part 50; selective inference and PoSI in Part 56; e-values and FDR at any stopping time in Part 58.
Key results
The part's results in one place, for revision.
Try it
Lab 33 · The false discovery rate is pi0 times q, on average
Simulate 1,000 studies of 1,000 one-sided tests (900 nulls, 100 effects of 2.5) and apply Benjamini-Hochberg at q = 0.1: check that the mean false discovery proportion is pi0 q when the tests are independent, and see how one shared factor spreads the proportion without raising its mean.
python -m videos.stats.labs 33
needs numpy, scipy, matplotlib · download lab33.py ·
source on GitHubno correction (each p < 0.1): mean FDP 0.502 (expected about 0.503)
BH, independent: mean FDP 0.091 (theory = 0.090)
BH, independent: P(FDP > 0.2), P(no discoveries) 0.9%, 0.0%
BH, independent: discoveries, mean and SD 53, 8
BH, correlated 0.5: mean FDP 0.076 (theory <= 0.090)
BH, correlated 0.5: P(FDP > 0.2), P(no discoveries) 11.6%, 20.0%
BH, correlated 0.5: discoveries, mean and SD 68, 115
BH holds the average share of false discoveries at pi0 q = 0.09. Under a shared factor the average is lower still, but one study in ten has more than 20% false discoveries and one in five finds nothing.
The code (78 lines; it asserts its own result)
"""Lab 33: run Benjamini-Hochberg on a thousand studies, and see that the rate it controls is an average."""
import numpy as np
from scipy import stats
from videos.coursekit import labs
from explainer.stats.kit import multiple
TITLE = "The false discovery rate is pi0 times q, on average"
GOAL = ("Simulate 1,000 studies of 1,000 one-sided tests (900 nulls, 100 effects of 2.5) and apply Benjamini-Hochberg "
"at q = 0.1: check that the mean false discovery proportion is pi0 q when the tests are independent, and see "
"how one shared factor spreads the proportion without raising its mean.")
TASKS = [
"Call fdp_sim with method='by'. How much power does protection against arbitrary dependence cost here?",
"Estimate pi0 with multiple.storey_pi0 and run BH at q / pi0-hat. Does the FDR rise from 0.09 to 0.10?",
"Lower the effect from 2.5 to 1.5. What happens to the power, and to the chance that a study's FDP exceeds 0.2?",
]
M, PI0, EFFECT, Q = 1000, 0.9, 2.5, 0.1
def run(seed=0):
rng = np.random.default_rng(seed)
reps = 1000
lab = labs.Lab()
m0 = int(PI0 * M)
# no correction: call every p < q a discovery
V, R = [], []
for _ in range(reps):
z = rng.standard_normal(M)
z[m0:] += EFFECT
hit = stats.norm.sf(z) < Q
V.append(hit[:m0].sum())
R.append(hit.sum())
fdr_raw = float(np.mean(np.array(V) / np.maximum(R, 1)))
ev, es = m0 * Q, (M - m0) * stats.norm.sf(stats.norm.isf(Q) - EFFECT)
lab.row("no correction (each p < 0.1): mean FDP", f"{fdr_raw:.3f} (expected about {ev / (ev + es):.3f})")
ind = multiple.fdp_sim(M, PI0, EFFECT, 0.0, Q, reps, rng)
dep = multiple.fdp_sim(M, PI0, EFFECT, 0.5, Q, reps, rng)
for name, r in (("independent", ind), ("correlated 0.5", dep)):
lab.row(f"BH, {name}: mean FDP", f"{r['fdr']:.3f} (theory {'= ' if r is ind else '<= '}{PI0 * Q:.3f})")
lab.row(f"BH, {name}: P(FDP > 0.2), P(no discoveries)", f"{r['p_fdp_gt_2q']:.1%}, {r['p_zero']:.1%}")
lab.row(f"BH, {name}: discoveries, mean and SD", f"{r['R'].mean():.0f}, {r['R'].std():.0f}")
se = ind["fdp"].std(ddof=1) / np.sqrt(reps)
assert abs(fdr_raw - ev / (ev + es)) < 0.02 and fdr_raw > 0.4, "uncorrected, half the discoveries are false"
assert abs(ind["fdr"] - PI0 * Q) < 4 * se, "BH's FDR is pi0 q under independence"
assert dep["fdr"] < PI0 * Q + 0.01, "positive dependence does not break the bound"
assert ind["p_fdp_gt_2q"] < 0.03 < 0.05 < dep["p_fdp_gt_2q"], "but one study's FDP can be far from the average"
assert dep["R"].std() > 4 * ind["R"].std() and dep["p_zero"] > 0.1
lab.note = ("BH holds the average share of false discoveries at pi0 q = 0.09. Under a shared factor the average is "
"lower still, but one study in ten has more than 20% false discoveries and one in five finds nothing.")
fig, ax = labs.figure(2, size=(11, 4.2))
z = rng.standard_normal(M)
z[m0:] += EFFECT
p = stats.norm.sf(z)
o = np.argsort(p)
k = multiple.bh(p, Q)["k"]
show = 160
rank = np.arange(1, show + 1)
null = o[:show] < m0
ax[0].plot(rank[~null], p[o[:show]][~null], ".", color=labs.BLUE, label="real effects")
ax[0].plot(rank[null], p[o[:show]][null], ".", color=labs.RED, label="true nulls")
ax[0].plot(rank, Q * rank / M, color=labs.GOLD, label="the BH line q i / m")
ax[0].axvline(k, color=labs.MUTED, ls="--", label=f"last p-value under the line: {k} discoveries")
ax[0].set(title="One study: the 160 smallest of 1,000 p-values", xlabel="rank i", ylabel="p-value")
ax[0].legend(loc="upper left")
bins = np.linspace(0, 1, 41)
ax[1].hist(ind["fdp"], bins=bins, color=labs.BLUE, alpha=0.7, label=f"independent (mean {ind['fdr']:.3f})")
ax[1].hist(dep["fdp"], bins=bins, color=labs.ORANGE, alpha=0.6, label=f"correlated 0.5 (mean {dep['fdr']:.3f})")
ax[1].axvline(PI0 * Q, color=labs.GOLD, ls="--", label="pi0 q = 0.09")
ax[1].set(title="The false discovery proportion in 1,000 studies", xlabel="FDP of one study", ylabel="studies",
yscale="log")
ax[1].legend()
lab.fig = fig
return lab
Now change it
- Call fdp_sim with method='by'. How much power does protection against arbitrary dependence cost here?
- Estimate pi0 with multiple.storey_pi0 and run BH at q / pi0-hat. Does the FDR rise from 0.09 to 0.10?
- Lower the effect from 2.5 to 1.5. What happens to the power, and to the chance that a study's FDP exceeds 0.2?
Problems, with solutions
Try each problem before opening its solution.
1. Holm controls the FWER under any dependence. Show that Holm's procedure controls the FWER at \(\alpha\) under any dependence.
Solution
Let I₀ be the true nulls, m₀ = |I₀|, and let j be the true null with the smallest p-value. A false rejection requires Holm to reach and reject j. When it does, at most m − m₀ hypotheses have been rejected before it, so j's step has threshold α/(m − k + 1) ≤ α/m₀. Hence a false rejection implies min_{i∈I₀} p_i ≤ α/m₀, and by the union bound P(min_{i∈I₀} p_i ≤ α/m₀) ≤ m₀·α/m₀ = α.
2. BH's exact FDR. Prove that BH's FDR equals \(\pi_0 q\) for independent, continuous, uniform null \(p\)-values.
Solution
With R⁽ⁱ⁾ the number BH rejects when p_i is set to 0, the events {i rejected, R = k} and {p_i ≤ qk/m, R⁽ⁱ⁾ = k} coincide. Then E[1{i rej}/R] = Σ_k (1/k)P(p_i ≤ qk/m)P(R⁽ⁱ⁾ = k) by independence. This is Σ_k (1/k)(qk/m)P(R⁽ⁱ⁾ = k) = q/m. Summing over the m₀ true nulls gives FDR = m₀q/m = π₀q.
3. The BY bound. Show that BH at level \(q/\sum_{i=1}^m 1/i\) controls the FDR under arbitrary dependence (bound \(\mathbf 1\{p \le qk/m\}/k\)).
Solution
Let c = Σ_{j≤m} 1/j and Δ = q/(mc), and let i be a true null rejected with R = k. Then p_i ≤ kΔ, so p_i ∈ ((j − 1)Δ, jΔ] for some j ≤ k, and then 1/R = 1/k ≤ 1/j. Hence 1{i rejected}/R ≤ Σ_{j=1}^m (1/j)·1{p_i ∈ ((j − 1)Δ, jΔ]}, whatever the dependence. For exactly uniform nulls, taking expectations, the contribution is at most Σ_j (1/j)Δ = cΔ = q/m. Summing over m₀ ≤ m nulls gives FDR ≤ q. For super-uniform nulls, use summation by parts with the nonincreasing step weight and P(p_i≤jΔ)≤jΔ; individual bin probabilities need not be bounded by Δ.
4. Storey’s uncapped estimate at a fixed λ has conservative expectation. Show that Storey's uncapped \(\hat\pi_0(\lambda)\) at fixed \(\lambda\) has expectation \(\ge \pi_0\).
Solution
E#{p_i > λ} ≥ E#{null p_i > λ} = m₀(1 − λ), because null p-values are uniform. So E π̂₀(λ) = E#{p_i > λ}/(m(1 − λ)) ≥ m₀/m = π₀. This refers to the uncapped estimator. Clipping at one can bias it downward (under an all-null uniform model, its expectation is strictly below one). An upward mean alone does not prove finite-sample FDR control for a plug-in adaptive procedure.
5. The knockoff coin flip. For a null \(j\), show \(\mathrm{sign}(W_j)\) is a fair coin independent of \(|W_j|\) for knockoffs.
Solution
Swapping a null variable j with its knockoff leaves the joint law of (X, X̃, y) unchanged: it leaves that of (X, X̃) unchanged by exchangeability, and y depends on X only through non-null variables, given which X̃ is irrelevant. But the swap maps W_j to −W_j and leaves |W_j| and the other W's unchanged. So (W_j, |W|) and (−W_j, |W|) have the same law: conditional on all magnitudes and nonnull statistics, the nonzero null signs are independent fair coins. Zero W values are excluded. The joint flip-sign property is essential. The knockoff+ threshold then gives FDR ≤ q by a supermartingale (optional stopping) argument over the ordered |W|.
6. Ioannidis's formula. Derive Ioannidis's PPV with bias \(u\), and find the prior below which \(\mathrm{PPV} < 1/2\) for power 0.8.
Solution
Per unit of null studies there are R real ones. True positives come from real effects significant by power, (1 − β)R, plus a share u of the real-but-missed ones, uβR. False positives come from nulls, α, plus a share u of the null negatives, u(1 − α). So PPV = [(1 − β)R + uβR]/[(1 − β)R + uβR + α + u(1 − α)], which is the formula in the code. With u = 0, PPV = (1 − β)R/((1 − β)R + α), and PPV < ½ iff R < α/(1 − β). For power 0.8 that is R < 0.0625, a prior below 0.0625/1.0625 ≈ 5.9%.
Notes and sources
Where it comes back
| Idea | Returns in |
|---|---|
| exchangeability and conformal prediction | 34 |
| many outcomes in one trial | 35 |
| multiplicity in imputation | 41 |
| testing many hypotheses optimally | 46 |
| sparse-signal detection; higher criticism | 50 |
| selective inference and PoSI | 56 |
| e-values: FDR at any stopping time | 58 |
| genome-scale causal discovery | 62 |
| the Coverage Board | every part; 65 |
Glossary
- Multiplicity; family; V, S, R; FWER; FDR; FDP; per-comparison error rate: the bookkeeping of many tests.
- Bonferroni; Šidák; Holm; closed testing; Simes; Hochberg; Westfall–Young maxT: family-wise procedures.
- Benjamini–Hochberg; PRDS; Benjamini–Yekutieli: false discovery rate procedures.
- π₀; Storey's estimator; q-value; two-stage BH: adaptive FDR.
- Two-groups model; local fdr; Fdr; Lindsey's method; theoretical and empirical null; central matching: Efron's empirical Bayes.
- FDX; simultaneous FDP bounds: controlling one study's proportion.
- Knockoffs (fixed-X, model-X); exchangeability; W statistic; knockoff+: selection with FDR control.
- Researcher degrees of freedom; garden of forking paths; p-hacking; optional stopping; multiverse: hidden multiplicity.
- PPV; power; type M and type S errors; replication: what a literature's positives mean.
- File drawer; funnel plot; Egger's test; PET; p-curve; selection model; trim-and-fill: publication bias.
- Preregistration; registered report; α = 0.005; equivalence test: remedies.
- False coverage rate; FCR-adjusted interval: intervals after selection.
Sources
- Imaging.
- C. Bennett, A. Baird, M. Miller & G. Wolford, J. Serendipitous Unexpected Results 1 (2010); poster at OHBM (2009).
- FWER.
- C. Bonferroni (1936); O. J. Dunn, JASA 56 (1961); Z. Šidák, JASA 62 (1967); S. Holm, Scand. J. Stat. 6 (1979).
- R. Marcus, E. Peritz & K. Gabriel, Biometrika 63 (1976); R. Simes, Biometrika 73 (1986); Y. Hochberg, Biometrika 75 (1988).
- P. Westfall & S. Young, Resampling-Based Multiple Testing (1993).
- FDR.
- Y. Benjamini & Y. Hochberg, JRSS B 57 (1995); Y. Benjamini & D. Yekutieli, Ann. Stat. 29 (2001).
- J. Storey, JRSS B 64 (2002), Ann. Stat. 31 (2003); J. Storey & R. Tibshirani, PNAS 100 (2003).
- Y. Benjamini, A. Krieger & D. Yekutieli, Biometrika 93 (2006).
- E. Lehmann & J. Romano, Ann. Stat. 33 (2005); C. Genovese & L. Wasserman, JASA 101 (2006); J. Goeman & A. Solari, Stat. Sci. 26 (2011).
- Empirical Bayes.
- B. Efron, JASA 99 (2004), 102 (2007), 106 (2011); B. Efron, R. Tibshirani, J. Storey & V. Tusher, JASA 96 (2001).
- D. Singh et al., Cancer Cell 1 (2002); J. Lindsey (1974).
- Knockoffs.
- R. F. Barber & E. Candès, Ann. Stat. 43 (2015); E. Candès, Y. Fan, L. Janson & J. Lv, JRSS B 80 (2018).
- M. Sesia, C. Sabatti & E. Candès, Biometrika 106 (2019).
- Research practice.
- J. Simmons, L. Nelson & U. Simonsohn, Psych. Sci. 22 (2011); A. Gelman & E. Loken, Amer. Sci. 102 (2014).
- S. Steegen et al., Persp. Psych. Sci. 11 (2016); R. Silberzahn et al., AMPPS 1 (2018).
- J. Ioannidis, PLoS Med. 2 (2005); K. Button et al., Nat. Rev. Neurosci. 14 (2013); A. Gelman & J. Carlin, Persp. Psych. Sci. 9 (2014).
- Open Science Collaboration, Science 349 (2015); C. Camerer et al., Science 351 (2016), Nat. Hum. Behav. 2 (2018); T. Errington et al., eLife 10 (2021).
- R. Rosenthal, Psych. Bull. 86 (1979); M. Egger, G. Davey Smith, M. Schneider & C. Minder, BMJ 315 (1997).
- T. Stanley & H. Doucouliagos, Res. Synth. Methods 5 (2014); U. Simonsohn, L. Nelson & J. Simmons, J. Exp. Psych. Gen. 143 (2014).
- L. Hedges, J. Educ. Stat. 9 (1984); I. Andrews & M. Kasy, AER 109 (2019); S. Duval & R. Tweedie, Biometrics 56 (2000).
- R. Kaplan & V. Irvin, PLoS One 10 (2015); C. Chambers, Cortex 49 (2013); A. Scheel, M. Schijen & D. Lakens, AMPPS 4 (2021).
- D. Benjamin et al., Nat. Hum. Behav. 2 (2018); D. Lakens et al., Nat. Hum. Behav. 2 (2018).
- B. McShane et al., Amer. Stat. 73 (2019); V. Amrhein, S. Greenland & B. McShane, Nature 567 (2019); R. Wasserstein & N. Lazar, Amer. Stat. 70 (2016).
- FCR. Y. Benjamini & D. Yekutieli, JASA 100 (2005); W. Fithian, D. Sun & J. Taylor, arXiv (2014).
- Books.
- B. Efron, Large-Scale Inference (2010).
- P. Westfall & S. Young, Resampling-Based Multiple Testing (1993).
- S. Dudoit & M. van der Laan, Multiple Testing Procedures with Applications to Genomics (2008).
- M. Borenstein, L. Hedges, J. Higgins & H. Rothstein, Introduction to Meta-Analysis (2009).
About this partfrom its README
Part 33 of a sixty-five-part course in statistics, from a first course to a PhD (see the series plan and the syllabus), and the thirteenth part of Stage III, Master's. Part 32 selected a few variables among thousands. This part asks what happens to error rates when thousands of questions are asked at once:
- family-wise error and the false discovery rate;
- adaptive and empirical-Bayes versions, and the spread of the false discovery proportion;
- knockoffs;
- the research practices (forking paths, replication, publication bias) that multiply questions silently;
- the false coverage rate.
Its build is the p-hacking simulator (statkit.multiple.phack). Its instrument is the p-value sea (PValueSea):
sorted p-values against rank, with the Benjamini–Hochberg line sweeping through them, and a grid view of every
p-value. Its kit is statkit.multiple.
It opens with Bennett, Baird, Miller & Wolford's dead salmon (2009/2010), illustrated with a toy fish of 9,141 voxels of spatially smoothed Gaussian noise with 15 independent contrast images (not the original fMRI task design):
- 446 voxels have p < 0.05 (457 expected);
- 78 voxels in 27 clusters have p < 0.01;
- 3 voxels have p < 0.001 (≈ 9 expected);
- Bonferroni and BH find 0.
From there the part covers:
-
The problem. The World's gene-expression study: 25 patients and 25 controls, 5,000 genes in 200 pathways of 25 (correlation 0.3), 250 truly differential.
- Uncorrected p < 0.05 gives 430 discoveries, 214 of them false.
- The p-value histogram's floor gives π̂0 = 0.962 (truth 0.95).
- V, S and R; FWER, FDR, FDP.
-
Family-wise error.
- Bonferroni and Šidák; Holm's step-down as closed testing (a three-hypothesis lattice); Simes and Hochberg; Westfall–Young's permutation maxT.
- Genes at α = 0.05: Bonferroni 49 (0 false), Holm 50 (1), Westfall–Young 53 (1); power about 20%.
-
The false discovery rate (Benjamini & Hochberg 1995).
- The proof that FDR = π0q under independence; BH as a plug-in.
- PRDS and BY (harmonic factor 9.09 for m = 5,000).
- Genes: BH at q = 0.05 makes 155 discoveries (6 false); at q = 0.1, 184 (19 false, FDP 10.3%, power 66%); BY at q = 0.1, 112 (2 false).
-
Adaptive FDR. Storey's π̂0 and q-values; Benjamini–Krieger–Yekutieli's two-stage procedure.
-
Empirical Bayes on Singh et al.'s prostate data (6,033 genes, 50 vs 52 men; z-values from the
sdapackage's expression matrix).-
90 genes have |z| > 3 against 16 expected; local fdr by Lindsey's method.
-
The theoretical null gives π̂0 = 0.954. The empirical null by central matching has δ0 = 0.000 and σ0 = 1.041 (π̂0 = 0.972).
-
Discoveries:
Method Genes Bonferroni 2 BH (q = 0.1) 59 local fdr < 0.2, theoretical null 51 local fdr < 0.2, empirical null 27
-
-
FDR is an average. m = 1,000, 900 nulls, effects of 2.5, BH at q = 0.1, 2,000 studies:
independent equicorrelated ρ = 0.5 mean FDP 0.090 0.059 P(FDP > 0.2) 0.9% 9.2% P(no discoveries) 0% 19.6% discoveries 52 ± 8 59 ± 87 Also FDX and simultaneous FDP bounds.
-
Knockoffs (Barber & Candès 2015; Candès, Fan, Janson & Lv 2018).
- Exchangeability, Gaussian model-X construction, the lasso coefficient-difference W, the coin-flip proof, knockoff+; fixed-X knockoffs.
- n = 400, p = 150 (AR 0.5), 20 effects, 20 replications. Knockoff+ at q = 0.1 has FDR 8.2% and power 97%; the CV lasso has FDR 62% and power 100%.
-
The garden of forking paths.
-
Simmons, Nelson & Simonsohn's 'When I'm Sixty-Four'; Gelman & Loken.
-
Optional stopping with 10 looks gives a 19% false-positive rate.
-
The p-hacking simulator, 5,000 null studies (Simmons et al. 2011 in brackets):
Flexibility False-positive rate none 5.6% A: two DVs 9.9% (9.5%) B: add 10 per group 8.3% (7.7%) C: a covariate 12.6% (11.7%) D: drop a condition 12.7% (12.6%) A+B+C 32.6% (30.9%) all four 61.3% (60.7%) -
Multiverse analysis; many analysts (Silberzahn et al. 2018).
-
-
Replication.
- Ioannidis's PPV, derived. PPV is 94%, 65%, 14% and 1.5% for the four scenarios shown.
- Power (Button et al. 2013); type M and S errors.
- OSC (2015): 97% of originals significant against 36% of replications; mean r from 0.40 to 0.20.
- Camerer et al. (2016, 2018): 11 of 18 economics experiments and 13 of 21 social-science experiments replicated.
- Errington et al. (2021).
-
Publication bias. 800 simulated studies of a true effect of 0.2; 278 published (every positive-direction significant study, plus 10% of the rest).
- All studies pool to 0.194, the published ones to 0.301.
- Egger's intercept is 1.00 (p ≈ 10⁻⁵) for the published studies and −0.06 for all.
- PET gives 0.176.
- Exact p-curves (n = 30 per group): the share of significant p-values below 0.01 is 20%, 37% and 72% for d = 0, 0.3 and 0.7.
- Selection models; trim-and-fill.
-
Remedies argued.
- Preregistration: Kaplan & Irvin (2015), 57% → 8% positive trials. Registered reports: Scheel et al. (2021), 44% vs 96%.
- α = 0.005 against 'justify your alpha'; 'abandon significance'; the ASA statement; Bayes factors, estimation, equivalence tests.
-
The false coverage rate (Benjamini & Yekutieli 2005).
- m = 1,000 with 100 real effects; BH selects about 41.
- Unadjusted 90% intervals cover 78.7%. FCR-adjusted intervals (multiplier 2.88) cover 90.7%.
Data:
- the prostate microarray (Singh et al. 2002) is the Museum's;
- the gene study is the World's;
- the rest are seeded simulations.
Built in this part:
statkit.multiple(explainer/stats/kit/multiple.py), checked intests/test_stats_kit_multiple.pyagainst statsmodels'multipletests:- Adjusted p-values: Bonferroni, Šidák, Holm, Hochberg, BH and BY; brute-force closed testing; Westfall–Young maxT.
- Adaptive and empirical Bayes: Storey's π0 and q-values; local fdr (Lindsey's method; theoretical and empirical null).
- Simulation and selection: FDP simulation under equicorrelation; Gaussian model-X knockoffs, the knockoff(+) threshold and lasso W; FCR intervals.
- Research practice: the p-hacking simulator; Ioannidis's PPV; Egger and PET; publication and p-curve models.
- The World gains
genes, and the Museumprostate_z(). - The p-value sea (
PValueSeainexplainer/stats/viz.py).
The Coverage Board gains six rows (1,000 replications each). The FDR rows are 'size' rows with nominal q = 0.1:
| Method | Setting | Achieved | Verdict |
|---|---|---|---|
| no correction (each p < 0.1), FDR | m = 1,000, 90% null, independent | 0.502 | broken |
| BH, q = 0.1 | independent | 0.090 | conservative |
| BH, q = 0.1 | equicorrelated ρ = 0.5 | 0.065 | conservative |
| BY, q = 0.1 | equicorrelated ρ = 0.5 | 0.011 | conservative |
| unadjusted 90% CIs, BH-selected (FCR) | 100 real effects | 78.5% | broken |
| FCR-adjusted CIs, BH-selected | 100 real effects | 90.6% | conservative |
Chapter notes
| # | Chapter | Numbers |
|---|---|---|
| 0 | The dead salmon | 446 of 9,141 at p < .05; 0 corrected |
| 1 | The problem | 430 discoveries, 214 false |
| 2 | Family-wise error | Bonferroni 49, Holm 50, WY 53 |
| 3 | The false discovery rate | BH 184 (19 false); BY 112 |
| 4 | Adaptive FDR | π̂0 = 0.962 |
| 5 | Empirical Bayes | σ0 = 1.041; 51 → 27 genes |
| 6 | FDR is an average | P(FDP > 0.2) 0.9% vs 9.2% |
| 7 | Knockoffs | FDR 8.2%, power 97% vs lasso 62% |
| 8 | The garden of forking paths | 61.3% false positives |
| 9 | Replication | PPV 94% … 1.5%; OSC 36% |
| 10 | Publication bias | 0.301 vs 0.2; Egger p ≈ 10⁻⁵ |
| 11 | Remedies argued | 57% → 8%; 44% vs 96% |
| 12 | The false coverage rate | 78.7% vs 90.7% |
| 13 | Outro | — |
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Hook: the dead salmon (Bennett et al. 2009/2010).
- The problem. The World's 5,000-gene study; the
PValueSea. - FWER. Bonferroni, Šidák, Holm via closed testing, Hochberg, Westfall–Young.
- FDR (Benjamini & Hochberg 1995). BH proved under independence; BY under dependence.
- Adaptive FDR. Storey's π₀ and q-values.
- Empirical Bayes (Efron). Local fdr; the empirical null; the prostate data (Singh et al. 2002).
- FDR is an average. The spread of the FDP; dependence (Board).
- Knockoffs (Barber & Candès 2015; Candès et al. 2018). The filter and its coin-flip proof.
- The garden of forking paths. Built: the p-hacking simulator (Simmons, Nelson & Simonsohn 2011).
- Replication. Ioannidis (2005) derived; OSC (2015); Camerer et al. (2018).
- Publication bias. Funnels, Egger, p-curve, selection models.
- Remedies argued. Preregistration; α = 0.005; "abandon significance"; the ASA statements.
- The false coverage rate (Benjamini & Yekutieli 2005) (Board).
- Outro. Upgrade card for Part 56.
Built: statkit.multiple; the p-hacking simulator.
Build the film
python -m videos.stats.stats33.compute # the part's numbers, into .cache/stats33
python tools/build.py stats33 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py stats33 Hook # one chapter, silent, with a contact sheet
Scenes: videos/stats/stats33. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.stats.stats33.compute # once (a few minutes)
python tools/build.py stats33 -q l # fast 480p preview
python tools/build.py stats33 # 1080p30 -> renders/stats33.mp4
python tools/qa_scene.py stats33 FDR
python tools/lecture_length.py stats33 --floor 50