Post-Hoc
Comparisons
Learn why finding a significant ANOVA is only the beginning: discover which specific groups differ using post-hoc tests while controlling the risk of false positives.
The Problem ANOVA Leaves Behind
When you run a one-way ANOVA and get a significant result (\( p < \alpha \)), you know at least one group mean differs from the others. But ANOVA does not tell you which groups differ. Are all groups different? Just two of them? That is exactly the gap post-hoc comparisons fill.
What Are Post-Hoc Comparisons?
Post-hoc (Latin: "after this") comparisons are pairwise statistical tests performed after a significant omnibus test (like ANOVA). They compare every pair of group means while controlling the overall error rate.
The Multiple Testing Problem
With \( k \) groups, the number of pairwise comparisons is \( \binom{k}{2} = \frac{k(k-1)}{2} \). Each test at \( \alpha = 0.05 \) carries a 5% false-positive risk. Running many tests inflates the overall chance of at least one false positive.
How Many Pairs to Compare?
With \( k \) groups, the number of unique pairwise comparisons grows quickly:
| Groups \( k \) | Pairs \( \binom{k}{2} \) | Uncorrected FWER |
|---|---|---|
| 3 | 3 | 14.3% |
| 4 | 6 | 26.5% |
| 5 | 10 | 40.1% |
| 6 | 15 | 53.7% |
| 10 | 45 | 90.1% |
The Bonferroni Correction
The simplest post-hoc approach: divide your significance level by the number of comparisons. If any individual test's \( p \)-value falls below this adjusted threshold, declare it significant.
Example: With \( k = 4 \) groups (\( m = 6 \) pairs) at \( \alpha = 0.05 \):
Tukey's HSD Test
Tukey's Honestly Significant Difference is the most popular post-hoc test for ANOVA. It compares every pair of means and controls the FWER at exactly \( \alpha \) when group sizes are equal.
Bonferroni vs. Tukey
| Feature | Bonferroni | Tukey's HSD |
|---|---|---|
| Approach | Adjust \( \alpha \) by \( m \) | Studentized range distribution |
| Best when | Few planned comparisons | All pairwise comparisons |
| Equal \( n \) required? | No | Ideal, not strict |
| Power | Lower (conservative) | Higher (optimized) |
| Controls FWER | Yes (conservatively) | Yes (exactly at \( \alpha \)) |
Other Post-Hoc Methods
How to Apply Post-Hoc Tests
Worked Example: Drug Trial
A researcher tests three pain-relief drugs on 30 patients (10 per group). Mean pain scores (lower is better) and the ANOVA result:
| Group | Drug A | Drug B | Drug C |
|---|---|---|---|
| Mean \( \bar{X} \) | 4.2 | 3.1 | 5.8 |
| \( n \) | 10 | 10 | 10 |
Tukey's HSD: Computing \( q \)
Given \( MS_W = 2.50 \) and \( n = 10 \) per group, the standard error is:
Now compute \( q \) for each pair:
| Pair | \( |\bar{X}_i - \bar{X}_j| \) | \( q = \frac{\text{diff}}{SE} \) | Significant? |
|---|---|---|---|
| A vs. B | 1.1 | 2.20 | No |
| A vs. C | 1.6 | 3.20 | No |
| B vs. C | 2.7 | 5.40 | ✓ Yes |
Bonferroni Approach: Same Data
Using the same drug trial data, let us apply the Bonferroni correction instead. With \( k = 3 \) groups, we have \( m = 3 \) comparisons:
Suppose the individual \( t \)-test \( p \)-values for each pair are:
| Pair | \( p \)-value | \( p < 0.0167 \)? |
|---|---|---|
| A vs. B | 0.091 | No |
| A vs. C | 0.032 | No |
| B vs. C | 0.001 | ✓ Yes |
Visualizing Pairwise Results
Common Mistakes
Summary of Methods
| Method | Use When | Power | Conservativeness |
|---|---|---|---|
| Tukey's HSD | All pairwise, equal \( n \) | High | Moderate |
| Bonferroni | Few planned comparisons | Moderate | High |
| Holm-Bonferroni | Improvement over Bonferroni | Higher | Moderate |
| Scheffé | All contrasts (complex) | Low | Very high |
| Dunnett | All vs. one control | Highest | Low |
Question 1 of 5
A researcher runs a one-way ANOVA comparing 4 treatment groups and gets \( p = 0.12 \). What should they do next?
Question 2 of 5
With \( k = 5 \) groups and \( \alpha = 0.05 \), what is the Bonferroni-adjusted significance threshold?
Question 3 of 5
Which post-hoc method is most appropriate when you want to compare every treatment group against a single control group?
Question 4 of 5
The familywise error rate (FWER) for 6 uncorrected tests at \( \alpha = 0.05 \) is approximately:
Question 5 of 5
Why is Tukey's HSD generally preferred over Bonferroni when comparing all pairs of group means?