MIT 18.650 — Lecture 20
Permutation Test and Multiple Hypothesis Testing
§ The Permutation Test
Just one more test to discuss. This one has the same hypotheses as the two-sample test from Lecture 19.
Permutation Test Hypotheses. Given and (i.i.d.), where and are CDFs, we have:
The test statistic for the permutation test is simply . It remains to determine a threshold for which, under the null hypothesis, the probability that is below .
Remark. Note that if and are different distributions but have the same mean, we will likely commit a Type II error. The two-sample test is more robust than the permutation test in this regard.
Combine all samples into a single list , where the first samples are and the last samples are . If the null hypothesis is true, then all permutations of are equally likely to occur from this process.
Thus, we can estimate the expected distribution of the test statistic under the null hypothesis by iterating over all permutations , and for each permutation, compute its corresponding test statistic.
Then just pick to be the quantile across all values of . That's it.
Remark. In practice, iterating through all permutations is too computationally inefficient. So we usually just sample random permutations instead, then compute the quantile using this approximate data.
§ Multiple Hypothesis Testing
Here's the relevant xkcd for this section.

Type I errors (i.e. the null hypothesis is rejected even though it is true) accumulate when hypothesis testing is repeated multiple times. For example, if the null hypothesis is true, then a hypothesis test at level might have a chance of yielding a Type I error. Formally, here is the justification of why this is true.
Theorem. (P-Values Are Uniform) If the null hypothesis is true, then the p-value follows a uniform distribution.
Proof: Suppose that, under the null hypothesis, the test statistic has continuous (for simplicity) CDF . Also assume (WLOG) that we are performing a one-sided test where we reject if exceeds some quantile .
The key is the following lemma stated earlier in Lecture 19.
Lemma. If , then . (And, assuming the null hypothesis, we do in fact have here.)
For this kind of test, the p-value is . Thus, since is uniform, so is .
§ The Bonferroni Correction
Here's one easy way to fix this: if you're performing tests, then you should divide the level of your test by .
Definition. When performing tests, the family-wise error rate (FWER) is the probability of making at least one Type I error, assuming the null hypothesis is true in all cases.
Definition. When performing tests, we use the Bonferroni correction: reject the test if its p-value is at most . Doing so will ensure the FWER is at most , assuming the null hypothesis is true in all cases.
The proof why the Bonferroni correction works is just the union bound, followed by invoking the uniformity of p-values.
There are some problems with the Bonferroni correction, though. For one, it's too tight. If , then will be far too low to actually reject any tests.
Furthermore, the Bonferroni correction is calibrated for the worst case, where all null hypotheses are true. But if some null hypotheses are false, then we really should expect some positives, and we really ought to be more lenient.
Perhaps we should instead be working only, more weakly, to limit the proportion of positives that are false positives…
§ The Benjamini-Hochberg Method
Definition. The false discovery proportion (FDP) is , taken to be when there are no positives.
Definition. The false discovery rate (FDR) is the expected value of the FDP.
Remark. If the null hypothesis is true in all cases, then all positives are false positives. In this case, we have:
Therefore, if the null hypothesis is true in all cases, the FDR equals the FWER.
Instead of aiming for , the Benjamini-Hochberg (BH) method aims for .
Theorem. (Benjamini-Hochberg Method) After performing all tests, reject or accept them like so.
First, sort the p-values in non-decreasing order .
Identify the greatest index for which .
Reject all tests whose p-values are at most ; that is, reject the tests corresponding to the smallest p-values.
If the test statistics are independent across all , then is guaranteed.

Proof: Say this procedure rejects tests, and say is the set of indices of tests with a true null hypothesis. Then:
If we naively assume , then the expected value of each term is , yielding .
The logical fallacy here, though, is that itself is random and dependent on the values of the . The rest of the proof is just working out these technicalities; the explanation above already captures the fundamental essence of the BH method.
To work around this logical fallacy, here's the trick. For each , let denote the number of tests that would be rejected if were replaced with zero (and all other p-values were kept unchanged).
Lemma 1. It must be that is independent from .
Proof: Obvious, as is by definition a direct function of the values and , which the theorem assumes to be independent of .
Lemma 2. The following identity is true for all .
Proof (Case 1): Suppose that . Then is among the smallest p-values that get rejected. Therefore, replacing with zero only permutes the order of the smallest p-values, so .
Thus, both the LHS and RHS equal , as desired.
Proof (Case 2): Suppose instead that ; that is, suppose is not rejected. The fact that was not rejected tells us more strongly that .
Note that replacing with zero leaves all p-values with indices above completely unchanged and unmoved. Therefore, the rejection threshold cannot possibly exceed index after this change, so .
Chaining and together yields . Thus, both the LHS and RHS are zero, as desired.
Lemma 2 lets us freely replace with in the expression of FDR above, and Lemma 1 gives us the freedom to simplify as we had done naively before.
And that's the full proof.
And so the BH method is better in practice, when we actually expect some of our tests to turn out positive.