One-Way ANOVA Explained: Comparing Means Across Multiple Groups

August 26, 2026
You already know how to compare two means with a t-test. But what happens when you need to compare three, four, or ten groups at once? Running t-tests on every pair inflates your error rate fast — and ANOVA is the tool built to solve that exact problem. The Statistics Made Simple Complete Bundle covers ANOVA in full, with a worked dataset from start to finish.

Suppose you want to test whether four different fertilizers produce different average crop yields. Your first instinct might be to run six separate t-tests — comparing fertilizer 1 vs 2, 1 vs 3, 1 vs 4, 2 vs 3, 2 vs 4, and 3 vs 4. This is a mistake, and not a small one. Each t-test carries a 5% chance of a false positive at α = 0.05; running six of them pushes your overall chance of at least one false positive well above 5% — a problem called the familywise error rate. Analysis of Variance (ANOVA) solves this by testing all groups simultaneously with a single test.

What Is ANOVA?

One-way ANOVA tests whether the means of three or more groups are equal, using a single categorical factor (in this example, “fertilizer type”) to define the groups. Despite the name “Analysis of Variance,” ANOVA is fundamentally a test about means — it just uses variance calculations as the mechanism to compare them, which is where the apparent contradiction in the name comes from.

The hypotheses are straightforward:

H₀: μ₁ = μ₂ = μ₃ = … = μk (all group means are equal)
H₁: at least one group mean is different

Notice that H₁ does not say all means differ — only that at least one does. A significant ANOVA result tells you a difference exists somewhere among the groups, but not which specific groups differ; that requires a follow-up post-hoc test, covered below.

The Logic: Between-Group vs Within-Group Variance

ANOVA works by splitting the total variability in the data into two sources. Between-group variance measures how much the group means differ from the overall (“grand”) mean — large if the groups are genuinely different. Within-group variance measures how much individual observations vary around their own group’s mean — this reflects natural random noise unrelated to the grouping factor.

The test statistic, called F, is the ratio of these two:

F = Between-group variance / Within-group variance

If the null hypothesis is true and all group means are genuinely equal, F should be close to 1 — between-group differences are no larger than you’d expect from random noise alone. If the group means genuinely differ, between-group variance will be inflated relative to within-group variance, pushing F well above 1.

Worked Example: Four Fertilizers

Suppose 4 plots are tested with each of 3 fertilizers (n = 3 per group, k = 3 groups for a simpler illustration), giving these crop yields (kg):

Fertilizer A Fertilizer B Fertilizer C
20, 22, 24 28, 30, 32 18, 20, 19

Group means: Ā = 22, B̄ = 30, C̄ = 19. Grand mean (all 9 values) = (22+30+19)/3 = 23.67.

Step 1: Sum of Squares Between (SSB) — how far each group mean is from the grand mean, weighted by group size:

SSB = 3(22−23.67)² + 3(30−23.67)² + 3(19−23.67)²
= 3(2.79) + 3(40.09) + 3(21.81) = 8.36 + 120.27 + 65.42 = 194.05

Step 2: Sum of Squares Within (SSW) — how far each individual value is from its own group’s mean:

Group A: (20−22)²+(22−22)²+(24−22)² = 4+0+4 = 8
Group B: (28−30)²+(30−30)²+(32−30)² = 4+0+4 = 8
Group C: (18−19)²+(20−19)²+(19−19)² = 1+1+0 = 2
SSW = 8+8+2 = 18

Step 3: Degrees of freedom and mean squares. df between = k−1 = 3−1 = 2. df within = N−k = 9−3 = 6.

MSB = SSB / dfbetween = 194.05 / 2 = 97.03
MSW = SSW / dfwithin = 18 / 6 = 3.00

Step 4: The F-statistic.

F = MSB / MSW = 97.03 / 3.00 ≈ 32.3

Chapter 13 of Statistics Made Simple builds the ANOVA table step by step on a larger dataset, with the full F-distribution critical value table included as an appendix.

The ANOVA Table

Source SS df MS F
Between 194.05 2 97.03 32.3
Within 18.00 6 3.00
Total 212.05 8

The critical value for F with dfbetween=2 and dfwithin=6 at α=0.05 is approximately 5.14. Since 32.3 > 5.14, we reject H₀ — there is strong evidence that at least one fertilizer produces a different mean yield than the others.

Statistics Made Simple
From SSB to F-statistic, every step shown.
246 pages of explanation and 1,569 practice questions with fully worked answers, plus R and Excel workshops that build the ANOVA table automatically so you can check your hand calculations.

Get both books — $16, save $5 →

Which Groups Actually Differ? Post-Hoc Tests

A significant ANOVA result only tells you that somewhere among the groups, a difference exists — it does not identify which pairs of groups differ. To find that out, you run a post-hoc test after a significant ANOVA, such as Tukey’s HSD (Honestly Significant Difference) test, which compares every pair of groups while controlling the familywise error rate — exactly the problem that running raw pairwise t-tests would have created in the first place. This two-step approach (ANOVA first, post-hoc only if significant) is standard practice and prevents the error-rate inflation described at the start of this post.

Assumptions of ANOVA

Independence: observations within and across groups must be independent of each other. Normality: the data within each group should be approximately normally distributed (ANOVA is fairly robust to mild violations, especially with larger sample sizes). Homogeneity of variance: the groups should have roughly equal variances — formally tested with Levene’s test. When this assumption fails badly, an alternative like Welch’s ANOVA, which doesn’t assume equal variances, is more appropriate.

Common Mistakes

Running multiple t-tests instead of ANOVA. As shown at the start, this inflates the familywise error rate and is the single most common reason to reach for ANOVA in the first place.

Interpreting a significant F as meaning all groups differ. A significant ANOVA only establishes that at least one group differs from at least one other — identifying which requires a post-hoc test.

Skipping the post-hoc test after a significant result. Reporting “ANOVA was significant” without following up leaves the actual research question — which fertilizer is best? — unanswered.

Test Yourself
Select an answer to see if you’re right, and why.
Why not just run separate t-tests on every pair of groups instead of ANOVA?

✗ Not quite — t-tests can technically be run on any pair of groups; the issue isn’t that they’re impossible, it’s what happens when you run many of them.

✓ Correct — each t-test carries its own chance of a false positive, and running several compounds that risk across the whole set of comparisons, well above your chosen α.

✗ Not quite — t-tests compare numeric means, the same kind of data ANOVA uses. That’s not the distinguishing issue here.

✗ Not quite — computational speed isn’t the reason; the statistical validity problem (error-rate inflation) is what actually matters here.
A one-way ANOVA produces a significant F-statistic. What can you conclude?

✗ Not quite — a significant F only shows that at least one difference exists somewhere, not that all pairs differ.

✓ Correct — this is exactly what a significant ANOVA tells you. Identifying which specific group(s) differ requires a post-hoc test like Tukey’s HSD.

✗ Not quite — unequal variance is an assumption violation checked separately (e.g. with Levene’s test), not what a significant F-statistic itself indicates.

✗ Not quite — a significant result says nothing about sample size adequacy on its own.
If the null hypothesis of ANOVA is true, what would you expect of the F-statistic?

✗ Not quite — F is a ratio of two variances, both positive quantities, so it doesn’t approach zero even under the null.

✓ Correct — under H₀, between-group and within-group variance should be similar in size (both just reflect random noise), making their ratio close to 1.

✗ Not quite — F is a ratio of two sums of squared terms, both non-negative, so F itself can never be negative.

✗ Not quite — F doesn’t equal n; it’s a ratio of mean squares, which depends on the actual data values, not just the count of observations.

Practice Question

Three teaching methods are compared using test scores from 4 students each. SSB = 150, SSW = 60, k = 3 groups, N = 12 total students. Calculate F and state whether H₀ would be rejected at α = 0.05 (critical value ≈ 4.26 for df = 2, 9).

Answer: dfbetween = k−1 = 2. dfwithin = N−k = 12−3 = 9.

MSB = 150/2 = 75. MSW = 60/9 = 6.67.

F = 75 / 6.67 ≈ 11.24

Since 11.24 > 4.26, we reject H₀ — there is significant evidence that mean test scores differ across at least one of the three teaching methods. A post-hoc test would be needed next to identify which method(s) differ.

Building an ANOVA table from raw data by hand takes practice to get comfortable with. The Statistics Made Simple Practice Questions workbook has a full set of ANOVA problems with every SSB/SSW/F calculation shown step by step.

References

1. Moore, D.S., McCabe, G.P. and Craig, B.A. (2021) Introduction to the Practice of Statistics. W.H. Freeman.
2. Field, A. (2018) Discovering Statistics Using IBM SPSS Statistics. SAGE.
3. Fisher, R.A. (1925) Statistical Methods for Research Workers. Oliver and Boyd.
4. Triola, M.F. (2022) Elementary Statistics. Pearson.
5. Tukey, J.W. (1949) ‘Comparing Individual Means in the Analysis of Variance’, Biometrics, 5(2), pp. 99–114.

Related Posts

Skewness and Kurtosis: Measuring the Shape of a Distribution

Two datasets can share the exact same mean and standard deviation and still look completely different when plotted — because mean and variance say nothing about the shape of a distribution. Skewness and kurtosis fill that gap, and they matter far beyond the...

Skewness and Kurtosis: Measuring the Shape of a Distribution

Two datasets can share the exact same mean and standard deviation and still look completely different when plotted — because mean and variance say nothing about the shape of a distribution. Skewness and kurtosis fill that gap, and they matter far beyond the...