This calculator helps you perform comprehensive pairwise comparisons between all group means after obtaining a significant ANOVA result. Tukey's HSD (Honestly Significant Difference) test is the gold standard for systematically examining every possible group pair while maintaining strict control over the familywise error rate, ensuring your findings are both thorough and statistically sound.
💡 Pro Tip: Use Tukey's HSD when you want to compare all groups to each other. If you only need to compare treatments to a control group, use ourDunnett's Test Calculatorfor more focused analysis. Always ensure your ANOVA is significant first!
Ready to discover which groups truly differ? or to see how it works, or upload your own data to uncover the specific patterns of differences across all your groups.
Tukey's HSD (Honestly Significant Difference) Test is a post-hoc test used after ANOVA to determine which specific groups differ from each other. It controls the family-wise error rate while conducting multiple pairwise comparisons.
Test Statistic:
Where:
Comparing three fertilizer treatments on plant growth (cm):
| Treatment A | Treatment B | Treatment C |
|---|---|---|
| 25 | 42 | 35 |
| 30 | 38 | 33 |
| 28 | 40 | 31 |
| 32 | 45 | 34 |
| 29 | 41 | 32 |
For , groups, :
(significant)
(significant)
(significant)
All pairwise comparisons show significant differences at . Treatment B produced significantly higher growth than both A and C, and Treatment C produced significantly higher growth than Treatment A.
Consider these alternatives:
Use TukeyHSD() function from base R or emmeans package for more advanced options including compact letter display (CLD).
library(emmeans)
library(tidyverse)
library(multcomp)
data <- tibble(
group = rep(c("A", "B", "C"), each = 5),
values = c(25, 30, 28, 32, 29, # Group A
42, 38, 40, 45, 41, # Group B
35, 33, 31, 34, 32) # Group C
) |>
mutate(group = as.factor(group))
data |>
group_by(group) |>
summarize(mean = mean(values), sd = sd(values), n = n())
aov_model <- aov(values ~ group, data = data)
summary(aov_model)
q <- qtukey(0.95, nmeans = 3, df = 12)
mse <- summary(aov_model)[[1]]["Residuals", "Mean Sq"]
hsd <- q * sqrt(mse / 5)
print(hsd)
emmeans_result <- emmeans(aov_model, "group")
pairs(emmeans_result, adjust = "tukey")
emmeans(aov_model, specs = ~ group) |>
cld()Use pairwise_tukeyhsd() function from statsmodels package to perform Tukey's HSD test in Python.
import pandas as pd
from statsmodels.stats.multicomp import pairwise_tukeyhsd
# Example data
group1 = [25, 30, 28, 32, 29]
group2 = [42, 38, 40, 45, 41]
group3 = [35, 33, 31, 34, 32]
# Create DataFrame
data = pd.DataFrame({
'values': group1 + group2 + group3,
'group': ['A']*5 + ['B']*5 + ['C']*5
})
# Perform Tukey's HSD
tukey = pairwise_tukeyhsd(
endog=data['values'],
groups=data['group'],
alpha=0.05
)
print(tukey)
# There is no package that provides CLD in Python similar to R's multcomp::cld()
# However, our calculator provides the same CLD output as R's multcomp::cld() with emmeans.This calculator helps you perform comprehensive pairwise comparisons between all group means after obtaining a significant ANOVA result. Tukey's HSD (Honestly Significant Difference) test is the gold standard for systematically examining every possible group pair while maintaining strict control over the familywise error rate, ensuring your findings are both thorough and statistically sound.
💡 Pro Tip: Use Tukey's HSD when you want to compare all groups to each other. If you only need to compare treatments to a control group, use ourDunnett's Test Calculatorfor more focused analysis. Always ensure your ANOVA is significant first!
Ready to discover which groups truly differ? or to see how it works, or upload your own data to uncover the specific patterns of differences across all your groups.
Tukey's HSD (Honestly Significant Difference) Test is a post-hoc test used after ANOVA to determine which specific groups differ from each other. It controls the family-wise error rate while conducting multiple pairwise comparisons.
Test Statistic:
Where:
Comparing three fertilizer treatments on plant growth (cm):
| Treatment A | Treatment B | Treatment C |
|---|---|---|
| 25 | 42 | 35 |
| 30 | 38 | 33 |
| 28 | 40 | 31 |
| 32 | 45 | 34 |
| 29 | 41 | 32 |
For , groups, :
(significant)
(significant)
(significant)
All pairwise comparisons show significant differences at . Treatment B produced significantly higher growth than both A and C, and Treatment C produced significantly higher growth than Treatment A.
Consider these alternatives:
Use TukeyHSD() function from base R or emmeans package for more advanced options including compact letter display (CLD).
library(emmeans)
library(tidyverse)
library(multcomp)
data <- tibble(
group = rep(c("A", "B", "C"), each = 5),
values = c(25, 30, 28, 32, 29, # Group A
42, 38, 40, 45, 41, # Group B
35, 33, 31, 34, 32) # Group C
) |>
mutate(group = as.factor(group))
data |>
group_by(group) |>
summarize(mean = mean(values), sd = sd(values), n = n())
aov_model <- aov(values ~ group, data = data)
summary(aov_model)
q <- qtukey(0.95, nmeans = 3, df = 12)
mse <- summary(aov_model)[[1]]["Residuals", "Mean Sq"]
hsd <- q * sqrt(mse / 5)
print(hsd)
emmeans_result <- emmeans(aov_model, "group")
pairs(emmeans_result, adjust = "tukey")
emmeans(aov_model, specs = ~ group) |>
cld()Use pairwise_tukeyhsd() function from statsmodels package to perform Tukey's HSD test in Python.
import pandas as pd
from statsmodels.stats.multicomp import pairwise_tukeyhsd
# Example data
group1 = [25, 30, 28, 32, 29]
group2 = [42, 38, 40, 45, 41]
group3 = [35, 33, 31, 34, 32]
# Create DataFrame
data = pd.DataFrame({
'values': group1 + group2 + group3,
'group': ['A']*5 + ['B']*5 + ['C']*5
})
# Perform Tukey's HSD
tukey = pairwise_tukeyhsd(
endog=data['values'],
groups=data['group'],
alpha=0.05
)
print(tukey)
# There is no package that provides CLD in Python similar to R's multcomp::cld()
# However, our calculator provides the same CLD output as R's multcomp::cld() with emmeans.