EuraStudy
Notes/Statistics/Analysis of variance
Notes · StatisticsUK · A-Levels

Analysis of variance

This topic uses one-way analysis of variance (ANOVA) to test whether several population means are equal. It partitions the total variation into between-groups and within-groups components, builds the ANOVA table of sums of squares, mean squares and the F-statistic, compares it with the F-distribution, and interprets the outcome, its assumptions and an effect size.

5 sections·~12 min reading time·3 competencies·Level Standard 1 · Advanced 4

T·171717 / 18
Exam profile
AO1 · Build an ANOVA table and compute the F-statisticAO2 · Use the F-distribution and interpret the outcomeAO3 · Apply one-way ANOVA to compare groups and comment on assumptions and effect size
Operators:testcalculatepartitiondetermineconcludecomment

basic level

One-way ANOVA is principally full A-Level (Paper 3) content within the statistical-enquiry strand.

higher level

The full A-Level expects the partition of variation, the ANOVA table, the F-test, its assumptions and an effect-size interpretation.

Depth

Reading depth: In depth

Text

Text size: Standard

Contents · 5 sections▾
  1. Analysis of variance
    • 01Comparing several means◐
    • 02Partitioning the sum of squares●
    • 03The ANOVA table and the F-statistic●
    • 04The F-test, assumptions and conclusions●
    • 05Effect size and interpretation●
§ 01

Comparing several means#

●●○StandardLPPearson Edexcel 9ST0, Topic 17 (Paper 3)

Comparative box plots of three groups

Response by groupBox plot: response, Data: Group A: min 5, Q1 6, Md 7, Q3 8, max 9; Group B: min 8, Q1 9, Md 10, Q3 11, max 12; Group C: min 11, Q1 12, Md 13, Q3 14, max 1568101214Group AGroup BGroup Cresponse
Fig. 1Three groups with medians (and means) 7, 10, 13 and similar spread; the separation suggests the means differ.

Key points

When three or more groups are to be compared, running many two-sample ttt-tests is a mistake: each test carries a chance of a Type I error, and doing several inflates the overall false-positive rate. Analysis of variance solves this with a SINGLE test of the null hypothesis that all the group means are equal, H0H_0H0​: μ1=μ2=⋯=μk\mu_1 = \mu_2 = \cdots = \mu_kμ1​=μ2​=⋯=μk​, against the alternative that at least one mean differs.
The name is apt: ANOVA compares means by analysing VARIANCES. Its insight is that if the group means really are equal, the spread of the group means about the overall mean should be no larger than would be expected from the natural variation within the groups; if the group means differ, the between-group spread will be inflated. The test compares these two sources of variation.
The box plots below show three groups with medians (and means) 7, 10 and 13 and similar spreads. The clear separation of the boxes relative to their widths is visual evidence that the group means differ — precisely the comparison ANOVA formalises by contrasting the variation BETWEEN the groups with the variation WITHIN them.
One-way ANOVA has a single factor (the grouping variable) with several levels (the groups), and one measured response. It generalises the two-sample ttt-test to more than two groups, and reduces to it when there are exactly two. Recognising this structure — one factor, several groups, one response — signals that ANOVA is the appropriate analysis.
H0:μ1=μ2=⋯=μkagainstH1:at least one mean differsH_0: \mu_1 = \mu_2 = \cdots = \mu_k \quad\text{against}\quad H_1: \text{at least one mean differs}H0​:μ1​=μ2​=⋯=μk​againstH1​:at least one mean differs

The ANOVA hypotheses

A single test of equality of all group means, avoiding many pairwise tests.

Worked example

Setting up an ANOVA

Three fertilisers are compared for crop yield across independent plots. State the hypotheses and the structure of the analysis.

  1. 01Factor and levels

    The single factor is fertiliser, with three levels (the three fertilisers); the response is yield.

  2. 02Hypotheses

    H0H_0H0​: μ1=μ2=μ3\mu_1 = \mu_2 = \mu_3μ1​=μ2​=μ3​ against H1H_1H1​: at least one mean yield differs.

  3. 03Method

    Use one-way ANOVA, comparing between-group and within-group variation in a single test.

Result: One-way ANOVA tests H0H_0H0​: μ1=μ2=μ3\mu_1 = \mu_2 = \mu_3μ1​=μ2​=μ3​ against 'at least one differs', avoiding multiple pairwise tests.

Exam focus

  • State the ANOVA hypotheses (all means equal versus at least one differs).
  • Explain why a single ANOVA is preferred to many pairwise ttt-tests.

Typical mistakes

  • Running multiple two-sample ttt-tests and inflating the Type I error rate.
  • Writing H1H_1H1​ as 'all means differ' rather than 'at least one differs'.

Active revision

Explain why comparing four teaching methods with six separate two-sample ttt-tests is statistically unsound, and what should be done instead.

Active recall

Recall the key points — then reveal.

Sources: Pearson Edexcel Level 3 Advanced GCE in Statistics (9ST0) Specification (Pearson Edexcel)

§ 02

Partitioning the sum of squares#

●●●AdvancedLPPearson Edexcel 9ST0, Topic 17 (Paper 3)

Key points

ANOVA splits the total variation in the data into two additive parts. The total sum of squares SST=∑∑(xij−xˉ)2\text{SST} = \sum\sum (x_{ij} - \bar{x})^2SST=∑∑(xij​−xˉ)2 measures the spread of every observation about the grand mean xˉ\bar{x}xˉ. It decomposes as SST=SSB+SSW\text{SST} = \text{SSB} + \text{SSW}SST=SSB+SSW, where SSB is the between-groups sum of squares and SSW the within-groups sum of squares.
The between-groups sum of squares SSB=∑ni(xˉi−xˉ)2\text{SSB} = \sum n_i(\bar{x}_i - \bar{x})^2SSB=∑ni​(xˉi​−xˉ)2 measures how far the GROUP means xˉi\bar{x}_ixˉi​ lie from the grand mean, weighted by group size; it is large when the groups are well separated. The within-groups sum of squares SSW=∑∑(xij−xˉi)2\text{SSW} = \sum\sum (x_{ij} - \bar{x}_i)^2SSW=∑∑(xij​−xˉi​)2 measures the spread of observations about their OWN group mean; it reflects the natural, unexplained variation.
For three groups A = {5, 7, 9}, B = {8, 10, 12}, C = {11, 13, 15}, the group means are 7, 10, 13 and the grand mean is 10. Then SSB=3[(7−10)2+(10−10)2+(13−10)2]=3(9+0+9)=54\text{SSB} = 3[(7-10)^2 + (10-10)^2 + (13-10)^2] = 3(9 + 0 + 9) = 54SSB=3[(7−10)2+(10−10)2+(13−10)2]=3(9+0+9)=54, and SSW=8+8+8=24\text{SSW} = 8 + 8 + 8 = 24SSW=8+8+8=24 (each group contributes (−2)2+02+22=8(-2)^2 + 0^2 + 2^2 = 8(−2)2+02+22=8), giving SST=54+24=78\text{SST} = 54 + 24 = 78SST=54+24=78.
The logic of the test is now visible: SSB captures variation EXPLAINED by the grouping, while SSW captures variation WITHIN groups that the grouping does not explain. If H0H_0H0​ is true, both estimate the same underlying variance; if the group means differ, SSB is inflated relative to SSW. Turning the sums of squares into comparable variance estimates is the next step.
SST=SSB+SSW,SSB=∑ni(xˉi−xˉ)2,SSW=∑∑(xij−xˉi)2\text{SST} = \text{SSB} + \text{SSW}, \quad \text{SSB} = \sum n_i(\bar{x}_i - \bar{x})^2, \quad \text{SSW} = \sum\sum (x_{ij} - \bar{x}_i)^2SST=SSB+SSW,SSB=∑ni​(xˉi​−xˉ)2,SSW=∑∑(xij​−xˉi​)2

Partition of the total sum of squares

Total variation splits into between-groups (explained) and within-groups (unexplained).

Worked example

Partitioning the variation

For A = {5, 7, 9}, B = {8, 10, 12}, C = {11, 13, 15} (group means 7, 10, 13; grand mean 10), find SSB, SSW and SST.

  1. 01Between groups

    SSB=3[(7−10)2+(10−10)2+(13−10)2]=3(9+0+9)=54\text{SSB} = 3[(7-10)^2 + (10-10)^2 + (13-10)^2] = 3(9 + 0 + 9) = 54SSB=3[(7−10)2+(10−10)2+(13−10)2]=3(9+0+9)=54.

  2. 02Within groups

    Each group gives (−2)2+02+22=8(-2)^2 + 0^2 + 2^2 = 8(−2)2+02+22=8, so SSW=8×3=24\text{SSW} = 8 \times 3 = 24SSW=8×3=24.

  3. 03Total

    SST=54+24=78\text{SST} = 54 + 24 = 78SST=54+24=78.

    SST=SSB+SSW=54+24=78\text{SST} = \text{SSB} + \text{SSW} = 54 + 24 = 78SST=SSB+SSW=54+24=78

Result: SSB=54\text{SSB} = 54SSB=54, SSW=24\text{SSW} = 24SSW=24 and SST=78\text{SST} = 78SST=78.

Exam focus

  • Compute SSB and SSW and verify that they sum to SST.
  • Interpret SSB as explained and SSW as unexplained variation.

Typical mistakes

  • Forgetting the group-size weight nin_ini​ in the between-groups sum of squares.
  • Measuring within-group deviations from the grand mean instead of the group mean.

Active revision

For groups A = {5, 7, 9}, B = {8, 10, 12}, C = {11, 13, 15}, compute SSB, SSW and SST.

Active recall

Recall the key points — then reveal.

Sources: Pearson Edexcel Level 3 Advanced GCE in Statistics (9ST0) Specification (Pearson Edexcel)

§ 03

The ANOVA table and the F-statistic#

●●●AdvancedLPPearson Edexcel 9ST0, Topic 17 (Paper 3)

The ANOVA table

One-way ANOVATable with 5 columns and 3 rows, Data: Source · SS · df · MS · F; Between groups · 54 · 2 · 27 · 6.75; Within groups · 24 · 6 · 4 · ; Total · 78 · 8 · · SOURCESSDFMSFBETWEEN GROUPS542276.75WITHIN GROUPS2464TOTAL788
Fig. 2One-way ANOVA table for the three-group data: F = 27/4 = 6.75 on (2, 6) degrees of freedom.

Key points

Each sum of squares is converted to a mean square by dividing by its degrees of freedom. With kkk groups and NNN observations in total, the between-groups degrees of freedom are k−1k - 1k−1 and the within-groups degrees of freedom are N−kN - kN−k. The mean squares are MSB=SSBk−1\text{MSB} = \dfrac{\text{SSB}}{k - 1}MSB=k−1SSB​ and MSW=SSWN−k\text{MSW} = \dfrac{\text{SSW}}{N - k}MSW=N−kSSW​, and the within-groups mean square MSW is an unbiased estimate of the common variance whether or not H0H_0H0​ is true.
The F-statistic is the ratio of these two mean squares, F=MSBMSWF = \dfrac{\text{MSB}}{\text{MSW}}F=MSWMSB​. Under H0H_0H0​ both mean squares estimate the same variance, so FFF is around 1; if the group means differ, MSB is inflated and FFF grows. The test is upper-tailed: only a large FFF is evidence against equality of means.
These results are laid out in the ANOVA table below. For the three-group data, MSB=542=27\text{MSB} = \dfrac{54}{2} = 27MSB=254​=27 and MSW=246=4\text{MSW} = \dfrac{24}{6} = 4MSW=624​=4, giving F=274=6.75F = \dfrac{27}{4} = 6.75F=427​=6.75 on (2,6)(2, 6)(2,6) degrees of freedom. The table's structure — source, sum of squares, degrees of freedom, mean square, F — is the standard way to present the calculation.
The two degrees-of-freedom values, k−1k - 1k−1 and N−kN - kN−k, index the F-distribution used for the critical value and must be quoted in that order (numerator then denominator). Assembling the ANOVA table correctly, with each sum of squares divided by the right degrees of freedom, is the core computational skill of the topic.
MSB=SSBk−1,MSW=SSWN−k,F=MSBMSW\text{MSB} = \frac{\text{SSB}}{k - 1}, \quad \text{MSW} = \frac{\text{SSW}}{N - k}, \quad F = \frac{\text{MSB}}{\text{MSW}}MSB=k−1SSB​,MSW=N−kSSW​,F=MSWMSB​

Mean squares and the F-statistic

The F-statistic is the ratio of between- to within-groups mean squares, on (k−1,N−k)(k-1, N-k)(k−1,N−k) df.

Worked example

Building the ANOVA table

With SSB=54\text{SSB} = 54SSB=54, SSW=24\text{SSW} = 24SSW=24, three groups of three, complete the mean squares and the F-statistic.

  1. 01Degrees of freedom

    Between: k−1=2k - 1 = 2k−1=2; within: N−k=9−3=6N - k = 9 - 3 = 6N−k=9−3=6.

  2. 02Mean squares

    MSB=542=27\text{MSB} = \dfrac{54}{2} = 27MSB=254​=27; MSW=246=4\text{MSW} = \dfrac{24}{6} = 4MSW=624​=4.

  3. 03F-statistic

    F=274=6.75F = \dfrac{27}{4} = 6.75F=427​=6.75 on (2,6)(2, 6)(2,6) degrees of freedom.

    F=274=6.75F = \frac{27}{4} = 6.75F=427​=6.75

Result: MSB=27\text{MSB} = 27MSB=27, MSW=4\text{MSW} = 4MSW=4 and F=6.75F = 6.75F=6.75 on (2,6)(2, 6)(2,6) degrees of freedom.

Exam focus

  • Complete an ANOVA table, dividing each sum of squares by its degrees of freedom.
  • Compute F=MSBMSWF = \frac{\text{MSB}}{\text{MSW}}F=MSWMSB​ and state the (k−1,N−k)(k - 1, N - k)(k−1,N−k) degrees of freedom.

Typical mistakes

  • Dividing a sum of squares by the wrong degrees of freedom.
  • Quoting the F degrees of freedom in the wrong order (denominator before numerator).

Active revision

Given SSB=54\text{SSB} = 54SSB=54 (k=3k = 3k=3) and SSW=24\text{SSW} = 24SSW=24 (N=9N = 9N=9), complete the ANOVA table and find FFF.

Active recall

Recall the key points — then reveal.

Sources: Pearson Edexcel Level 3 Advanced GCE in Statistics (9ST0) Specification (Pearson Edexcel)

§ 04

The F-test, assumptions and conclusions#

●●●AdvancedLPPearson Edexcel 9ST0, Topic 17 (Paper 3)

F-distribution with the critical region

Function graph, F(2, 6) = (1+x/3)^(-4)Graph of F(2, 6), y-intercept at y = 1, decreasing, on the interval x from 0 to 8123456780.20.40.60.815.14 (5%)F(2, 6)densityF value
Fig. 3F-distribution (2, 6): reject beyond the critical value 5.14; the test statistic 6.75 lies in this tail.

Key points

The F-statistic is compared with the critical value of the F-distribution on (k−1,N−k)(k - 1, N - k)(k−1,N−k) degrees of freedom at the chosen significance level. The F-distribution, shown below for (2,6)(2, 6)(2,6) degrees of freedom, lives on the positive axis and is right-skewed; the rejection region is the upper tail beyond the critical value. For the three-group data, F=6.75F = 6.75F=6.75 exceeds the 5% critical value 5.14, so H0H_0H0​ is rejected.
The test rests on three assumptions: the observations are independent, each group is (approximately) normally distributed, and the groups share a common variance (homogeneity of variance). ANOVA is fairly robust to mild departures, especially with equal group sizes, but strong skew or very unequal variances undermine it, in which case a transformation or a non-parametric alternative is preferable.
The conclusion must be stated in context and, crucially, with the right scope. Rejecting H0H_0H0​ says that at least one group mean differs from the others — it does NOT identify WHICH, nor how many. Determining which specific groups differ requires further (post-hoc) comparisons; the ANOVA is the omnibus test that licenses looking further.
As with every test, the F-test detects a difference, not a cause, and statistical significance is distinct from practical importance. A very large sample can make a trivial difference in means significant, so the size of the effect — pursued in the next section — should always accompany the verdict for an honest interpretation.
Reject H0  ⟺  F>Fcrit(k−1, N−k, α);6.75>5.14⇒means differ\text{Reject } H_0 \iff F > F_{\text{crit}}(k-1,\, N-k,\, \alpha); \qquad 6.75 > 5.14 \Rightarrow \text{means differ}Reject H0​⟺F>Fcrit​(k−1,N−k,α);6.75>5.14⇒means differ

The F-test decision

Upper-tailed: a large F rejects equality of means; the test does not say which groups differ.

Worked example

Completing the F-test

For the three-group data, F=6.75F = 6.75F=6.75 on (2,6)(2, 6)(2,6) degrees of freedom. Using the 5% critical value 5.14, conclude the test.

  1. 01Compare

    6.75>5.146.75 > 5.146.75>5.14, so the statistic lies in the rejection region.

  2. 02Decision

    Reject H0H_0H0​ at the 5% level.

    6.75>5.14⇒reject H06.75 > 5.14 \Rightarrow \text{reject } H_06.75>5.14⇒reject H0​
  3. 03Conclude in context

    There is sufficient evidence at the 5% level that at least one group mean differs.

  4. 04Scope

    The test does not identify which groups differ; further comparisons would be needed, and the assumptions of normality and equal variance should be checked.

Result: F=6.75>5.14F = 6.75 > 5.14F=6.75>5.14, so reject H0H_0H0​: at least one group mean differs (without saying which).

Exam focus

  • Compare F with the critical value on (k−1,N−k)(k - 1, N - k)(k−1,N−k) degrees of freedom.
  • State the assumptions and the correct scope of the conclusion (at least one mean differs).

Typical mistakes

  • Concluding which specific groups differ directly from a significant ANOVA.
  • Ignoring the normality and equal-variance assumptions.

Active revision

Given F=6.75F = 6.75F=6.75 on (2,6)(2, 6)(2,6) degrees of freedom with a 5% critical value of 5.14, complete the F-test with a contextual conclusion.

Active recall

Recall the key points — then reveal.

Sources: Pearson Edexcel Level 3 Advanced GCE in Statistics (9ST0) Specification (Pearson Edexcel)

§ 05

Effect size and interpretation#

●●●AdvancedLPPearson Edexcel 9ST0, Topic 17 (Paper 3)

Key points

A significant F-test tells us the means differ, but not by how much relative to the overall variation. An effect size answers that. The simplest is η2=SSBSST\eta^2 = \dfrac{\text{SSB}}{\text{SST}}η2=SSTSSB​, the PROPORTION of the total variation explained by the grouping. For the three-group data, η2=5478=0.69\eta^2 = \dfrac{54}{78} = 0.69η2=7854​=0.69, so about 69% of the variation in the response is explained by the group — a large effect.
Effect size and significance are complementary. Significance (the p-value or the F-comparison) indicates whether an effect is likely to be real; effect size indicates whether it is large enough to matter. A small η2\eta^2η2 can be statistically significant in a very large study yet be of little practical importance, while a large η2\eta^2η2 in a small study may be practically striking even if only marginally significant.
Reporting both is best practice: 'the group means differ significantly (F(2,6)=6.75F(2, 6) = 6.75F(2,6)=6.75, p<0.05p < 0.05p<0.05), with the grouping explaining about 69% of the variation'. This pairs the statistical verdict with a measure of its magnitude, exactly the honest, informative reporting the enquiry cycle demands and the higher marks reward.
Finally, the interpretation returns to the substantive question and its limits: the ANOVA establishes that a difference in means exists and how large it is, but not its cause, and not which specific groups differ. Acknowledging these boundaries — association not causation, omnibus not pairwise — completes a mature analysis and frames what further investigation would be needed.
η2=SSBSST=5478=0.69\eta^2 = \frac{\text{SSB}}{\text{SST}} = \frac{54}{78} = 0.69η2=SSTSSB​=7854​=0.69

Effect size (eta squared)

The proportion of total variation explained by the grouping; here about 69%.

Worked example

Effect size for the ANOVA

For the three-group data with SSB=54\text{SSB} = 54SSB=54 and SST=78\text{SST} = 78SST=78, compute η2\eta^2η2 and interpret it alongside the significant F-test.

  1. 01Compute

    η2=5478=0.69\eta^2 = \dfrac{54}{78} = 0.69η2=7854​=0.69 (2 s.f.).

  2. 02Interpret

    About 69% of the total variation is explained by the group, a large effect.

    η2=5478=0.69\eta^2 = \frac{54}{78} = 0.69η2=7854​=0.69
  3. 03Report together

    The means differ significantly (F(2,6)=6.75F(2,6) = 6.75F(2,6)=6.75, p<0.05p < 0.05p<0.05) and the effect is large (η2=0.69\eta^2 = 0.69η2=0.69), so the difference is both real and substantial.

Result: η2=0.69\eta^2 = 0.69η2=0.69: the grouping explains about 69% of the variation, a large and practically important effect.

Exam focus

  • Compute the effect size η2=SSBSST\eta^2 = \frac{\text{SSB}}{\text{SST}}η2=SSTSSB​ and interpret it.
  • Distinguish statistical significance from practical importance.

Typical mistakes

  • Reporting significance alone with no measure of the size of the effect.
  • Treating a significant result as automatically important regardless of effect size.

Active revision

For SSB=54\text{SSB} = 54SSB=54 and SST=78\text{SST} = 78SST=78, compute the effect size and comment on its practical importance.

Active recall

Recall the key points — then reveal.

Sources: GCE AS and A level subject content (Statistics) (Department for Education / Ofqual)

Contents

Section -- / 05

    • 01Comparing several means◐
    • 02Partitioning the sum of squares●
    • 03The ANOVA table and the F-statistic●
    • 04The F-test, assumptions and conclusions●
    • 05Effect size and interpretation●

0/5 Read

From notes into training

Analysis of variance

Reinforce this topic with matching tasks from the question bank.

~12
min
3
Competencies
Practise

References & sources

Sources

Pearson Edexcel

  • Pearson Edexcel Level 3 Advanced GCE in Statistics (9ST0) Specification

Department for Education / Ofqual

  • GCE AS and A level subject content (Statistics)

Previous topic

One and two sample non-parametric tests

Next topic

Experimental design

EuraStudy·Notes T·17·MMXXVI

Carry on to the next topic — your learning path is kept.