Quick answers
- What is a post hoc test?
- A test, run after a significant ANOVA, that compares pairs of means while adjusting for the number of comparisons, so the overall chance of a false positive stays near 5%.
- Which post hoc test should I use?
- Tukey's HSD for all pairwise comparisons; Dunnett's test to compare every treatment with a control; planned contrasts for questions decided in advance. Fisher's LSD only after a significant F with few treatments.
- What is the Tukey test?
- Tukey's honestly significant difference (HSD) compares every pair of means using the studentized range, keeping the family-wise error rate at 5% for all pairs together.
- What is the Bonferroni correction?
- Divide α by the number of tests (or multiply each p value by it). Simple and safe, but conservative when there are many comparisons.
- What do the letters a, b, ab mean after means?
- Means sharing a letter are not significantly different; means with no letter in common are. 'ab' differs from neither 'a' nor 'b' means.
- Is Duncan's test acceptable?
- It is still common in agricultural journals, but statisticians discourage it because its error rate grows with the number of treatments. Prefer Tukey.
On this page
- Quick answers
- Why adjust for multiple comparisons
- Fisher's LSD and Tukey's HSD
- With the right model, the comparisons sharpen
- Duncan, Student-Newman-Keuls, Scheffé, Bonferroni and Dunnett
- Dunnett's test: every treatment against the control
- Planned contrasts: asking the question you care about
- Reporting and software
- Key takeaways
- Questions people ask
- Sources
Why adjust for multiple comparisons
Four diets give 4 × 3 / 2 = 6 pairs. Each test at α = 0.05 has a 5% false-positive risk, but the chance of at least one false positive among six independent tests is 1 − 0.95⁶ = 26%. With 10 treatments (45 pairs) it is about 90%.
- The comparison-wise error rate is the risk for each test.
- The family-wise error rate is the risk of at least one false positive across all of them. Tukey, Bonferroni, Scheffé and Dunnett control it; Fisher's LSD and Duncan do not fully.
Protection has a price: stricter tests miss more real differences. The choice depends on how many comparisons you make and why.
Fisher's LSD and Tukey's HSD
Both give a minimum difference: two means further apart than it differ significantly.
LSD = t(α/2, error df) × √(2 MSE / r) and HSD = q(α, t, error df) × √(MSE / r)
where r is the number of replicates per treatment and q is the studentized range statistic for t treatments.
Fisher's protected LSD (used only after a significant F) holds the family-wise rate at 5% for three treatments but not beyond. Tukey is the standard for comparing all pairs.
With the right model, the comparisons sharpen
Post hoc tests use the error mean square of the model you fitted, so they inherit its quality. A wrong model (ignoring blocks) cost two real differences here.
Duncan, Student-Newman-Keuls, Scheffé, Bonferroni and Dunnett
| Test | Use it for | Notes |
|---|---|---|
| Tukey HSD | All pairwise comparisons | Controls family-wise error; the default choice |
| Dunnett | Each treatment vs one control | More powerful than Tukey for that purpose (fewer comparisons) |
| Bonferroni | A small set of chosen comparisons | α ÷ number of tests; conservative with many tests |
| Scheffé | Any contrasts, including ones suggested by the data | Very conservative for simple pairs |
| Fisher's LSD | After a significant F, few treatments | Most powerful, least protection |
| Duncan's multiple range | Common in older agricultural papers | Error rate rises with the number of means; discouraged |
| Student-Newman-Keuls | Stepwise pairwise comparisons | Does not control family-wise error with 4+ means |
Dunnett's test: every treatment against the control
Planned contrasts: asking the question you care about
A contrast is a weighted comparison of means whose weights sum to zero, planned before seeing the data. It tests one specific question with full power and needs no correction when the number of contrasts is small.
With numeric treatment levels (nitrogen rates, doses), the natural contrasts are linear and quadratic trends, not pairwise comparisons; see dose-response. Running Tukey's test across five nitrogen rates answers the wrong question.
Reporting and software
- Name the test and the error term: "Means were separated with Tukey's HSD (α = 0.05) using the error mean square of the RCBD analysis."
- Give means with a pooled SE (SEM) and letters, or the differences with confidence intervals.
- For factorials with an interaction, compare simple effects (one factor within each level of the other), not main-effect means.
In R
fit <- lm(adg ~ litter + diet, data = dat)
library(emmeans)
emm <- emmeans(fit, "diet")
pairs(emm, adjust = "tukey") # Tukey HSD
contrast(emm, "trt.vs.ctrl", ref = "Control") # Dunnett
contrast(emm, list(ctrl_vs_supp = c(-1, 1/3, 1/3, 1/3)))
multcomp::cld(emm, Letters = letters) # letters a, b, abIn SAS
proc glimmix data=pigs;
class litter diet;
model adg = litter diet;
lsmeans diet / adjust=tukey lines; /* letters */
lsmeans diet / diff=control("Control") adjust=dunnett;
estimate "Control vs supplemented" diet -3 1 1 1 / divisor=3;
run;The ANOVA Calculator offers Tukey, LSD and Duncan with letters, and Graph Maker puts the letters on bar charts.
Key takeaways
- Many pairwise tests inflate false positives; post hoc tests control the family-wise error rate.
- Tukey HSD for all pairs, Dunnett for each treatment vs a control, planned contrasts for specific questions.
- Means sharing a letter are not significantly different.
- Post hoc tests use the model's error mean square, so analyze as designed first.
- For numeric levels such as rates and doses, use trend contrasts or regression instead of pairwise tests.
Questions people ask
Can I run post hoc tests when the ANOVA is not significant?
Tukey and Dunnett control their own error rate and are valid without a significant F, though they rarely find differences then. Fisher's LSD must not be used without a significant F.
Why do Tukey and LSD disagree?
LSD controls the error for each comparison, Tukey for the whole family. LSD declares more differences, some of which will be false positives.
What is the Games-Howell test?
A Tukey-like test that does not assume equal variances, useful when group variances clearly differ.
Which post hoc test is best for a non-parametric test?
Dunn's test after Kruskal-Wallis, with a Holm or Bonferroni adjustment.
Sources
- Tukey, J. W. (1949). Comparing individual means in the analysis of variance. Biometrics, 5, 99–114.
- Dunnett, C. W. (1955). A multiple comparison procedure for comparing several treatments with a control. Journal of the American Statistical Association, 50, 1096–1121.
- Saville, D. J. (2015). Multiple comparison procedures: cutting the Gordian knot. Agronomy Journal, 107(2), 730–735.
- Kaps, M., and Lamberson, W. R. (2017). Biostatistics for Animal Science (3rd ed.). CABI.