Multiple Comparisons › The Multiple Comparisons Problem
Machine Learning from ScratchAll chapters Multiple Comparisons › The Multiple Comparisons ProblemOne section · Sections in this chapter2 / 12 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
When we conduct a single hypothesis test at significance level , we accept a 5% chance of a Type I error: rejecting a true null hypothesis. This seems like an acceptable risk. But what happens when we conduct many tests?
The Mathematics of Multiplicity
Consider conducting independent hypothesis tests, each at significance level . If all null hypotheses are true, each test has probability of producing a false positive. The probability of making at least one false positive across all tests is:
Since the tests are independent:
Therefore:
This is called the family-wise error rate (FWER): the probability of making at least one Type I error among a family of tests.
Let's see how quickly this grows:
| Number of tests () | FWER at |
|---|---|
| 1 | 0.050 |
| 5 | 0.226 |
| 10 | 0.401 |
| 14 | 0.512 |
| 20 | 0.642 |
| 50 | 0.923 |
| 100 | 0.994 |
With just 14 tests, you have more than a 50% chance of at least one false positive. By 100 tests, a false positive is virtually certain (99.4%).

Simulation: Seeing False Positives Emerge
Let's simulate the multiple comparisons problem directly. We'll generate data where all null hypotheses are true (no real effects) and watch how false positives accumulate.


The simulation confirms our mathematical analysis: with 100 tests and no real effects, we obtained {python} sum(significant) "significant" results, false positives that could mislead researchers into believing they've found real effects.