Statistics & Probability · Grade 12 and undergraduate
One-Way ANOVA: Comparing Several Means at Once
Quick answer
To compare more than two group means, analysis of variance (ANOVA) runs one test instead of many t-tests. It splits the total variation into variation between the group means and variation within the groups. If the groups really have the same mean, the two mean squares estimate the same thing and their ratio F = MSB/MSW is near 1. A large F, with a small p-value from the F distribution, is evidence that at least one mean differs. ANOVA does not say which one.
What you'll learn
- State the hypotheses of a one-way ANOVA
- Compute the between-group and within-group sums of squares
- Build an ANOVA table and the F statistic
- Interpret the p-value and explain why ANOVA replaces multiple t-tests
Many groups, one test
Three study methods are tried by students each, with these test scores:
| Method | Scores | Mean |
|---|---|---|
| A | 3, 5, 4, 6, 7 | 5 |
| B | 6, 8, 7, 9, 10 | 8 |
| C | 4, 6, 5, 6, 4 | 5 |
Do the methods differ? One-way ANOVA tests against “at least one mean differs”. It compares two kinds of variation:
- Between groups: how far the group means sit from the grand mean, .
- Within groups: how far scores sit from their own group mean, .
Dividing each by its degrees of freedom gives mean squares, and their ratio is
Why the ratio of variances compares means
If all groups share one mean, the group means differ only by chance, and MSB estimates the same spread as MSW. Then hovers near . When the true means differ, the group means spread out more than chance allows, MSB grows, and becomes large. The p-value is the chance of an at least this large when is true, read from the F distribution with and degrees of freedom.
Worked examples
Common mistakes
Practice problems
-
MSB and MSW . Find .
Answer
Full solution
.
-
Four groups of subjects each are compared. Give both degrees of freedom.
Answer
and
Full solution
and .
-
In Example 2, check that SSB + SSW equals the total sum of squares.
Answer
Full solution
Summing over all scores also gives .
-
An ANOVA gives . What does that suggest?
Answer
No evidence the means differ.
Full solution
Between-group variation is no larger than within-group variation, as expected under .
-
With and degrees of freedom, has p-value about . What is the decision at ?
Answer
Reject .
Full solution
, so at least one mean differs.
-
The critical value of with and degrees of freedom is about . Is significant?
Answer
Yes
Full solution
, matching the small p-value.
-
Five groups are compared with -tests on every pair at . How many tests is that?
Answer
Full solution
pairs, which multiplies the chance of a false alarm.
-
A student rejects in Example 2 and concludes all three methods give different mean scores. Correct it.
Answer
ANOVA shows only that at least one mean differs.
Full solution
Here A and C have the same sample mean; B is the one that stands apart.
Frequently asked questions
What does one-way ANOVA test?
H₀: all k group means are equal, against Hₐ: at least one mean differs.
What is the F statistic?
F = MSB/MSW, the between-group mean square over the within-group mean square. Values near 1 are consistent with H₀; large values are evidence against it.
What are the degrees of freedom?
k − 1 between groups and N − k within groups, where k is the number of groups and N the total sample size.
Why not run t-tests on every pair?
Each test has its own chance of a false alarm. With three tests at α = 0.05, the chance of at least one false rejection grows to about 14%.
What conditions does ANOVA need?
Independent random samples or random assignment, roughly normal groups, and similar standard deviations across groups.