Atlas
statminds
Multiple Comparisons (Post-Hoc Model)The underlying model family class (e.g. GLM, linear model, categorical matrix, log-linear).Parametric ReferenceStatistical methods that assume a specific probability distribution family (typically normal).12-stage workflow

Tukey HSD

The engine for Pairwise Discovery. Tukey's Honestly Significant Difference (HSD) audits all possible pairs of group means, providing a powerful alpha-shield while hunting for the definitive 'Group Winner'.

Model familyMultiple Comparisons (Post-Hoc Model)
Hypothesistwo-tailed
AliasesTukey's Test · Tukey-Kramer Test · Honestly Significant Difference (HSD)
G1
Pairwise Isolation Audit
Identify exactly which group combinations drive the global ANOVA significance.
G2
Alpha-Shielding Strategy
Maintain a strict 5% family-wise error rate across all simultaneous comparisons.
G3
Conservative Discovery Strike
Ensure that reported differences are 'Honestly Significant' and not chance sampling artifacts.
Visual Overview Dashboard
1

What is it?

Tukey HSD is designed to adjust significance thresholds or confidence intervals during multiple pairwise comparisons to protect against Family-Wise Error Rate inflation.

The engine for Pairwise Discovery. Tukey's Honestly Significant Difference (HSD) audits all possible pairs of group means, providing a powerful alpha-shield while hunting for the definitive 'Group Winner'.

2

Goals & Indications

  • Pairwise Isolation Audit: Identify exactly which group combinations drive the global ANOVA significance.
  • Alpha-Shielding Strategy: Maintain a strict 5% family-wise error rate across all simultaneous comparisons.
  • Conservative Discovery Strike: Ensure that reported differences are 'Honestly Significant' and not chance sampling artifacts.
3

Core Idea Diagram

Group A vs BGroup B vs CPairwise Tukey CIs crossing 0 (no diff) vs not crossing 0
4

Claims tested

H₀: H₀: μᵢ = μⱼ for all pairwise comparisons (no difference between any pair of group means)
Hₐ: Hₐ: μᵢ ≠ μⱼ for at least one pair (at least one pairwise difference exists)
5

How it works

  1. Perform ANOVA and obtain Mean Square Error (MSE) and degrees of freedom.
  2. Determine Studentized Range distribution critical value q_crit.
  3. Calculate Tukey honest difference threshold: W = q_crit * sqrt(MSE / n).
  4. Compute all pairwise differences; compare against W to assess significance.
6

Assumptions

Significant omnibus ANOVA F-test: ANOVA must be significant before post-hoc
DV is continuous: Outcome measured on continuous scale
Independence of observations: No clustering, nesting, or repeated measures
7

Important Note

Conducted AFTER significant omnibus ANOVA F-test. Controls family-wise error rate (FWER) at α across ALL pairwise comparisons using studentized range (q) distribution. Tests all k(k-1)/2 pairwise comparisons simultaneously while maintaining overall Type I error at α.

8

Worked Example

ComparisonDifferenceTukey 95% CISignificance
A vs B3.50[1.20, 5.80]Significant
B vs C0.80[-1.50, 3.10]No Difference
Interactive Sandbox

Pairwise Post-Hoc Comparison Laboratory

Slide the group averages and error variance. Observe which pairwise confidence intervals cross 0 (representing no statistical difference) vs. those that stand clear.

Mean A12
Mean B16
Mean C20
Error Variance (MSE)8.0
Group Sample Size (n)15
Honest Tukey Differences
Tukey Limit W: 2.618
Critical q: 3.585
Degrees of freedom: 42
Significant Pairs: 3 of 3
Pairwise Tukey 95% Confidence Intervals
0 (No difference)A vs BA vs CB vs C
The 12-Stage Precision Workflow
01Pairwise Parity
Hypotheses
We test the null of zero difference for EVERY group pair (μ_i = μ_j) against the discovery of localized divergence.
02Group Balance
Assumptions
Ensuring independent groups and homogeneous variances—Tukey is most powerful when cell sizes are equal.
03Studentized Range
Diagnostics
Utilizing the 'q' distribution to account for the total number of groups being compared—the mathematical core of the alpha shield.
04focus
Determining if FlowMotion is superior to both Standard PT and Yoga, or if it only beats the sedentary control.
05Games-Howell Pivot
Alternatives
Knowing when to switch to Games-Howell if group variances are significantly unequal (Heteroscedasticity).
06Adjusted p-values
Significance
Reporting p-values that have been 'stretched' to account for the multiple testing burden—ensuring 100% false-positive protection.
07Cohen’s d
Effect Size
Calculating standardized mean differences for each significant pair to quantify the clinical weight of the discovery.
08Group Saturation
Sample Size
Ensuring every categorical level has enough data to survive the conservative penalty of the studentized range test.
09The Mean Contrast
Reporting
Reporting the Mean Difference, SE, and the 95% Adjusted Confidence Interval for the definitive manuscript story.
10TukeyHSD Logic
Software
Executing the 'TukeyHSD()' command, ensuring the model input is a valid ANOVA or aov object.
11focus
Avoiding the error of running multiple independent t-tests, which rapidly degrades the scientific credibility of your alpha level.
12focus
Tracing the model back to John Tukey (1949) and the foundational shift toward post-hoc exploratory rigor.
01Hypothesis test logic

Hypotheses

Pragmatic null and alternative hypotheses defined in mathematical notation.

A hypothesis is a question sharpened to a point. Ambiguity is the enemy of inference.
Logic Core
Null · H₀

H₀: μᵢ = μⱼ for all pairwise comparisons (no difference between any pair of group means)

Alternative · Hₐ

Hₐ: μᵢ ≠ μⱼ for at least one pair (at least one pairwise difference exists)

Why it matters two-tailed

Conducted AFTER significant omnibus ANOVA F-test. Controls family-wise error rate (FWER) at α across ALL pairwise comparisons using studentized range (q) distribution. Tests all k(k-1)/2 pairwise comparisons simultaneously while maintaining overall Type I error at α.

02Model diagnostics

Assumptions

The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.

Build your analysis on rock, not sand. Verify the mathematical foundation before building the model.
Integrity Shield
7
Assumptions
4
Critical / High Severity
How to check
Quick
Run one-way ANOVA first; check if F-test p-value < α (typically .05). Tukey HSD should only be conducted if omnibus ANOVA rejects H₀.
Rigorous
Verify ANOVA assumptions first (normality, homoscedasticity, independence), then run ANOVA. Only proceed to Tukey HSD if F(df_between, df_within) has p < α.
If violated
If ANOVA is non-significant (p ≥ .05), STOP. Do not conduct post-hoc tests - this inflates Type I error by 'double-dipping' (testing multiple hypotheses when omnibus test failed). Report ANOVA results and conclude no significant group differences exist. If you have planned/a priori comparisons (specified before seeing data), you MAY conduct those specific contrasts without requiring significant ANOVA, but use appropriate correction (Bonferroni, Holm) and justify a priori selection.
bonferroni
How to check
Quick
Inspect variable type; create histograms & summary statistics to verify scale is not discrete/categorical
Rigorous
Formal measurement scale validation; verify measurement units are truly interval/ratio (equal distances between values)
If violated
If ordinal with limited categories → use Kruskal-Wallis with Dunn post-hoc + Holm correction. If many ordinal levels (7+) → may proceed cautiously. If categorical → inappropriate for Tukey HSD.
kruskal wallis
How to check
Quick
Design review; check if any subject IDs appear multiple times; look for clustering indicators (school, site, family IDs)
Rigorous
Durbin-Watson test for autocorrelation; check intraclass correlation (ICC) to detect clustering; verify sampling design ensures independence
If violated
If repeated measures → use RM-ANOVA with post-hoc pairwise t-tests + Bonferroni. If clustered data → use linear mixed models with emmeans package for pairwise comparisons. Tukey HSD requires independent observations.
one way repeated measures anovalinear mixed model
How to check
Quick
Q-Q plots for each group (points on diagonal); histograms of residuals; visual inspection for severe skewness
Rigorous
Shapiro-Wilk test per group (p > .05 indicates normality); check skewness (<|2|) and kurtosis (<|7|) values
If violated
If mild violation with balanced n ≥ 30 per group: Tukey HSD is robust via CLT, proceed. If notable violation: (1) Transform DV (log, sqrt); (2) Use Kruskal-Wallis + Dunn post-hoc (rank-based, distribution-free); (3) Permutation tests for pairwise comparisons; (4) Bootstrap confidence intervals.
How to check
Quick
Levene's test (p > .05 indicates equal variances); Brown-Forsythe test (median-based, more robust); visual: boxplots should show similar IQR across groups
Rigorous
Bartlett's test (sensitive to normality); F-max test (ratio of largest to smallest variance < 3); residual plots should show even spread
If violated
If Levene's p < .05 (unequal variances): DO NOT USE TUKEY HSD. Instead: (1) BEST: Use Games-Howell post-hoc test (does not assume equal variances, more powerful than Dunnett's T3); (2) Use Dunnett's T3 (very conservative); (3) Transform DV (log if variance increases with mean); (4) Use Welch's ANOVA + Games-Howell. Tukey HSD uses pooled variance estimate and is INVALID with heteroscedasticity.
How to check
Quick
Check n per group; if all equal → standard Tukey HSD; if unequal → Tukey-Kramer automatically applied by most software
Rigorous
Verify sample sizes; calculate harmonic mean of group sizes for Tukey-Kramer adjustment
If violated
Not a violation per se. Tukey-Kramer extension handles unequal n automatically in R (TukeyHSD), Python (pairwise_tukey), SPSS. Original Tukey HSD assumed equal n; Tukey-Kramer (1956) extended it to unequal n using harmonic mean. Modern software uses Tukey-Kramer by default. Severely unbalanced designs (max n / min n > 4) reduce power; consider recruiting to balance groups.
How to check
Quick
Boxplots by group; identify values >1.5 IQR beyond quartiles; check for extreme z-scores (|z| > 3) within each group
Rigorous
Standardized/studentized residuals (|r| > 3 suspect); Cook's distance (D > 1 or D > 4/n); leverage values; influence plots
If violated
First: verify data entry errors. If legitimate outliers: (1) Report results with and without outliers (sensitivity analysis); (2) Use robust methods (Kruskal-Wallis + Dunn); (3) Winsorize to 5th/95th percentiles (pre-specify); (4) Bootstrap CIs for pairwise comparisons; (5) Transform data if outliers due to skewness.
03Residual Forensics

Diagnostics

Checking residual plots and indices to examine model deviations and ensure standard error integrity.

Trust, but verify. The outliers often hold more truth than the averages.
System Health
Essential checks
  1. Omnibus ANOVA F-test (must be significant, p < .05)
  2. Levene's test or Brown-Forsythe test for homogeneity of variance (p > .05 required)
  3. Pairwise comparisons table with adjusted p-values
  4. 95% confidence intervals for mean differences
  5. Compact letter display (showing homogeneous groups)
Recommended checks
  1. Q-Q plots of residuals by group (normality check)
  2. Effect sizes (Cohen's d) for each pairwise comparison
  3. Forest plot showing all pairwise differences with CIs
  4. Boxplots by group to visualize differences and outliers
  5. Power analysis for pairwise comparisons (post-hoc power)
  6. Residual diagnostics from ANOVA model
  7. Bootstrap confidence intervals (1000-2000 iterations)
  8. Descriptive statistics table (M, SD, n per group)
  9. Interaction plot showing group means with error bars
  10. Homogeneity of variance plot (spread vs level)
04Live Instances

Applied Minds

Review concrete study examples, data layout guidelines, and copy executable syntax scripts.

Theory is the map. Practice is the terrain. Simulation bridges the gap.
Applied Wisdom
Example 01

Diet Type and Weight Loss (4-group Design with All Pairwise Comparisons)

Research question: Which diet produces the most weight loss? Design: 12-week RCT with 4 groups (Low-carb n=28, Mediterranean n=28, Low-fat n=28, Control n=28). Outcome: Weight loss in kg from baseline (continuous). Conduct all k(k-1)/2 = 6 pairwise comparisons with FWER control.

DesignBetween-subjects RCT, balanced
GroupsLow-carb · Mediterranean · Low-fat · Control
Total n112
Outcome ScaleWeight loss (kg, continuous)
# Tukey HSD: All pairwise diet comparisons following ANOVA
# Example 1: 4 diet groups, 6 pairwise comparisons

# Load packages
library(car)           # Levene's test
library(effectsize)    # Effect sizes
library(tidyverse)     # Data manipulation
library(multcomp)      # Advanced contrasts
library(emmeans)       # Estimated marginal means

# Simulate realistic data (or load: data <- read.csv("diet_study.csv"))
set.seed(2025)
data <- data.frame(
  diet = rep(c("Low-carb", "Mediterranean", "Low-fat", "Control"), each=28),
  weight_loss = c(
    rnorm(28, mean=7.2, sd=3.1),   # Low-carb: M=7.2 kg
    rnorm(28, mean=6.5, sd=2.8),   # Mediterranean: M=6.5 kg
    rnorm(28, mean=4.3, sd=2.9),   # Low-fat: M=4.3 kg
    rnorm(28, mean=2.1, sd=2.5)    # Control: M=2.1 kg
  )
)

cat("=== TUKEY HSD POST-HOC ANALYSIS ===")
cat("\nAfter 12-week diet intervention: Which diets differ?\n\n")

# === STEP 1: Check Assumptions ===

cat("--- STEP 1: Assumption Checks ---\n")

# 1. Normality per group
cat("\n1. Normality(Shapiro-Wilk per group):\n")
by(data$weight_loss, data$diet, shapiro.test)
# All p > .05 → normality OK

# Q-Q plots
par(mfrow=c(2,2))
for (diet_type in c("Low-carb", "Mediterranean", "Low-fat", "Control")) {
  qqnorm(data$weight_loss[data$diet == diet_type], main=diet_type)
  qqline(data$weight_loss[data$diet == diet_type], col="red")
}
par(mfrow=c(1,1))

# 2. Homogeneity of variance (Levene's test - CRITICAL for Tukey HSD)
cat("\n2. Homogeneity of Variance(Levene's test):\n")
levene_result <- leveneTest(weight_loss ~ diet, data=data)
print(levene_result)
if (levene_result$`Pr(>F)`[1] < 0.05) {
  cat("\n*** WARNING: Unequal variances detected! Use Games-Howell instead. ***\n")
} else {
  cat("\n✓ Equal variances assumption met(p > .05). Tukey HSD is appropriate.\n")
}

# 3. Outliers
cat("\n3. Outliers Check:\n")
ggplot(data, aes(x=diet, y=weight_loss, fill=diet)) +
  geom_boxplot(alpha=0.7) +
  labs(title="Weight Loss by Diet Type\n(Check for outliers)",
       x="Diet Group", y="Weight Loss(kg)") +
  theme_classic() +
  theme(legend.position="none")

# === STEP 2: Descriptive Statistics ===

cat("\n--- STEP 2: Descriptive Statistics ---\n")
desc_stats <- data %>%
  group_by(diet) %>%
  summarise(n = n(),
            M = mean(weight_loss),
            SD = sd(weight_loss),
            SE = SD/sqrt(n),
            CI_lower = M - 1.96*SE,
            CI_upper = M + 1.96*SE)
print(desc_stats)

# === STEP 3: Run Omnibus ANOVA (prerequisite) ===

cat("\n--- STEP 3: Omnibus One-Way ANOVA ---\n")
anova_model <- aov(weight_loss ~ diet, data=data)
anova_summary <- summary(anova_model)
print(anova_summary)

# Extract F-statistic and p-value
f_stat <- anova_summary[[1]]$`F value`[1]
p_value <- anova_summary[[1]]$`Pr(>F)`[1]

if (p_value >= 0.05) {
  cat("\n*** STOP: ANOVA non-significant(p ≥ .05). Do NOT proceed to Tukey HSD. ***\n")
  cat("Conducting post-hoc tests after non-significant ANOVA inflates Type I error.\n")
  stop("ANOVA must be significant before post-hoc testing.")
} else {
  cat("\n✓ ANOVA is significant(p < .05). Proceed to Tukey HSD post-hoc tests.\n")
}

# Effect size
omega_sq <- omega_squared(anova_model)
cat("\nEffect size: ω² =", round(omega_sq$Omega2, 3))
if (omega_sq$Omega2 < 0.06) {
  cat(" (small)")
} else if (omega_sq$Omega2 < 0.14) {
  cat(" (medium)")
} else {
  cat(" (large)")
}
cat("\n")

# === STEP 4: Tukey HSD Post-hoc Test ===

cat("\n--- STEP 4: Tukey HSD Pairwise Comparisons ---\n")
cat("Number of pairwise comparisons: k(k-1)/2 = 4×3/2 = 6\n")
cat("Family-wise error rate(FWER) controlled at α = .05\n\n")

tukey_result <- TukeyHSD(anova_model, conf.level=0.95)
print(tukey_result)

# Extract pairwise comparisons
tukey_df <- as.data.frame(tukey_result$diet)
tukey_df$comparison <- rownames(tukey_df)
tukey_df <- tukey_df %>%
  mutate(sig = ifelse(`p adj` < 0.001, "***",
                      ifelse(`p adj` < 0.01, "**",
                             ifelse(`p adj` < 0.05, "*", "ns"))),
         cohen_d = diff / sqrt(sum(anova_model$residuals^2) / anova_model$df.residual))

cat("\nPairwise Comparisons Summary:\n")
print(tukey_df[, c("comparison", "diff", "lwr", "upr", "p adj", "sig")])

# === STEP 5: Effect Sizes for Pairwise Comparisons ===

cat("\n--- STEP 5: Cohen's d for Each Pairwise Comparison ---\n")

# Calculate pooled SD from ANOVA
MSE <- sum(anova_model$residuals^2) / anova_model$df.residual
pooled_sd <- sqrt(MSE)

# Cohen's d for each comparison
tukey_df <- tukey_df %>%
  mutate(cohen_d = diff / pooled_sd,
         d_interpretation = case_when(
           abs(cohen_d) < 0.2 ~ "negligible",
           abs(cohen_d) < 0.5 ~ "small",
           abs(cohen_d) < 0.8 ~ "medium",
           TRUE ~ "large"
         ))

cat("\nEffect Sizes:\n")
print(tukey_df[, c("comparison", "diff", "cohen_d", "d_interpretation", "p adj")])

# === STEP 6: Compact Letter Display ===

cat("\n--- STEP 6: Compact Letter Display(Homogeneous Groups) ---\n")
cat("Groups sharing a letter are NOT significantly different.\n\n")

library(multcomp)
cld_result <- cld(glht(anova_model, linfct=mcp(diet="Tukey")))
print(cld_result)

# Add letters to descriptive stats
cld_letters <- data.frame(
  diet = names(cld_result$mcletters$Letters),
  letter = cld_result$mcletters$Letters
)
desc_stats_cld <- left_join(desc_stats, cld_letters, by="diet")
print(desc_stats_cld)

# === STEP 7: Bootstrap Confidence Intervals ===

cat("\n--- STEP 7: Bootstrap Confidence Intervals(1500 iterations) ---\n")

set.seed(2025)
n_boot <- 1500
boot_diffs <- matrix(NA, nrow=n_boot, ncol=6)
comparisons <- combn(unique(data$diet), 2, simplify=FALSE)

for (i in 1:n_boot) {
  # Resample within each group
  boot_sample <- data %>%
    group_by(diet) %>%
    slice_sample(n=n(), replace=TRUE) %>%
    ungroup()
  
  # Calculate pairwise differences
  means_boot <- boot_sample %>%
    group_by(diet) %>%
    summarise(M = mean(weight_loss), .groups="drop")
  
  for (j in 1:6) {
    g1 <- comparisons[[j]][1]
    g2 <- comparisons[[j]][2]
    m1 <- means_boot$M[means_boot$diet == g1]
    m2 <- means_boot$M[means_boot$diet == g2]
    boot_diffs[i, j] <- m1 - m2
  }
}

# Calculate bootstrap CIs
boot_cis <- apply(boot_diffs, 2, quantile, probs=c(0.025, 0.975))
colnames(boot_cis) <- sapply(comparisons, function(x) paste(x, collapse=" - "))

cat("\nBootstrap 95% CIs(compare to Tukey CIs):\n")
print(round(boot_cis, 2))

# === STEP 8: Visualizations ===

cat("\n--- STEP 8: Visualizations ---\n")

# 8a. Bar plot with compact letters
ggplot(desc_stats_cld, aes(x=reorder(diet, -M), y=M, fill=diet)) +
  geom_bar(stat="identity", width=0.6, alpha=0.8) +
  geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width=0.2) +
  geom_text(aes(label=letter), vjust=-0.5, size=6, fontface="bold") +
  labs(title="Weight Loss by Diet Type(12-week intervention)",
       subtitle="Bars with different letters differ significantly(Tukey HSD, α=.05)",
       x="Diet Group", y="Mean Weight Loss(kg) ± 95% CI") +
  scale_fill_brewer(palette="Set2") +
  theme_classic() +
  theme(legend.position="none",
        plot.title = element_text(face="bold", size=14))

# 8b. Forest plot of pairwise differences
tukey_df$comparison_clean <- gsub("-", " vs ", tukey_df$comparison)

ggplot(tukey_df, aes(x=diff, y=reorder(comparison_clean, diff))) +
  geom_vline(xintercept=0, linetype="dashed", color="gray50") +
  geom_errorbarh(aes(xmin=lwr, xmax=upr), height=0.2, size=1) +
  geom_point(aes(color=sig), size=4) +
  scale_color_manual(values=c("***"="red", "**"="orange", "*"="yellow", "ns"="gray"),
                     name="Significance") +
  labs(title="Forest Plot: All Pairwise Comparisons(Tukey HSD)",
       subtitle="Error bars = 95% confidence intervals",
       x="Mean Difference in Weight Loss(kg)",
       y="Pairwise Comparison") +
  theme_minimal() +
  theme(plot.title = element_text(face="bold"))

# 8c. Interaction plot
ggplot(desc_stats, aes(x=diet, y=M, group=1)) +
  geom_line(size=1.2, color="steelblue") +
  geom_point(size=4, color="darkblue") +
  geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width=0.2) +
  labs(title="Group Means with 95% Confidence Intervals",
       x="Diet Type", y="Mean Weight Loss(kg)") +
  theme_classic()

# === STEP 9: APA-Style Reporting ===

cat("\n--- STEP 9: APA-Style Results ---\n\n")
cat(paste0(
  "A one-way ANOVA was conducted to compare weight loss across four diet interventions.\n",
  "Data met assumptions of normality(Shapiro-Wilk p > .05 for all groups) and homogeneity\n",
  "of variance(Levene's test, F(", anova_summary[[1]]$Df[1], ", ", anova_summary[[1]]$Df[2], ") = ",
  round(levene_result$`F value`[1], 2), ", p = ", round(levene_result$`Pr(>F)`[1], 3), ").\n\n",
  "There was a significant effect of diet type on weight loss, F(", anova_summary[[1]]$Df[1], ", ",
  anova_summary[[1]]$Df[2], ") = ", round(f_stat, 2), ", p < .001, ω² = ",
  round(omega_sq$Omega2, 2), " (large effect).\n\n",
  "Post-hoc comparisons using Tukey HSD indicated:\n",
  "• Low-carb(M = ", round(desc_stats$M[desc_stats$diet=="Low-carb"], 1), ", SD = ",
  round(desc_stats$SD[desc_stats$diet=="Low-carb"], 1), ") produced significantly greater weight loss than\n",
  "  Low-fat(M = ", round(desc_stats$M[desc_stats$diet=="Low-fat"], 1), ", SD = ",
  round(desc_stats$SD[desc_stats$diet=="Low-fat"], 1), "), p < .001, d = ",
  round(abs(tukey_df$cohen_d[grepl("Low-carb.*Low-fat", tukey_df$comparison)]), 2), ",\n",
  "  and Control(M = ", round(desc_stats$M[desc_stats$diet=="Control"], 1), ", SD = ",
  round(desc_stats$SD[desc_stats$diet=="Control"], 1), "), p < .001, d = ",
  round(abs(tukey_df$cohen_d[grepl("Low-carb.*Control", tukey_df$comparison)]), 2), ".\n",
  "• Mediterranean diet showed similar patterns.\n",
  "• No significant difference between Low-carb and Mediterranean diets(p = ",
  round(tukey_df$`p adj`[grepl("Mediterranean.*Low-carb", tukey_df$comparison)], 3), ").\n\n",
  "These findings suggest low-carb and Mediterranean diets are superior to low-fat and\n",
  "control conditions for weight loss, with large effect sizes(d > 0.8)."
))

cat("\n\n=== ANALYSIS COMPLETE ===")
Interpretation Blueprint

F(3, 108) = 42.3, p < .001, ω² = .53 (large effect). Tukey HSD revealed: (1) Low-carb and Mediterranean diets produced significantly greater weight loss than Low-fat and Control (all p < .001, d > 1.0); (2) No difference between Low-carb and Mediterranean (p = .47); (3) Low-fat superior to Control (p = .003, d = 0.74). Compact letter display: Low-carb/Mediterranean (group 'a'), Low-fat (group 'b'), Control (group 'c'). Family-wise error rate maintained at α = .05 across all 6 comparisons.

05Tactical Pivots

Alternatives

Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.

When the path is blocked, pivot. Rigor is not rigidity; it is the intelligent adaptation to reality.
Adaptive Strategy
Measurement Precision Ladder Ideal · Continuous / Interval Pairs
Ratio
Maintain Tukey logic. The most powerful strike for pairwise mean comparison if variances are equal.
Peak Signal
Interval
Ideal for Primary Comparison. Ensure cell sizes are balanced to maximize the alpha shield.
Standard Precision
Ordinal / Nominal
Abandon Tukey. Use Dunn's Test or pairwise categorical strikes with Bonferroni protection.
Identity Loss
Temporal Trajectory Audit Post-Hoc Convergence Snapshot
Static Pairwise
Cross-sectional audit.
Stay with Tukey HSD. Find the definitive 'Clinical Winner' among groups.
Repeated Pairs
Trajectory flips.
Pivot to Bonferroni-corrected Paired T-Tests or EMM temporal contrasts.
Adaptive Technical Safeguards · adaptive safeguards
heterogeneous variance
  • Games-Howell Strike — The mandatory alternative when group spreads are unequal.
  • Dunnett's T3 — A robust choice for very small samples with unequal variance.
unbalanced cell sizes
  • Tukey-Kramer Adjustment — Automatic extension to handle groups with differing N.
  • Scheffé Test — A more conservative strike for complex, non-pairwise contrasts.
normality violated
  • Dunn's Test — The non-parametric equivalent for pairwise rank-sum comparison.
06Adjusted Comparisons

Post-hoc

Group mean comparisons and correction controls (e.g. Tukey HSD, Bonferroni) to protect against Family-Wise Error Rates.

The omnibus test opens the door; post-hoc analysis explores the room.
Forensic Detail
Adjusted Comparisons

Post-hoc pairwise tests defined for this model.

Interpretation Guidelines

No specific guidelines provided.

07Standardized scale impact

Effect Size

Understanding effect sizes (e.g., Cohen's d, Partial Eta-Squared) and clinical impact benchmarks.

Significance is noise. Magnitude is the signal. Measure the impact, not just the probability.
Impact Magnitude

Standardized mean difference for each pair. Small: 0.2, Medium: 0.5, Large: 0.8 (Cohen, 1988)

Proportion of variance explained by grouping variable. Small: .01, Medium: .06, Large: .14

d = (M_i - M_j) / SD_pooled, where SD_pooled = sqrt(MSE from ANOVA)

Recommended Metric: Report Cohen's d for each significant pairwise comparison, plus ω² from omnibus ANOVA
Small
0.2
Medium
0.5
Large
0.8
0.50
Report Cohen's d for each significant pairwise comparison, plus ω² from omnibus ANOVA
Recommended Measure
3
Available Metrics
ReportUse Report Cohen's d for each significant pairwise comparison, plus ω² from omnibus ANOVA to represent clinical impact magnitude.
08Statistical Power

Sample Size

Guidelines for minimum sample requirements and power analysis parameters.

An underpowered study is an ethical failure. Respect the data by collecting enough of it.
Power Protocol
Floor Requirements

At least 10-15 observations per group for Tukey HSD to control FWER

Effect SizeParametersRequired n
Small Effectα=.05, power=.80n ≈ 64 per group
Medium Effectα=.05, power=.80n ≈ 26 per group
Large Effectα=.05, power=.80n ≈ 14 per group
G*Power StrategyUse G*Power: F-test → ANOVA (fixed effects, omnibus). Then estimate post-hoc power for pairwise comparisons based on expected Cohen's d
09APA narrative blueprint

Reporting

How to compile statistical results into publication prose matching APA and journal style guides.

Data does not speak for itself. It requires a translator. Be clear, be precise, be honest.
Narrative Arc
Worked APA paragraph example
Following a significant omnibus one-way ANOVA, F(3, 108) = 42.3, p < .001, ω² = .53 (large effect), post-hoc pairwise comparisons were conducted using Tukey HSD to control family-wise error rate at α = .05. Low-carb (M = 7.2, SD = 3.1) and Mediterranean (M = 6.5, SD = 2.8) diets produced significantly greater weight loss than Low-fat (M = 4.3, SD = 2.9) and Control (M = 2.1, SD = 2.5) groups (all p < .001, Cohen's d range: 0.74-1.85). No significant difference was found between Low-carb and Mediterranean diets (p = .47, d = 0.23). Compact letter display: Low-carb/Mediterranean (a), Low-fat (b), Control (c). These findings suggest low-carb and Mediterranean diets are superior for weight loss over 12 weeks.
Reusable template

Following a significant omnibus one-way ANOVA, F(df_between, df_within) = X.XX, p < .XXX, ω² = .XX, post-hoc pairwise comparisons were conducted using Tukey HSD to control family-wise error rate at α = .05. If unequal n: The Tukey-Kramer adjustment was applied for unequal sample sizes. Describe key findings: Group A (M = X.XX, SD = X.XX) differed significantly from Group B (M = X.XX, SD = X.XX), p < .XXX, Cohen's d = X.XX interpret: small/medium/large effect. Report all significant comparisons, or use compact letter display: Compact letter display: groups sharing a letter are not significantly different (α = .05).

Essential statistics to report
  • Statement that ANOVA was significant (prerequisite)
  • All pairwise mean differences with 95% CIs
  • Adjusted p-values for each comparison
  • Effect sizes (Cohen's d) for significant pairs
  • Descriptive statistics per group (M, SD, n)
  • Statement about FWER control at α = .05
  • Compact letter display (optional but recommended)
  • Statement about assumption checks
10Exhibit Builder

Manuscript Lab

Copy standard summary tables and forensic reporting grids to outline analysis details.

Table 1: Tukey's HSD Post-hoc Comparisons across Treatment Groups
ComparisonDiff (M1-M2)SE95% CI (Lower)95% CI (Upper)p-adj
Method A vs. Control12.42.18.216.6< .001
Method B vs. Control8.52.14.312.7.004
Method A vs. Method B3.92.1-0.38.1.082
Note. Critical Value (q) = 3.42. Reporting Adjusted p-values for all-pairwise comparisons.
Method A vs B (p=.082)Identifies the 'Threshold of Superiority'. While both methods beat the control, Method A is not significantly better than Method B, suggesting either would be effective.
Header glossary

The 'Shielded' p-value. Corrected for multiple comparisons to ensure that the total chance of a Type I error across all 3 tests remains exactly 5%.

Tukey Adjusted Intervals. If the range excludes ZERO, the difference is statistically significant.

11Algorithmic Logic

Command Center

Syntax libraries and function parameters for executing calculations in stats packages.

Code is the modern laboratory. Clean execution ensures reproducible discovery.
Execution Engine
# 1. Execute Tukey HSD
TukeyHSD(aov(score ~ group, data = df))

# 2. Advanced EMMs method (Preferred)
model <- lm(score ~ group, data = df)
emmeans::emmeans(model, pairwise ~ group, adjust = 'tukey')

# 3. Visualize Group Mean Separation
plot(emmeans::emmeans(model, ~ group), comparisons = TRUE)
Library stack
R
statsemmeansggplot2
Python
statsmodels.stats.multicomp
Elite Forensic Strike

Tukey assumes equal sample sizes and equal variances. If your groups are unbalanced, use the 'Tukey-Kramer' adjustment. If variances are unequal, deploy the 'Games-Howell' test.

# Automated Post-hoc Selection
rstatix::tukey_hsd(df, score ~ group)
12The Over-adjustment Trap

Common Mistakes

Analytical caveats and corrections to maintain modeling integrity.

Wisdom is learning from the failures of others. Anticipate the error before it occurs.
Defensive Logic
Why it's wrong
Post-hoc tests should only follow a significant omnibus ANOVA F-test. Conducting post-hoc tests after non-significant ANOVA inflates Type I error rate by 'double-dipping' - testing multiple specific hypotheses when the global test failed. This violates the logic of the omnibus-then-post-hoc approach designed to control FWER.
The correction
ALWAYS run ANOVA first and check p < α. If ANOVA is non-significant (p ≥ .05), STOP and report 'no significant group differences detected'. Only proceed to Tukey HSD if F-test p < .05. Exception: If you have planned/a priori contrasts (specified before data collection), you may conduct those specific tests without requiring significant ANOVA, but use Bonferroni or Holm correction and clearly justify the a priori rationale.
Why it's wrong
Tukey HSD assumes homogeneity of variances and uses a pooled variance estimate (MSE from ANOVA). With heteroscedasticity, this pooled estimate is invalid, leading to incorrect standard errors, confidence intervals, and p-values. Type I error rates can be severely inflated (up to 15-20% instead of 5%) when comparing groups with large variances.
The correction
If Levene's test p < .05, DO NOT USE Tukey HSD. Instead: (1) BEST: Use Games-Howell post-hoc test (does not assume equal variances, uses Welch's approach for each pairwise comparison); (2) Use Dunnett's T3 (very conservative, good for small samples); (3) Transform DV (log, sqrt) if variance increases with mean, then recheck Levene's; (4) Use robust methods (bootstrapped CIs). Always check Levene's test BEFORE choosing post-hoc method.
Why it's wrong
Tukey HSD tests multiple pairwise comparisons (k(k-1)/2 pairs). Saying 'post-hoc tests were significant' without specifying WHICH pairs differ provides no useful information. Readers need to know: Group A > Group B but Group A ≈ Group C, etc. This is the entire point of post-hoc testing.
The correction
ALWAYS report specific pairwise comparisons with: (1) Mean differences (M_A - M_B); (2) 95% confidence intervals; (3) Adjusted p-values; (4) Effect sizes (Cohen's d) for each pair. Use compact letter display (groups sharing letters are not significantly different) or forest plot to visualize all comparisons. Example: 'Low-carb (M=7.2) > Control (M=2.1), p < .001, d=1.65'.
Why it's wrong
Tukey HSD and Bonferroni are both multiple comparison corrections but differ: (1) Tukey HSD uses studentized range distribution (q) and is optimal for ALL pairwise comparisons; (2) Bonferroni divides α by number of tests (α/k) and is more general but conservative. For all pairwise comparisons, Tukey HSD is MORE POWERFUL (higher statistical power) than Bonferroni. Bonferroni is better for planned contrasts or non-pairwise comparisons.
The correction
For ALL pairwise comparisons following ANOVA → use Tukey HSD (more powerful). For PLANNED/A PRIORI comparisons (specified before data collection) → use Bonferroni or Holm-Bonferroni. For comparisons to control group only → use Dunnett's test (most powerful for this design). Choose the method that matches your comparison structure for optimal power while controlling FWER.
Why it's wrong
Tukey HSD adjusted p-values already account for multiple comparisons and control FWER at α (typically .05). These are the 'final' p-values for decision-making. Treating p_adj = .06 or .08 as 'marginally significant' or 'trending' defeats the purpose of FWER control and inflates Type I error. The adjustment WAS DESIGNED to prevent this. There is no 'marginal significance' - either reject H₀ (p_adj < .05) or fail to reject (p_adj ≥ .05).
The correction
Use strict α threshold (typically .05) for adjusted p-values. If p_adj ≥ .05, conclude 'no significant difference detected'. Do not use terms like 'marginally significant', 'trending', or 'approaching significance'. If concerned about power, report effect sizes and confidence intervals to show magnitude regardless of p-value. Pre-register sample size based on power analysis to ensure adequate power for detecting meaningful effects.
Why it's wrong
Tukey HSD tests ALL k(k-1)/2 pairwise comparisons. If you have specific hypotheses planned before data collection (e.g., 'Theory predicts Group A > Group B > Group C'), testing all pairwise comparisons wastes statistical power. Planned contrasts are more powerful for testing specific hypotheses because they don't 'pay' the penalty for testing comparisons you're not interested in.
The correction
If you have planned comparisons specified a priori (before seeing data): (1) Use custom contrasts (linear, polynomial, or custom weights) with appropriate correction (Bonferroni, Holm); (2) Justify a priori rationale based on theory; (3) Limit to small number of focused tests. If exploratory (no specific predictions) → use Tukey HSD for all pairwise comparisons. Be transparent about whether comparisons were planned or post-hoc.
Why it's wrong
Homogeneity of variance (homoscedasticity) is a CRITICAL assumption for Tukey HSD. Without checking Levene's test, you don't know if Tukey HSD is valid. Using Tukey HSD with heteroscedasticity can inflate Type I error rate to 10-20% (instead of 5%) or reduce power, leading to false positives or false negatives. This is a fundamental validity check.
The correction
ALWAYS conduct Levene's test (or Brown-Forsythe test) BEFORE choosing post-hoc method. Report: 'Levene's test, F(k-1, N-k) = X.XX, p = .XXX'. Decision rule: If p > .05 → equal variances OK, use Tukey HSD. If p < .05 → unequal variances, use Games-Howell. Make this a standard part of your workflow. Check assumptions first, then select appropriate test.
Why it's wrong
Adjusted p-values tell you IF differences exist (statistical significance) but not HOW LARGE (practical/clinical significance). With large samples, tiny trivial differences can be 'significant' (p < .05). With small samples, large important differences may be non-significant. Effect sizes (Cohen's d, mean differences with CIs) quantify magnitude and are essential for interpreting practical importance and conducting meta-analyses.
The correction
ALWAYS report effect sizes for pairwise comparisons: (1) Cohen's d = (M_i - M_j) / SD_pooled, where SD_pooled = sqrt(MSE from ANOVA); (2) Interpret d: small (.2), medium (.5), large (.8); (3) Report 95% CIs for mean differences; (4) Discuss practical significance alongside statistical significance. Example: 'Group A (M=7.2) vs Group B (M=6.5), p = .08, d = 0.23 (small effect)' - non-significant but quantifies magnitude for future meta-analysis.
13Academic Lineage

References

Scholarly lineage and citation keys grounding the statistical framework.

We stand on the shoulders of giants. Honor the source of the method.
Academic Lineage
[1]
Tukey, J. W. (1949). Comparing individual means in the analysis of variance. Biometrics, 5(2), 99-114.
Original paper introducing Tukey's Honestly Significant Difference (HSD) test using studentized range distribution to control family-wise error rate for all pairwise comparisons.
doi: 10.2307/3001913
[2]
Kramer, C. Y. (1956). Extension of multiple range tests to group means with unequal numbers of replications. Biometrics, 12(3), 307-310.
Tukey-Kramer extension: adapts Tukey HSD for unequal sample sizes using harmonic mean. Now standard in statistical software.
doi: 10.2307/3001469
[3]
Games, P. A., & Howell, J. F. (1976). Pairwise multiple comparison procedures with unequal N's and/or variances: A Monte Carlo study. Journal of Educational Statistics, 1(2), 113-125.
Games-Howell test: post-hoc method for unequal variances. Superior to Tukey HSD when homoscedasticity violated. Recommended alternative.
doi: 10.3102/10769986001002113
[4]
Field, A. (2024). Discovering Statistics Using R (6th ed.). Sage Publications.
Comprehensive textbook covering Tukey HSD (Chapter 12), assumptions, effect sizes, and when to use alternatives (Games-Howell, Bonferroni). Excellent for understanding FWER control.
[5]
Maxwell, S. E., Delaney, H. D., & Kelley, K. (2017). Designing Experiments and Analyzing Data: A Model Comparison Perspective (3rd ed.). Routledge.
Advanced treatment of multiple comparisons, planned vs post-hoc contrasts, and power analysis for pairwise comparisons. Essential for understanding contrast coding.
[6]
Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society: Series B, 57(1), 289-300.
Alternative to FWER control: False Discovery Rate (FDR) methods. Less conservative than Tukey HSD for exploratory analyses with many comparisons. Use Benjamini-Hochberg when FDR control preferred over FWER.
doi: 10.1111/j.2517-6161.1995.tb02031.x
[7]
Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum Associates.
Classic reference for Cohen's d interpretation (small/medium/large: .2/.5/.8) and power analysis for multiple comparisons. Essential for sample size planning.
An omnibus F-test is only a permission slip. Tukey HSD is the actual audit that identifies the true signal in the categorical crowd.
The Interpretive Rigor Directive
statminds · TukeyMind reference · v2.2 · updated 2026-01-1715 of 15 sections