01 / 21

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.

Biostatistics

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.

Post-Hoc
Conducted after a significant omnibus \( F \)-test
Pairwise
Compares every possible pair of group means
Corrected
Adjusts \( p \)-values to control familywise error

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.

FWER Number of comparisons 0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 0.05 Uncorrected FWER Goal: FWER = 0.05

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.

\( \bar{X}_i - \bar{X}_j \)
Difference between the two group means being compared
\( MS_W \)
Mean Square Within from the ANOVA table (pooled variance)
\( n \)
Sample size per group (assumes equal \( n \))

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

Scheffé
Most conservative: controls FWER for all possible contrasts, not just pairwise. Lower power.
Holm-Bonferroni
Step-down method: more powerful than Bonferroni while still controlling FWER. Always preferred over standard Bonferroni.
Dunnett
Compares each treatment to a single control group only. Fewer comparisons = more power.

How to Apply Post-Hoc Tests

1
Run the omnibus ANOVA. Only proceed if \( p < \alpha \). A non-significant ANOVA means stop: no post-hoc tests needed.
2
Choose your post-hoc method based on your design: all pairwise (Tukey), vs. control (Dunnett), or planned contrasts (Bonferroni/Holm).
3
Compute the test statistic for each comparison (e.g., \( q \) for Tukey, \( t \) for Bonferroni) and find the adjusted \( p \)-value.
4
Compare to the adjusted threshold. Report which pairs are significantly different and their effect sizes.
5
Interpret in context. State which specific treatments differ and what it means for the research question.

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

Mean Pain Scores with 95% CI (Tukey-adjusted) Pain Score 1 2 3 4 5 6 7 Drug A 4.2 Drug B 3.1 Drug C 5.8
\( p = 0.001 \) ★
n.s.

Common Mistakes

✕ Running post-hoc without significant ANOVA
Post-hoc tests are only valid after a significant omnibus test. Skipping ANOVA inflates false positives.
✕ Using uncorrected \( t \)-tests
Multiple uncorrected pairwise \( t \)-tests ignore the familywise error rate. Always apply a correction method.
✕ Choosing post-hoc method after seeing data
Picking the method that gives significant results is p-hacking. Decide your method before analysis.

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?