One-way ANOVA and Tukey’s multiple comparisons: a worked example
To compare three or more group means, run a one-way ANOVA to ask whether any difference exists, then a multiple-comparison test such as Tukey’s to show which groups differ, rather than repeating t tests. This worked example shows where every number in the ANOVA table comes from.
Run a one-way ANOVA on your own dataPaste a table from Excel: F, P, η², Tukey or Dunnett comparisons and a results sentence (Welch and Kruskal–Wallis too).Calculate →What one-way ANOVA tests
One-way ANOVA tests whether the means of three or more levels of a single factor (e.g. treatment) are all equal. The F ratio compares the spread between group means with the spread within groups.
- F = between-group mean square ÷ within-group mean square; about 1 if there is no difference
- ANOVA says only that some difference exists; multiple comparisons say where
- Three repeated t tests raise the chance of a false positive to up to about 14% (1 − 0.953)
- Assumptions: independence, roughly normal groups, similar spread
Worked example
Control, Drug A and Drug B, five samples each.
| Group | Values | Mean | SD |
|---|---|---|---|
| Control | 12.1, 13.4, 11.8, 12.9, 13.0 | 12.64 | 0.666 |
| Drug A | 14.2, 15.1, 13.6, 14.8, 15.5 | 14.64 | 0.750 |
| Drug B | 13.0, 14.1, 12.6, 13.9, 14.4 | 13.60 | 0.765 |
1. Between-group sum of squares
2. Within-group sum of squares
3. Mean squares and F
Divide each sum of squares by its degrees of freedom (between = groups − 1 = 2; within = N − groups = 15 − 3 = 12).
| Source | SS | df | MS | F | P |
|---|---|---|---|---|---|
| Between groups | 10.005 | 2 | 5.003 | 9.43 | 0.0035 |
| Within groups (residual) | 6.364 | 12 | 0.530 | ||
| Total | 16.369 | 14 |
F(2, 12) = 5.003 ÷ 0.530 = 9.43, P = 0.0035: the three means are not all equal. Effect size η2 = SSbetween ÷ SStotal = 0.61.
Tukey’s multiple comparisons
Tukey’s test compares every pair of groups (three pairs here) while keeping the overall error rate at 5%, using the within-group mean square (0.530) from the ANOVA.
| Comparison | Difference | q | Tukey P | 95% CI | (For reference) uncorrected t test P |
|---|---|---|---|---|---|
| Control vs Drug A | 2.00 | 6.14 | 0.0025 | 0.77 to 3.23 | 0.0021 |
| Control vs Drug B | 0.96 | 2.95 | 0.135 | -0.27 to 2.19 | 0.067 |
| Drug A vs Drug B | -1.04 | 3.19 | 0.101 | -2.27 to 0.19 | 0.062 |
Only Control vs Drug A (difference 2.00) is significant. Uncorrected t tests give smaller P values; here the conclusion is the same, but with more comparisons the correction matters more. If the question is only “does each drug differ from control?”, Dunnett’s test is the better choice (Tukey vs Dunnett).
One-way ANOVA in Excel
Use Data → Data Analysis (Analysis ToolPak) → “Anova: Single Factor”, with groups in columns. The output shows SS, df, MS, F, P-value and F crit.
- Excel has no Tukey or other multiple-comparison test. Compute q with the formula above or use statistical software. Repeating the ToolPak t-test instead is wrong because nothing is corrected.
How to report it
See how to report statistics and significance asterisks. For two crossed factors (genotype × treatment), use two-way ANOVA.
Sources: Montgomery DC (2017) Design and Analysis of Experiments, 9th ed., Wiley; Hsu JC (1996) Multiple Comparisons: Theory and Methods, Chapman & Hall (Tukey’s method); Kramer CY (1956) Biometrics 12:307–310 (unequal n).
FAQ
If ANOVA is significant, do I know which groups differ?
No. ANOVA only says that at least one difference exists. Use Tukey’s, Dunnett’s or another multiple-comparison test to find which.
ANOVA was not significant but a Tukey comparison was. Is that possible?
Yes. Tukey’s and Dunnett’s tests control the error rate on their own and do not require a significant ANOVA. Report both.
Can group sizes differ?
Yes. ANOVA handles unequal n, and Tukey’s test becomes the Tukey–Kramer test. If both n and variances differ, consider Welch’s ANOVA with Games–Howell.
I only want to compare each group with control.
Use Dunnett’s test: fewer comparisons, more power than Tukey (see Tukey vs Dunnett).
What if the data are not normal?
Use the Kruskal–Wallis test with Dunn’s test, or transform the data (e.g. log) before ANOVA.
Related guides
Microsoft Excel is a trademark of Microsoft Corporation. Product and journal names are trademarks or registered trademarks of their respective owners.