Multiple testing and false positives
The question
Twenty treatments that do nothing are each tested at the 5% level. How likely is it that at least one of them looks significant?
Guess first, then run the twenty tests yourself.
- 1 SeeGuess, then run twenty null tests.
- 2 TryTie tests together, then sort p-values.
- 3 ProveBuild the proof, line by line.
- 4 ApplyScreens, backtests and a ranked list.
Before you start · 3 quick checks on a null p-value, a false positive and independent events, about 3 min
Two ideas before you start
2 ideasOne test: a false positive with probability α
Figure: the flat density of a p-value under a true null on the interval from 0 to 1, with the strip from 0 to the level α shaded. It needs JavaScript.
P(p ≤ α) = 0.05 × 1 = 0.05
When the null is true and the test statistic is continuous, the p-value is equally likely to land anywhere between 0 and 1. A test that rejects when p ≤ α then rejects a true null with probability exactly α: the area of the shaded strip.
Exact definition
A test and its p-value. A test of a null hypothesis \(H\) produces a p-value \(p\) between 0 and 1 from the data. The p-value is valid when, if \(H\) is true, for every \(t\) in \([0, 1]\),
\[P(p \le t) \le t.\]For a test with a continuous test statistic, the p-value is uniform on \([0, 1]\) under \(H\), so \(P(p \le t) = t\), as in the lesson on p-values. A discrete statistic gives a valid p-value with \(P(p \le t) \le t\), sometimes strictly smaller.
A false positive. The rule "reject \(H\) when \(p \le \alpha\)" has level \(\alpha\). Rejecting a true null is a false positive, the type I error of the lesson on hypothesis tests; for a valid p-value it has probability at most \(\alpha\).
Many tests: count the mistakes
Figure: ten boxes, one per test; dashed boxes are true nulls and solid boxes are real effects; a shaded box is a rejected hypothesis. It needs JavaScript.
Rejected: V = 1 R = 4 so V/R = 1/4 = 0.25
Of ten hypotheses, seven are true nulls (dashed) and three are real effects (solid). V counts the true nulls rejected, the false positives, and R counts all rejections. One error rate asks how often V ≥ 1; another averages the share V/R.
Exact definition
A family of tests. Test \(m\) null hypotheses \(H_1, \dots, H_m\) with p-values \(p_1, \dots, p_m\). Let \(I_0\) be the set of the indices \(i\) whose \(H_i\) is true and \(m_0\) the number of them, so \(0 \le m_0 \le m\). Nobody knows \(I_0\); it is fixed by the truth, not by the data.
Counts. A rule decides which hypotheses to reject. \(R\) is the number rejected and \(V\) the number of true nulls rejected, the false positives. Both are random, because the p-values are.
Two error rates. The family-wise error rate is \(\operatorname{FWER} = P(V \ge 1)\), the chance of at least one false positive. The false discovery proportion is \(V/R\) when \(R \ge 1\) and 0 when \(R = 0\); its expectation is the false discovery rate, \(\operatorname{FDR}\).
How large \(V/R\) tends to be depends, among other things, on how many of the hypotheses are true nulls to begin with: a base-rate effect like the one in the lesson on Bayes' theorem and base rates.
Fine print: what this page assumes
Every p-value on this page belongs to a test fixed in advance, before the data are seen. "A true null" means the hypothesis of no effect is true for that test. The simulations draw each p-value of a true null uniformly from 0.0001, 0.0002, …, 1, a uniform p-value rounded up to four decimals; that rounding changes no probability of the form \(P(p \le t)\) for a threshold \(t\) with at most four decimals.
Whether the tests are independent matters for some statements and not for others. Each statement says which it needs.
Twenty tests of nothing
- Set your guess: in what percent of batches of twenty true-null tests is at least one p-value at or below 0.05? Then press Lock my guess.
- Run batches of twenty independent tests. The page counts the batches with at least one significant result and compares the count with your guess after 100 batches.
How the simulation works
A batch is twenty independent tests, every null true. Each p-value is drawn uniformly from 0.0001, 0.0002, …, 1 by a seeded random number generator, so the same batches come back after Start over. The figure shows the twenty p-values of the latest batch, sorted from the smallest, on a log scale, so that 0.0001, 0.001, 0.01, 0.1 and 1 are equally spaced. You can run up to 1000 batches.
Three rules on the same batches
Switch the rule. The figure redraws its threshold, and the tiles recount every batch you ran under that rule.
When tests lean on each other
The batches in stage 1 were independent. Real tests often share data, and then they are not. Keep twenty tests at level 0.05 with every null true and each p-value exactly uniform, but let them depend on each other. Two questions come first; the explorer below them opens once both are answered.
Explorer: three ways to tie the tests together
- Pick how the tests depend on each other: copies of one test, independent tests, or staggered copies.
- Set the number of tests m. The bars show the chance of each count V of false positives.
The three structures
Draw one number \(U\) uniformly from \((0, 1]\). Copies: every test reports the same p-value, \(p_i = U\). Independent: each test draws its own uniform p-value. Staggered: \(p_i\) is \(U + (i - 1)/m\), wrapped back into \([0, 1]\) by subtracting 1 when it passes 1. In all three, each \(p_i\) alone is uniform on \([0, 1]\), so each test alone rejects with probability 0.05. For staggered copies the \(m\) windows where \(p_i \le 0.05\) start \(1/m\) apart; with \(m \le 20\) they never overlap, so at most one test rejects at a time.
Goals
Sort the p-values: Benjamini–Hochberg by hand
Here is one study with twenty tests, some of them real effects. Benjamini–Hochberg at level \(q\) sorts the p-values, \(p_{(1)} \le p_{(2)} \le \dots \le p_{(m)}\), finds the largest rank \(k\) with \(p_{(k)} \le kq/m\), and rejects the \(k\) hypotheses with the smallest p-values. If no rank qualifies, it rejects nothing.
- Move the rank slider to look at one sorted p-value against its line; switch \(q\) with the buttons.
If the p-values of the true nulls are independent of each other and of the other p-values, and each is uniform, then Benjamini–Hochberg at level \(q\) has \(\operatorname{FDR} \le m_0 q/m \le q\). This result of Y. Benjamini and Y. Hochberg is stated here without proof. The same bound holds under a kind of positive dependence between the p-values (called PRDS), also stated without proof; under arbitrary dependence it can fail.
It controls the average share of false positives among the rejections, not the chance of at least one. So it can reject more. If Bonferroni at level \(q\) rejects \(r \ge 1\) hypotheses, those have the \(r\) smallest p-values and \(p_{(r)} \le q/m \le rq/m\), so Benjamini–Hochberg rejects at least those \(r\). When every null is true, \(V = R\), so the false discovery proportion is 1 exactly when \(R \ge 1\): then \(\operatorname{FDR} = \operatorname{FWER}\).
Why Bonferroni works under any dependence
Assumptions. \(m\) null hypotheses with p-values \(p_1, \dots, p_m\), of which the \(m_0\) with indices in \(I_0\) are true. Each \(p_i\) with \(i\) in \(I_0\) is valid: \(P(p_i \le t) \le t\) for every \(t\) in \([0, 1]\). Nothing is assumed about how the p-values depend on each other. The level is \(0 \lt \alpha \lt 1\).
Conclusion. The rule "reject \(H_i\) when \(p_i \le t\)" has \(P(V(t) \ge 1) \le m_0 t\) for every \(t\) in \([0, 1]\). So Bonferroni, which rejects \(H_i\) when \(p_i \le \alpha/m\), has \(\operatorname{FWER} \le m_0\alpha/m \le \alpha\).
Facts the proof uses.
- \(\mathbf{1}\{A\}\) is 1 when the event \(A\) happens and 0 when it does not, and \(E[\mathbf{1}\{A\}] = P(A)\);
- the expectation of a sum is the sum of the expectations, for any random variables, dependent or not;
- if \(X \le Y\) in every outcome, then \(E[X] \le E[Y]\), as in the lesson on Markov's inequality.
Two easy cases first. If \(m_0 = 0\), then \(V(t) = 0\) always. If \(m_0 = 1\), then \(V(t) \ge 1\) is the event \(p_i \le t\) for the one true null, of probability at most \(t\). The proof below takes \(m_0 \ge 2\).
Each option is one step about the hypotheses of the theorem with \(m_0 \ge 2\). Pick the one that is true for every joint distribution the theorem covers and every threshold \(t\) in \([0, 1]\); a step marked "in every outcome" must also hold for every outcome of the experiment.
Problems
Each problem has hints and a full solution.
Further reading
- Y. Benjamini and Y. Hochberg, "Controlling the false discovery rate," Journal of the Royal Statistical Society, Series B 57 (1995), the paper that introduced the procedure.
- S. Holm, "A simple sequentially rejective multiple test procedure," Scandinavian Journal of Statistics 6 (1979).
- R. J. Simes, "An improved Bonferroni procedure for multiple tests of significance," Biometrika 73 (1986).
- B. Efron, Large-Scale Inference (Cambridge University Press, 2010), chapters 3 and 4, on family-wise error and false discovery rates.