Summary and Practical Guide to Hypothesis Testing › Multiple Comparisons Reference
Michael BrenndoerferJanuary 10, 20261 min read
Machine Learning from ScratchAll chapters Summary and Practical Guide to Hypothesis Testing › Multiple Comparisons ReferenceSection view · Sections in this chapter6 / 12 ↓
Sections in this chapter12
Reading tools Definitions, links & notes
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
Notes & comments
When to Use Each Method
| Method | Controls | Use When |
|---|---|---|
| Bonferroni | FWER | Few tests, any false positive costly |
| Holm | FWER | Many tests, need more power than Bonferroni |
| Benjamini-Hochberg | FDR | Exploratory analysis, many tests OK |
| Tukey HSD | FWER | All pairwise comparisons after ANOVA |
| Dunnett | FWER | Comparing treatments to control |
Quick Formulas
Bonferroni: Reject if
Holm (step-down): For ordered p-values, reject if
Benjamini-Hochberg: Find largest where , reject all
PythonIn [6]Expand
from scipy.stats import false_discovery_control
# Example: 5 p-values from multiple tests
p_values = [0.001, 0.008, 0.039, 0.041, 0.23]
# Bonferroni
bonf_threshold = 0.05 / len(p_values)
bonf_reject = [p < bonf_threshold for p in p_values]
print(f"Bonferroni (threshold = {bonf_threshold:.3f}): {bonf_reject}")
# Benjamini-Hochberg
bh_adjusted = false_discovery_control(p_values, method="bh")
bh_reject = bh_adjusted < 0.05
print(f"BH adjusted p-values: {[f'{p:.3f}' for p in bh_adjusted]}")
print(f"BH reject: {list(bh_reject)}")ConsoleOut [6]Expand
Bonferroni (threshold = 0.010): [True, True, False, False, False] BH adjusted p-values: ['0.005', '0.020', '0.051', '0.051', '0.230'] BH reject: [np.True_, np.True_, np.False_, np.False_, np.False_]
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!