Analysis of Variance
One-way classified data
With k groups and N observations in all, grand total G: the correction factor is CF = G²/N; total SS = Σx² − CF; between-groups SS = Σ(Tᵢ²/nᵢ) − CF, where Tᵢ is the total of group i; within-groups (error) SS = total SS − between SS. Degrees of freedom: between k − 1, within N − k, total N − 1.
| Method | Observations | Total Tᵢ | Mean |
|---|---|---|---|
| A | 5, 7, 6 | 18 | 6 |
| B | 8, 9, 10 | 27 | 9 |
| C | 4, 5, 6 | 15 | 5 |
| Source | SS | d.f. | MS | F |
|---|---|---|---|---|
| Between methods | 26 | 2 | 13 | 13 |
| Within (error) | 6 | 6 | 1 | — |
| Total | 32 | 8 | — | — |
G = 60, N = 9, CF = 3600/9 = 400; Σx² = 432, so total SS = 32; between SS = (18² + 27² + 15²)/3 − 400 = 26; within SS = 6. F = 13/1 = 13 on (2, 6) d.f. The 5% table value of F(2, 6) is 5.14, so the three methods differ significantly.
Two-way classified data (one observation per cell)
When the data are classified by two factors — say r treatments (rows) and c blocks (columns), one observation in each cell — the total SS splits three ways: rows SS = ΣRᵢ²/c − CF, columns SS = ΣCⱼ²/r − CF, and error SS = total SS − rows SS − columns SS. Degrees of freedom: rows r − 1, columns c − 1, error (r − 1)(c − 1), total rc − 1. Each factor gets its own F against the error mean square.
| Source | SS | d.f. | MS | F |
|---|---|---|---|---|
| Methods (rows) | 26 | 2 | 13 | 39 |
| Blocks (columns) | 4.67 | 2 | 2.33 | 7 |
| Error | 1.33 | 4 | 0.33 | — |
| Total | 32 | 8 | — | — |
Column totals are 17, 21 and 22, so columns SS = (289 + 441 + 484)/3 − 400 ≈ 4.67 and error SS ≈ 1.33. Taking the block effect out of the error made the error mean square smaller (0.33 against 1), which is exactly why a two-way layout is more sensitive than a one-way one when blocks really differ.
Exam traps and a quick revision
- Total SS = between SS + within SS (one-way); = rows + columns + error (two-way).
- One-way d.f.: k − 1, N − k, N − 1. Two-way: r − 1, c − 1, (r − 1)(c − 1), rc − 1.
- CF = G²/N is subtracted in every SS formula.
- F = MS(factor) ÷ MS(error); reject H₀ if F exceeds the table value.
- ANOVA assumes independence, normality and equal variances.
Key takeaways
- ANOVA tests the equality of several means at once with an F ratio.
- CF = G²/N; total SS = Σx² − CF; between SS = ΣTᵢ²/nᵢ − CF.
- One-way d.f.: between k − 1, within N − k.
- Two-way with one observation per cell has error d.f. (r − 1)(c − 1).
- Assumptions: independent observations, normal populations, equal variances.
Practice questions (10)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
Analysis of variance is used to test the hypothesis that:
Show answer
Answer: B — several population means are equal
Despite the name, ANOVA compares means: it uses the ratio of two variance estimates to decide whether three or more group means differ.In a one-way ANOVA with 4 groups and 20 observations in all, the degrees of freedom between and within groups are:
Show answer
Answer: D — 3 and 16
Between = k − 1 = 3, within = N − k = 16, and they add to the total N − 1 = 19. Using k and N themselves forgets that each estimated mean uses up one degree of freedom.In a one-way ANOVA the total sum of squares is 50 and the between-groups sum of squares is 30. The within-groups sum of squares is:
Show answer
Answer: A — 20
Total SS = between SS + within SS, so within SS = 50 − 30 = 20. Adding the two (80) or dividing them (1.67) treats the sums of squares as if they were not parts of one total.For 3 groups and 9 observations, the between-groups SS is 26 and the within-groups SS is 6. The F ratio is:
Show answer
Answer: B — 13
MS between = 26/2 = 13 and MS within = 6/6 = 1, so F = 13. Dividing the sums of squares directly gives 26/6 ≈ 4.33, which ignores the degrees of freedom.In a two-way ANOVA with 4 rows and 5 columns and one observation per cell, the error degrees of freedom are:
Show answer
Answer: C — 12
Error d.f. = (r − 1)(c − 1) = 3 × 4 = 12. Total d.f. = rc − 1 = 19 = 3 + 4 + 12.Which of the following is NOT an assumption of analysis of variance?
Show answer
Answer: A — the group means are equal
Equal means is the null hypothesis being tested, not an assumption. The assumptions are independence, normality and equal variances.Nine observations have a grand total of 60. The correction factor used in the ANOVA calculations is:
Show answer
Answer: B — 400
CF = G²/N = 3600/9 = 400. 3600 is G² before dividing, and 6.67 is the grand mean.In an ANOVA table the mean square between groups is 24 and the error mean square is 4. The F ratio is:
Show answer
Answer: C — 6
F = MS between ÷ MS error = 24/4 = 6. The factor's mean square goes on top; inverting gives 1/6, and adding or subtracting mean squares has no meaning in ANOVA.In a one-way ANOVA the calculated F is 2.1 and the 5% table value is 3.5. The conclusion is:
Show answer
Answer: A — H₀ is not rejected: the group means do not differ significantly
Reject H₀ only when the calculated F exceeds the table value. 2.1 < 3.5, so the differences between group means are within what chance explains.In a two-way ANOVA with 3 rows and 4 columns (one observation per cell), total SS = 40, rows SS = 15 and columns SS = 12. The F ratio for rows is about:
Show answer
Answer: D — 3.46
Error SS = 40 − 15 − 12 = 13 on (3 − 1)(4 − 1) = 6 d.f., so MSE ≈ 2.17. Rows MS = 15/2 = 7.5, and F = 7.5/2.17 ≈ 3.46.