Lite / Independent Engineering Research / Week 33
Module check: forking paths and multiple comparisons
Nothing in this simulation has any real effect. Yet with a few innocent choices, a third of studies 'find' one. How?
Why should I care?
p-hacking rarely feels like cheating: each choice seems reasonable. Seeing false positives appear from pure noise, with your own hands on the switches, is the best inoculation there is.
- Explain how flexible analysis choices inflate false-positive rates.
- Apply a Bonferroni correction and compute expected false discoveries.
- Recognise p-hacking and HARKing and state the remedies.
Predict
You test 20 independent metrics, none with a real effect, at α = 0.05. Chance of at least one 'significant' result?
- 5%
- About 64%
- 100%
- 1%
Guess first, then reveal
1 − 0.95²⁰ ≈ 0.64. Testing many things and reporting the hits is a reliable way to publish noise.
Discover
Start with every switch off: the false-positive rate is near 5%. Turn on one fork at a time and note the rate. Turn them all on. Then switch on the Bonferroni correction. Which single fork inflated the rate most?
What the interactive shows (text version)
The forking-paths simulator runs 400 seeded studies in which there is no real effect. Switches add analysis choices (three outcomes, outlier removal, subgroups, peeking). A bar shows the share of studies reporting a 'significant' finding against a marked 5% line. With all switches on it is far above 5%; a Bonferroni switch brings it back near 5%.
Watch (optional)
Watch for: Match each p-hacking tactic in the video to a switch in the simulator.
Walks through how trying many analyses and reporting the one that worked manufactures false positives, and what pre-registration does about it.
“P-Hacking: Crash Course Statistics #30” by CrashCourse (opens YouTube; streaming video uses a lot of data)
The video is optional. Everything you need is in this lesson's text.
Understand
The garden of forking paths
Which outcome, which outlier rule, which subgroup, when to stop: each choice is a fork. If choices are made after looking at data, the analysis effectively tries many paths and reports one. The nominal 5% then hugely understates the real false-positive rate, even with no intent to deceive.
p-hacking and HARKing
p-hacking: trying analyses until p < 0.05. HARKing: Hypothesising After the Results are Known, presenting a post-hoc pattern as if predicted. Both are questionable research practices that manufacture findings. Remedies: pre-registration, one primary analysis, corrections for planned multiple tests, and labelling the rest exploratory.
Expected false discoveries
Run m null tests at α and expect m·α false positives. If only a fraction of ideas are true, the share of significant results that are false can be large: with 90 null and 10 real ideas, α = 0.05 and power 0.8, there are 4.5 false versus 8 true hits, so 36% of 'discoveries' are false.
Explain it another way
Intuitive
Throw enough darts blindfolded and one hits the bullseye. Painting the target around wherever the dart landed is HARKing.
Technical
Each data-dependent choice multiplies the effective number of tests; FWER = 1 − (1 − α)^k for k independent paths.
Mathematical
Bonferroni: α* = α/m. FDR among discoveries ≈ m₀α / (m₀α + m₁·power).
Applied
Tuning a robot on many metrics and seeds and reporting the best combination is the engineering version of p-hacking; held-out test conditions are the engineering version of pre-registration.
Derivation: Bonferroni from the union bound
Let Eᵢ be the event 'test i is a false positive', with P(Eᵢ) = α* for each of m null tests.
Family-wise error rate FWER = P(E₁ ∪ … ∪ E_m).
Union bound: P(∪Eᵢ) ≤ Σ P(Eᵢ) = m·α*, whatever the dependence between tests.
Choose α* = α/m. Then FWER ≤ m · α/m = α.
For independent tests the exact rate is 1 − (1 − α/m)^m, slightly below α.
Cost: each test is stricter, so power falls. For many tests, false-discovery-rate methods trade a few false positives for more power.
Worked example 1
You pre-register 4 metrics as co-primary. What threshold per test keeps FWER at 0.05?
Bonferroni: 0.05 / 4 = 0.0125. A metric with p = 0.02 is not significant under this plan, and you report it as such.
Common mix-ups
p-hacking requires deliberately cheating.
✓ It usually happens through many reasonable-looking choices made after seeing the data; good intentions do not prevent it, pre-registration does.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
Apply it
List every analysis choice in your capstone (metrics, exclusions, subgroups, stopping). For each, fix it in the pre-registration or mark it exploratory. If you have several primary tests, state your correction.
Reflect
Which fork in your project would you have taken without noticing it was a fork?
Write your answer on paper or in your own notes. Lite never stores what you write.
Go further
Research mode: limits and open questions
Large-scale replication efforts have linked low replication rates to small samples combined with flexible analysis, the mechanism simulated here.