Analysis of Variance (ANOVA), due to R. A. Fisher (1925), is a statistical technique to test whether three or more population means are equal by partitioning the total variation in the data into components attributable to different sources.
The fundamental identity:
If the treatment SS is large compared to error SS, the means differ; this is tested by an F-ratio.
A \(t\)-test compares two means; for three or more, testing every pair separately inflates the chance of a false difference, and ANOVA tests them all at once. Fisher developed it in the 1920s for agricultural field trials. In his words, it is “the separation of the variance ascribable to one group of causes from the variance ascribable to other groups”.
The variation in any experiment has two kinds of cause:
Example. Four fertilisers are each applied to six plots of paddy and the yields recorded. ANOVA splits the total variation in the 24 yields into a part due to the fertilisers and a part due to chance, and asks whether the first is larger than the second can explain.
The F-test needs the third assumption above, a common variance \(\sigma^2\) in every group; the linear model below assumes it in writing \(D(y) = \sigma^2 I\).
To test \(H_0: \sigma_1^2 = \sigma_2^2 = \cdots = \sigma_k^2\) from \(k\) independent samples from normal populations, of sizes \(n_1, \ldots, n_k\) with \(N = \sum n_i\), let \(s_i^2\) be the variance of sample \(i\) (divisor \(n_i - 1\)) and
\[ s_p^2 = \frac{\sum_{i=1}^{k} (n_i - 1)\, s_i^2}{N - k} \]the pooled variance, which is the error mean square of the one-way ANOVA. Bartlett's statistic is
\[ \chi^2 = \frac{(N-k)\ln s_p^2 - \sum_{i=1}^{k} (n_i - 1)\ln s_i^2}{C}, \qquad C = 1 + \frac{1}{3(k-1)}\left(\sum_{i=1}^{k} \frac{1}{n_i - 1} - \frac{1}{N-k}\right), \]with natural logarithms. Under \(H_0\) it is approximately \(\chi^2\) with \(k - 1\) degrees of freedom, and \(H_0\) is rejected for large values.
Why it works. \(s_p^2\) is a weighted arithmetic mean of the \(s_i^2\), with weights \((n_i - 1)/(N - k)\), and \(\exp\!\big[\sum (n_i-1)\ln s_i^2/(N-k)\big]\) is their weighted geometric mean. The arithmetic mean is never smaller than the geometric mean, and the two are equal only when every \(s_i^2\) is the same; so the numerator is never negative and grows as the variances spread apart. \(C\) is a correction that brings the \(\chi^2\) approximation closer for small samples.
Caution. The test leans heavily on normality: a heavy-tailed population can make it reject even when the variances are equal. Check normality first.
Given. The outputs of machines A, B and C in Worked Problem 1 below: \(n_1 = 7\), \(n_2 = 5\), \(n_3 = 6\), \(N = 18\), \(k = 3\). Asked. Is the assumption of a common variance tenable at the 5% level?
Step 1 — the sample variances. From the totals in that problem, \(\sum (y - \bar y)^2 = \sum y^2 - T^2/n\):
\[ \begin{aligned} \text{A:}&\quad 3907 - 3889.286 = 17.714, &\quad s_1^2 &= 17.714/6 = 2.952; \\ \text{B:}&\quad 2430 - 2420 = 10, &\quad s_2^2 &= 10/4 = 2.500; \\ \text{C:}&\quad 3760 - 3750 = 10, &\quad s_3^2 &= 10/5 = 2.000. \end{aligned} \]Step 2 — the pooled variance. \(s_p^2 = (17.714 + 10 + 10)/15 = 37.714/15 = 2.514\), the error mean square of the ANOVA.
Step 3 — the numerator.
\[ \begin{aligned} (N-k)\ln s_p^2 &= 15 \times 0.92199 = 13.8298, \\ \sum (n_i - 1)\ln s_i^2 &= 6(1.08261) + 4(0.91629) + 5(0.69315) \\ &= 6.4957 + 3.6652 + 3.4657 = 13.6266, \\ \text{numerator} &= 13.8298 - 13.6266 = 0.2033. \end{aligned} \]Step 4 — the correction.
\[ C = 1 + \frac{1}{3 \times 2}\left(\frac16 + \frac14 + \frac15 - \frac1{15}\right) = 1 + \frac{0.55}{6} = 1.0917. \]Step 5 — the statistic and the decision. \(\chi^2 = 0.2033/1.0917 = 0.186\) on \(2\) degrees of freedom. The 5% point of \(\chi^2_2\) is \(5.991\), and \(0.186 \lt 5.991\), so do not reject \(H_0\) (the \(p\)-value is \(0.911\)).
Interpretation. Sample variances of 2.95, 2.50 and 2.00 differ no more than chance would make them, so the common-variance assumption behind the F-test of Worked Problem 1 is tenable.
Let \(X_1, \ldots, X_n\) be independent \(N(0, \sigma^2)\), and suppose
\[ \sum_{i=1}^n X_i^2 = Q_1 + Q_2 + \cdots + Q_k , \]where each \(Q_j\) is a quadratic form in the \(X_i\) with rank \(r_j\). Then \(Q_1/\sigma^2, \ldots, Q_k/\sigma^2\) are independent \(\chi^2\) variates with \(r_1, \ldots, r_k\) degrees of freedom if and only if \(r_1 + r_2 + \cdots + r_k = n\).
ANOVA uses it directly: the total sum of squares is split into pieces whose degrees of freedom add up to the total, so the pieces are independent chi-squares, and their mean squares can be compared by an F-ratio.
For \(n\) observations and \(m\) unknown parameters,
\[ y = A\beta + \varepsilon, \qquad y = \begin{bmatrix} y_1 \\ \vdots \\ y_n \end{bmatrix},\; A = \begin{bmatrix} a_{11} & \cdots & a_{1m} \\ \vdots & & \vdots \\ a_{n1} & \cdots & a_{nm} \end{bmatrix},\; \beta = \begin{bmatrix} \beta_1 \\ \vdots \\ \beta_m \end{bmatrix},\; \varepsilon = \begin{bmatrix} \varepsilon_1 \\ \vdots \\ \varepsilon_n \end{bmatrix}, \]with \(A\) a known \(n \times m\) matrix of coefficients, and
Then \(E(y_i) = a_{i1}\beta_1 + \cdots + a_{im}\beta_m\), \(\text{Var}(y_i) = \sigma^2\) and \(\text{Cov}(y_i, y_j) = 0\) for \(i \ne j\); \(D(y) = \sigma^2 I\) is the dispersion matrix of \(y\). Assumptions 1 and 2 are enough for least squares to give the best linear unbiased estimates; normality is added for the F-tests.
This unit uses the fixed effects model throughout.
One factor with \(k\) treatments (or levels). Within treatment \(i\), there are \(n_i\) observations. Total \(N = \sum n_i\).
with \(\sum_i n_i \alpha_i = 0\) and \(\epsilon_{ij} \sim N(0, \sigma^2)\) independently.
\(H_0: \alpha_1 = \alpha_2 = \cdots = \alpha_k = 0\) (all treatment means equal) vs \(H_1\): at least one differs.
Let \(T_i = \sum_j y_{ij}\) (treatment total), \(G = \sum_i T_i\) (grand total). Correction Factor \(C = G^2/N\).
| Source | SS | df | MS | F |
|---|---|---|---|---|
| Treatments | \(\text{SS}_{Tr}\) | \(k-1\) | \(\text{MS}_{Tr}\) | \(\text{MS}_{Tr}/\text{MS}_E\) |
| Error | \(\text{SS}_E\) | \(N-k\) | \(\text{MS}_E\) | — |
| Total | \(\text{SS}_T\) | \(N-1\) | — | — |
Reject \(H_0\) if \(F > F_{\alpha,\, k-1,\, N-k}\).
Yields (kg/plot) for 3 fertilizers, each in 4 plots:
| F1 | 22 | 26 | 24 | 28 |
|---|---|---|---|---|
| F2 | 30 | 34 | 32 | 36 |
| F3 | 20 | 22 | 24 | 22 |
\(T_1 = 100,\; T_2 = 132,\; T_3 = 88;\;G = 320;\; N = 12;\; C = 320^2/12 = 8533.33\).
\[ \begin{aligned} \sum y^2 &= 484 + 676 + 576 + 784 + 900 + 1156 + 1024 + 1296 + 400 + 484 \\ &\quad + 576 + 484 = 8840 \end{aligned} \].
\(\text{SS}_T = 8840 - 8533.33 = 306.67\).
\[ \begin{aligned} \text{SS}_{Tr} &= (100^2 + 132^2 + 88^2)/4 - 8533.33 = (10000 + 17424 + 7744)/4 - 8533.33 \\ &= 8792 - 8533.33 = 258.67 \end{aligned} \].
\(\text{SS}_E = 306.67 - 258.67 = 48.0\).
F = (258.67/2)/(48/9) = 129.33/5.33 = 24.25. df = (2, 9). \(F_{0.05, 2, 9} = 4.26\) ⇒ reject \(H_0\); fertilizers differ significantly.
Yields for 3 varieties: V1 (n₁=3): 20, 24, 22; V2 (n₂=4): 28, 30, 32, 34; V3 (n₃=2): 18, 20.
\(T_1 = 66, T_2 = 124, T_3 = 38, G = 228, N = 9, C = 228^2/9 = 5776\).
\(\sum y^2 = 400 + 576 + 484 + 784 + 900 + 1024 + 1156 + 324 + 400 = 6048\).
\(\text{SS}_T = 6048 - 5776 = 272\).
\(\text{SS}_{Tr} = 66^2/3 + 124^2/4 + 38^2/2 - 5776 = 1452 + 3844 + 722 - 5776 = 242\).
\(\text{SS}_E = 272 - 242 = 30\). df: treatment 2, error 6.
\(F = (242/2)/(30/6) = 121/5 = 24.2 > F_{0.05, 2, 6} = 5.14\) ⇒ reject \(H_0\).
Here \(\mu_i = \mu + \alpha_i\) is the mean of treatment \(i\), \(\mu = \frac1N\sum n_i\mu_i\), and \(\alpha_i = \mu_i - \mu\), so \(\sum n_i\alpha_i = \sum n_i\mu_i - N\mu = 0\). Minimise the error sum of squares \(E = \sum_i\sum_j (y_{ij} - \mu - \alpha_i)^2\):
\[ \frac{\partial E}{\partial \mu} = -2\sum_i\sum_j (y_{ij} - \mu - \alpha_i) = 0 \;\Longrightarrow\; N\bar y_{..} - N\mu - \sum n_i\alpha_i = 0 \;\Longrightarrow\; \hat\mu = \bar y_{..}, \] \[ \frac{\partial E}{\partial \alpha_i} = -2\sum_j (y_{ij} - \mu - \alpha_i) = 0 \;\Longrightarrow\; n_i\bar y_{i.} - n_i\mu - n_i\alpha_i = 0 \;\Longrightarrow\; \hat\alpha_i = \bar y_{i.} - \bar y_{..} . \]The residual is \(\hat\varepsilon_{ij} = y_{ij} - \hat\mu - \hat\alpha_i = y_{ij} - \bar y_{i.}\).
Write each observation as estimate plus residual: \(y_{ij} - \bar y_{..} = (\bar y_{i.} - \bar y_{..}) + (y_{ij} - \bar y_{i.})\). Squaring and summing over \(i\) and \(j\),
\[ \sum_i\sum_j (y_{ij} - \bar y_{..})^2 = \sum_i n_i(\bar y_{i.} - \bar y_{..})^2 + \sum_i\sum_j (y_{ij} - \bar y_{i.})^2 \] \[ + \; 2\sum_i (\bar y_{i.} - \bar y_{..})\sum_j (y_{ij} - \bar y_{i.}) . \]The last term is zero because \(\sum_j (y_{ij} - \bar y_{i.}) = n_i\bar y_{i.} - n_i\bar y_{i.} = 0\). So TSS = SST + SSE.
Degrees of freedom. TSS has \(N - 1\) (the \(N\) deviations satisfy \(\sum\sum (y_{ij} - \bar y_{..}) = 0\)); SST has \(k - 1\) (the \(k\) deviations satisfy \(\sum n_i(\bar y_{i.} - \bar y_{..}) = 0\)); SSE has \(N - k\) (its \(N\) deviations satisfy one constraint \(\sum_j (y_{ij} - \bar y_{i.}) = 0\) in each of the \(k\) groups). The degrees of freedom add up as the sums of squares do: \((k - 1) + (N - k) = N - 1\).
Shortcut formulas. Expanding the squares gives TSS \(= \sum\sum y_{ij}^2 - G^2/N\) and SST \(= \sum T_i^2/n_i - G^2/N\), where \(G^2/N\) is the correction factor.
Averaging the model gives \(\bar y_{i.} = \mu + \alpha_i + \bar\varepsilon_{i.}\) and \(\bar y_{..} = \mu + \bar\varepsilon_{..}\) (using \(\sum n_i\alpha_i = 0\)), with \(E(\bar\varepsilon_{i.}^2) = \sigma^2/n_i\) and \(E(\bar\varepsilon_{..}^2) = \sigma^2/N\). Then
\[ \text{SST} = \sum n_i\big[\alpha_i + (\bar\varepsilon_{i.} - \bar\varepsilon_{..})\big]^2, \qquad \sum n_i(\bar\varepsilon_{i.} - \bar\varepsilon_{..})^2 = \sum n_i\bar\varepsilon_{i.}^2 - N\bar\varepsilon_{..}^2 , \]and the cross term has expectation zero, so
\[ E(\text{SST}) = \sum n_i\alpha_i^2 + \sum n_i\frac{\sigma^2}{n_i} - N\frac{\sigma^2}{N} = \sum n_i\alpha_i^2 + (k-1)\sigma^2 . \]Similarly \(\text{SSE} = \sum\sum (\varepsilon_{ij} - \bar\varepsilon_{i.})^2\) \(= \sum\sum\varepsilon_{ij}^2 - \sum n_i\bar\varepsilon_{i.}^2\), so \(E(\text{SSE}) = N\sigma^2 - k\sigma^2 = (N-k)\sigma^2\). Dividing by the degrees of freedom,
\[ E(\text{MS}_{Tr}) = \sigma^2 + \frac{1}{k-1}\sum n_i\alpha_i^2, \qquad E(\text{MS}_E) = \sigma^2 . \]The error mean square estimates \(\sigma^2\) whatever the treatments do; the treatment mean square estimates \(\sigma^2\) only when \(H_0\) holds, and something larger otherwise. Under \(H_0\), by Cochran's theorem, \(\text{SST}/\sigma^2\) and \(\text{SSE}/\sigma^2\) are independent \(\chi^2_{k-1}\) and \(\chi^2_{N-k}\), so
\[ F = \frac{\text{SST}/(k-1)}{\text{SSE}/(N-k)} = \frac{\text{MS}_{Tr}}{\text{MS}_E} \sim F_{k-1,\,N-k} . \]Large values of \(F\) count against \(H_0\), so the test uses the upper tail only. An \(F\) below 1 is never significant, and the ratio is never turned upside down to make it exceed 1.
When \(H_0\) is rejected, the next question is which treatments differ. Two means differ significantly at level \(\alpha\) when their difference exceeds the critical difference (least significant difference)
\[ \text{CD} = t_{\alpha/2,\,N-k}\,\sqrt{\text{MS}_E\Big(\frac{1}{n_i} + \frac{1}{n_j}\Big)} \;=\; t_{\alpha/2,\,N-k}\,\sqrt{\frac{2\,\text{MS}_E}{n}} \;\text{ when every } n_i = n . \]This is the two-sample \(t\)-test with the pooled error mean square in place of \(\sigma^2\) (which is why \(t\), on the error degrees of freedom, and not \(z\)); \(t_{\alpha/2}\) is the two-tailed point.
Wording. A non-significant \(F\) means the data show no evidence of a difference; it does not prove the means equal. “Accept \(H_0\)” should always be read as “do not reject \(H_0\)”.
Two factors A (rows, \(r\) levels) and B (columns, \(c\) levels). Each combination has one observation \(y_{ij}\).
with \(\sum \alpha_i = 0,\; \sum \beta_j = 0,\; \epsilon_{ij} \sim N(0, \sigma^2)\).
Let \(R_i = \sum_j y_{ij}\) (row totals), \(C_j = \sum_i y_{ij}\) (column totals), \(G = \sum y_{ij}\), \(N = rc\), \(C = G^2/N\).
| Source | SS | df | MS | F |
|---|---|---|---|---|
| Rows | \(\text{SS}_R\) | \(r-1\) | \(\text{MS}_R\) | \(\text{MS}_R/\text{MS}_E\) |
| Columns | \(\text{SS}_C\) | \(c-1\) | \(\text{MS}_C\) | \(\text{MS}_C/\text{MS}_E\) |
| Error | \(\text{SS}_E\) | \((r-1)(c-1)\) | \(\text{MS}_E\) | — |
| Total | \(\text{SS}_T\) | \(N-1\) | — | — |
3 fertilizers (rows) × 4 varieties (columns). Yields:
| F\V | V1 | V2 | V3 | V4 | Row total |
|---|---|---|---|---|---|
| F1 | 10 | 12 | 14 | 16 | 52 |
| F2 | 14 | 16 | 18 | 20 | 68 |
| F3 | 8 | 10 | 12 | 14 | 44 |
| Col total | 32 | 38 | 44 | 50 | 164 |
\(N = 12, C = 164^2/12 = 2241.33\).
\[ \begin{aligned} \sum y^2 &= 100 + 144 + 196 + 256 + 196 + 256 + 324 + 400 + 64 + 100 \\ &\quad + 144 + 196 = 2376 \end{aligned} \].
\(\text{SS}_T = 2376 - 2241.33 = 134.67\).
\[ \begin{aligned} \text{SS}_R &= (52^2 + 68^2 + 44^2)/4 - 2241.33 = (2704 + 4624 + 1936)/4 - 2241.33 \\ &= 9264/4 - 2241.33 = 2316 - 2241.33 = 74.67 \end{aligned} \].
\[ \begin{aligned} \text{SS}_C &= (32^2 + 38^2 + 44^2 + 50^2)/3 - 2241.33 = 6904/3 - 2241.33 \\ &= 2301.33 - 2241.33 = 60 \end{aligned} \].
\(\text{SS}_E = 134.67 - 74.67 - 60 = 0\) (linear data give zero error). df: rows 2, cols 3, error 6.
4 students (rows) × 3 subjects (cols). \(\text{SS}_R = 70,\; \text{SS}_C = 30,\; \text{SS}_E = 60\). df: 3, 2, 6.
\(F_R = (70/3)/(60/6) = 23.33/10 = 2.33;\; F_{0.05, 3, 6} = 4.76\) ⇒ not significant (no evidence of a student effect).
\(F_C = (30/2)/(60/6) = 15/10 = 1.5;\; F_{0.05, 2, 6} = 5.14\) ⇒ not significant (no evidence of a subject effect).
Write \(k\) treatments (rows, \(i\)) and \(h\) varieties or blocks (columns, \(j\)), \(N = hk\); in the notation above \(r = k\), \(c = h\). With \(\sum\alpha_i = 0\) and \(\sum\beta_j = 0\), minimising \(\sum\sum (y_{ij} - \mu - \alpha_i - \beta_j)^2\) gives, exactly as in one-way,
\[ \hat\mu = \bar y_{..}, \qquad \hat\alpha_i = \bar y_{i.} - \bar y_{..}, \qquad \hat\beta_j = \bar y_{.j} - \bar y_{..}, \]and residual \(y_{ij} - \bar y_{i.} - \bar y_{.j} + \bar y_{..}\). Then
\[ y_{ij} - \bar y_{..} = (\bar y_{i.} - \bar y_{..}) + (\bar y_{.j} - \bar y_{..}) + (y_{ij} - \bar y_{i.} - \bar y_{.j} + \bar y_{..}), \]and on squaring and summing, all three cross products vanish (each contains a sum of deviations from a mean over a full row or column):
\[ \underbrace{\sum\sum (y_{ij} - \bar y_{..})^2}_{\text{TSS}} = \underbrace{h\sum_i (\bar y_{i.} - \bar y_{..})^2}_{\text{SST}} + \underbrace{k\sum_j (\bar y_{.j} - \bar y_{..})^2}_{\text{SSV}} \] \[ + \underbrace{\sum\sum (y_{ij} - \bar y_{i.} - \bar y_{.j} + \bar y_{..})^2}_{\text{SSE}} . \]Degrees of freedom: \(hk - 1\) \(= (k - 1) + (h - 1) + (h-1)(k-1)\), the error taking what is left over.
With \(\bar y_{i.} = \mu + \alpha_i + \bar\varepsilon_{i.}\), \(\bar y_{.j} = \mu + \beta_j + \bar\varepsilon_{.j}\), \(\bar y_{..} = \mu + \bar\varepsilon_{..}\) and \(E(\bar\varepsilon_{i.}^2) = \sigma^2/h\), \(E(\bar\varepsilon_{.j}^2) = \sigma^2/k\), \(E(\bar\varepsilon_{..}^2) = \sigma^2/hk\):
\[ E(\text{SST}) = h\sum\alpha_i^2 + (k-1)\sigma^2, \qquad E(\text{SSV}) = k\sum\beta_j^2 + (h-1)\sigma^2 . \]For the error, the residual equals \(\varepsilon_{ij} - \bar\varepsilon_{i.} - \bar\varepsilon_{.j} + \bar\varepsilon_{..}\); expanding its square and taking expectations term by term,
\[ E(\text{SSE}) = \big(hk + k + h + 1 - 2k - 2h\big)\sigma^2 = (h-1)(k-1)\sigma^2 . \]So \(\text{MS}_E\) always estimates \(\sigma^2\), and
\[ F_T = \frac{\text{MS}_T}{\text{MS}_E} \sim F_{k-1,\,(h-1)(k-1)} \;\text{ under } H_T: \alpha_i = 0, \] \[ F_V = \frac{\text{MS}_V}{\text{MS}_E} \sim F_{h-1,\,(h-1)(k-1)} \;\text{ under } H_V: \beta_j = 0 . \]Shortcuts: SST \(= \frac1h\sum T_{i.}^2 - \text{CF}\), SSV \(= \frac1k\sum T_{.j}^2 - \text{CF}\), SSE \(=\) TSS \(-\) SST \(-\) SSV.
In a factorial experiment several factors are varied together, so that both their individual (main) effects and their interactions can be estimated from the same trials — far more efficient than studying one factor at a time. In a \(2^k\) design each of \(k\) factors is set at two levels, low and high.
For a \(2^2\) design with factors A and B, the four treatment combinations are written \((1),\ a,\ b,\ ab\) (a letter present = that factor at its high level). The effects are contrasts:
A significant interaction means the effect of one factor depends on the level of the other — then the main effects must not be interpreted in isolation.
Yields: \((1) = 20,\ a = 40,\ b = 30,\ ab = 54\).
Factor A has the dominant effect; the interaction is negligible.
Yates' algorithm computes all contrasts systematically. List the responses in standard order \((1), a, b, ab\) and repeat, \(k\) times, the operation "sum the pairs, then difference the pairs":
| Std order | Response | Column 1 | Column 2 (contrast) | Identifies |
|---|---|---|---|---|
| (1) | 20 | 60 | 144 | Grand total |
| a | 40 | 84 | 44 | A |
| b | 30 | 20 | 24 | B |
| ab | 54 | 24 | 4 | AB |
The final column reproduces the contrasts (44, 24, 4) and the grand total (144). The same "add-then-subtract" scheme with three passes handles a \(2^3\) design (factors A, B, C and interactions AB, AC, BC, ABC).
Two problems, one-way then two-way, followed by two exercises with answers. Each follows the same steps: hypotheses, totals, correction factor, sums of squares, ANOVA table, and the comparison with the tabulated \(F\). The tabulated values of \(F\) and \(t\) here are computed rather than read from a table, and every figure is exact until it is written down.
Three machines A, B and C are timed to see whether their hourly outputs are equivalent:
| Machine | Output (units per hour) | \(T_i\) | \(n_i\) | \(T_i^2/n_i\) | \(\sum_j y_{ij}^2\) |
|---|---|---|---|---|---|
| A | 22, 25, 24, 21, 26, 23, 24 | 165 | 7 | 3889.286 | 3907 |
| B | 20, 23, 22, 21, 24 | 110 | 5 | 2420 | 2430 |
| C | 25, 23, 27, 26, 24, 25 | 150 | 6 | 3750 | 3760 |
| Total | 425 | 18 | 10059.286 | 10097 |
Hypotheses. \(H_0: \mu_1 = \mu_2 = \mu_3\) (the machines have the same mean output) against \(H_1\): not all equal.
Sums of squares. \(G = 425\), \(N = 18\), \(\text{CF} = 425^2/18 = 10034.722\).
\[ \begin{gathered} \text{TSS} = 10097 - 10034.722 = 62.278, \\ \text{SST} = 10059.286 - 10034.722 = 24.563, \qquad \text{SSE} = 62.278 - 24.563 = 37.714 . \end{gathered} \]| Source | SS | d.f. | MS | \(F\) |
|---|---|---|---|---|
| Between machines | 24.563 | 2 | 12.2817 | \(12.2817/2.5143 = 4.885\) |
| Within machines (error) | 37.714 | 15 | 2.5143 | |
| Total | 62.278 | 17 |
Decision. \(F_{0.05}(2, 15) = 3.68\), and \(4.885 > 3.68\) (\(p = 0.023\)), so \(H_0\) is rejected: the machines differ in mean output (means 23.57, 22.00, 25.00).
A significant \(F\) says only that not all the means are equal; which ones differ is a further question, taken up in Worked Problem 2. Machine C is the obvious candidate, but that has to be tested, not read off the means.
Five fertilisers, A to E, are each tried once in four blocks of land; the yields (quintals per plot) are below. Test at the 1% level whether the fertilisers differ, and whether the blocks differ.
| Block | A | B | C | D | E | \(T_{.j}\) | \(T_{.j}^2\) |
|---|---|---|---|---|---|---|---|
| 1 | 18 | 24 | 23 | 22 | 29 | 116 | 13456 |
| 2 | 21 | 27 | 25 | 26 | 31 | 130 | 16900 |
| 3 | 19 | 22 | 24 | 20 | 27 | 112 | 12544 |
| 4 | 20 | 26 | 28 | 27 | 34 | 135 | 18225 |
| \(T_{i.}\) | 78 | 99 | 100 | 95 | 121 | \(G = 493\) | 61125 |
| \(T_{i.}^2\) | 6084 | 9801 | 10000 | 9025 | 14641 | 49551 |
Hypotheses. \(H_T\): the five fertilisers have equal effects; \(H_B\): the four blocks have equal effects.
Sums of squares. \(k = 5\) fertilisers, \(h = 4\) blocks, \(N = 20\), \(\text{CF} = 493^2/20 = 12152.45\), \(\sum\sum y^2 = 12481\).
\[ \text{TSS} = 12481 - 12152.45 = 328.55, \qquad \text{SS}_T = \frac{49551}{4} - 12152.45 = 235.30, \] \[ \text{SS}_B = \frac{61125}{5} - 12152.45 = 72.55, \qquad \text{SSE} = 328.55 - 235.30 - 72.55 = 20.70 . \]| Source | SS | d.f. | MS | \(F\) | \(F_{0.01}\) |
|---|---|---|---|---|---|
| Fertilisers | 235.30 | 4 | 58.825 | 34.10 | 5.41 |
| Blocks | 72.55 | 3 | 24.183 | 14.02 | 5.95 |
| Error | 20.70 | 12 | 1.7250 | ||
| Total | 328.55 | 19 |
Decision. Fertilisers: \(34.10 > 5.41\) (\(p < 0.0001\)), so the fertilisers differ significantly. Blocks: \(14.02 > 5.95\) (\(p = 0.0003\)), so the blocks also differ significantly: blocking has removed real variation from the error. The level must be fixed before the data are seen.
Which fertilisers differ? The means are A 19.50, B 24.75, C 25.00, D 23.75, E 30.25. With \(t_{0.005}(12) = 3.055\),
\[ \text{CD}_{1\%} = 3.055\sqrt{\frac{2 \times 1.7250}{4}} = 3.055 \times 0.929 = 2.84 . \]Pairs further apart than 2.84: A–B, A–C, A–D, A–E, B–E, C–E, D–E. At 5% (\(\text{CD}_{5\%} = 2.179 \times 0.929 = 2.02\)) these also differ: no further pairs.
| Market | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| A | 74 | 71 | 69 | 77 | 72 | 68 | 75 |
| B | 78 | 75 | 80 | 73 | 76 | 79 | 74 |
| C | 70 | 73 | 68 | 75 | 71 | 69 | 72 |
| D | 76 | 72 | 78 | 74 | 79 | 73 | 77 |
| Fertiliser | I | II | III | IV | V |
|---|---|---|---|---|---|
| 1 | 2.4 | 2.7 | 3.1 | 2.3 | 2.6 |
| 2 | 2.9 | 2.5 | 2.8 | 3.1 | 2.7 |
| 3 | 2.2 | 2.4 | 2.7 | 2.5 | 2.6 |
| 4 | 2.6 | 2.3 | 3.0 | 2.8 | 2.9 |
Additional worked problems with step-by-step procedures to support self-study, matching this unit's topics.
Assumptions: observations are independent, normally distributed, with equal variances. Three principles of design: replication, randomization, local control.
Grain yield of rice (kg/ha) from 7 insecticide treatments, each with 4 replications (a one-way layout). Treatment totals (T) and grand total \(G = 57110\), \(N = 28\):
| Treatment | R1 | R2 | R3 | R4 | Total |
|---|---|---|---|---|---|
| Dol-mix | 2537 | 2069 | 2104 | 1797 | 8507 |
| Ferterra | 3366 | 2591 | 2211 | 2544 | 10712 |
| DDT+γ-BHC | 2536 | 2459 | 2827 | 2385 | 10207 |
| Standard | 2387 | 2453 | 1556 | 2116 | 8512 |
| Dimecron-Boom | 1997 | 1679 | 1649 | 1859 | 7184 |
| Dimecron-Knap | 1796 | 1704 | 1904 | 1320 | 6724 |
| Control | 1401 | 1516 | 1270 | 1077 | 5264 |
Correction factor \(C = G^2/N = 57110^2/28 = 116484004\).
\(\text{TSS} = \sum y^2 - C = 7577412\); \(\text{Treatment SS} = \sum T_i^2/4 - C = 5587175\); \(\text{Error SS} = 7577412 - 5587175 = 1990238\).
| Source | df | SS | MS | \(F\) | \(F_{0.05}\) |
|---|---|---|---|---|---|
| Treatment | 6 | 5587175 | 931196 | 9.83 | 2.57 |
| Error | 21 | 1990238 | 94773 | ||
| Total | 27 | 7577412 |
Since \(F = 9.83 > 2.57\), treatments differ significantly. SE of difference \(=\sqrt{\frac{2\times94773}{4}} = 217.68\); \(CD_{0.05} = 217.68\times 2.08 = 452.70\) kg/ha, \(CD_{0.01} = 217.68\times 2.831 = 616.34\) kg/ha (with \(t_{0.005}(21) = 2.8314\)). Compared with the control, all treatments except Dimecron-Knap give a significant yield increase.