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 55 students each, with these test scores:

MethodScoresMean
A3, 5, 4, 6, 75
B6, 8, 7, 9, 108
C4, 6, 5, 6, 45

Do the methods differ? One-way ANOVA tests H0:μA=μB=μCH_0: \mu_A = \mu_B = \mu_C against “at least one mean differs”. It compares two kinds of variation:

  • Between groups: how far the group means sit from the grand mean, SSB=∑ni(xˉi−xˉ)2\text{SSB} = \sum n_i(\bar{x}_i - \bar{x})^2.
  • Within groups: how far scores sit from their own group mean, SSW=∑∑(x−xˉi)2\text{SSW} = \sum\sum (x - \bar{x}_i)^2.

Dividing each by its degrees of freedom gives mean squares, and their ratio is

F=MSBMSW=SSB/(k−1)SSW/(N−k)F = \frac{\text{MSB}}{\text{MSW}} = \frac{\text{SSB}/(k - 1)}{\text{SSW}/(N - k)}

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 FF hovers near 11. When the true means differ, the group means spread out more than chance allows, MSB grows, and FF becomes large. The p-value is the chance of an FF at least this large when H0H_0 is true, read from the F distribution with k−1k - 1 and N−kN - k degrees of freedom.

Worked examples

Common mistakes

Practice problems

  1. MSB =12= 12 and MSW =4= 4. Find FF.

    Answer

    33

    Full solution

    F=124F = \tfrac{12}{4}.

  2. Four groups of 88 subjects each are compared. Give both degrees of freedom.

    Answer

    33 and 2828

    Full solution

    k−1=3k - 1 = 3 and N−k=32−4=28N - k = 32 - 4 = 28.

  3. In Example 2, check that SSB + SSW equals the total sum of squares.

    Answer

    30+24=5430 + 24 = 54

    Full solution

    Summing (x−6)2(x - 6)^2 over all 1515 scores also gives 5454.

  4. An ANOVA gives F=0.9F = 0.9. 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 H0H_0.

  5. With 22 and 1515 degrees of freedom, F=5F = 5 has p-value about 0.0220.022. What is the decision at α=0.05\alpha = 0.05?

    Answer

    Reject H0H_0.

    Full solution

    0.022<0.050.022 < 0.05, so at least one mean differs.

  6. The 5%5\% critical value of FF with 22 and 1212 degrees of freedom is about 3.893.89. Is F=7.5F = 7.5 significant?

    Answer

    Yes

    Full solution

    7.5>3.897.5 > 3.89, matching the small p-value.

  7. Five groups are compared with tt-tests on every pair at α=0.05\alpha = 0.05. How many tests is that?

    Answer

    1010

    Full solution

    (52)=10\binom{5}{2} = 10 pairs, which multiplies the chance of a false alarm.

  8. A student rejects H0H_0 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.