STA 264 · Statistics for Biological and Agricultural Sciences
Our notes
2 min readWhy ANOVA
With 3 or more means, repeated t tests inflate the Type I error. With 5 treatments there are 10 pairs, so the chance of a false positive is far above 5%. ANOVA tests all the means at once.
The idea
Total variation splits into between treatments and within treatments (error).
F = MS treatment ÷ MS error.
A large F suggests the treatment means differ.
Formulas
- Correction factor: CF = (Σx)²/N
- Total SS = Σx² − CF
- Treatment SS = Σ(Tᵢ²/rᵢ) − CF
- Error SS = Total SS − Treatment SS
Worked example: CRD
Three feeds, three pens each (weight gain, kg):
| Feed | Values | Total |
|---|---|---|
| A | 5, 6, 7 | 18 |
| B | 8, 9, 10 | 27 |
| C | 4, 5, 6 | 15 |
Grand total 60; N = 9; CF = 3,600/9 = 400.
Σx² = 25 + 36 + 49 + 64 + 81 + 100 + 16 + 25 + 36 = 432.
- Total SS = 432 − 400 = 32
- Treatment SS = (324 + 729 + 225)/3 − 400 = 426 − 400 = 26
- Error SS = 32 − 26 = 6
| Source | df | SS | MS | F |
|---|---|---|---|---|
| Feeds | 2 | 26 | 13 | 13 |
| Error | 6 | 6 | 1 | |
| Total | 8 | 32 |
Critical F(2, 6) at 5% = 5.14. Since 13 > 5.14, feeds differ.
Check of error SS: within each feed, deviations from the mean are −1, 0, 1, so each gives SS = 2. Then 3 × 2 = 6. Correct.
Which means differ?
Least significant difference (LSD):
LSD = t × √(2 MSE/r) = 2.447 × √(2 × 1/3) = 2.447 × 0.816 = 2.00
Means: A = 6, B = 9, C = 5.
- B − A = 3: significant
- B − C = 4: significant
- A − C = 1: not significant
Feed B is best. Other tests, such as Tukey's or Duncan's, control errors differently. Use what your department or journal asks for.
Two-way ANOVA: RCBD
Now also remove block SS:
Block SS = Σ(Bⱼ²/t) − CF
Error SS = Total − Treatment − Block
Blocking moves field differences out of the error, so F usually rises.
Factorial ANOVA
Splits into factor A, factor B and A × B interaction. Look at the interaction first. If it is significant, compare the combinations, as the main effects alone can mislead.
Assumptions
- Independent errors
- Roughly normal errors
- Equal variances across treatments (homogeneity)
Check with plots of residuals. Bartlett's and Levene's tests can test equal variances. If these fail, try a transformation or a non-parametric method.
Analysis of covariance (ANCOVA)
Combines ANOVA with regression. It adjusts for a measured variable (covariate) that affects the response but isn't under test.
Example: starting weight of pigs in a feed trial. Heavier pigs may gain more, so comparing gain without adjusting could mislead. ANCOVA adjusts the means to a common starting weight, and reduces the error.
The covariate should be measured before treatments begin, so the treatment doesn't affect it.
Exams usually ask: fill in an ANOVA table; run the F test; use LSD to compare means; state the assumptions; explain why ANCOVA is used.
Common mistake: stopping at "F is significant". It only says that some means differ. You still have to say which.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Introductory Statistics 2e, 13.1 One-Way ANOVA
(opens openstax.org in a new tab)
OpenStax, Introductory Statistics 2e, 13.1 One-Way ANOVA, CC BY-NC-SA 4.0 · licence
-
Analysis of variance
(opens en.wikipedia.org in a new tab)
Wikipedia, Analysis of variance, CC BY-SA 4.0 · licence
-
One-way analysis of variance
(opens en.wikipedia.org in a new tab)
Wikipedia, One-way analysis of variance, CC BY-SA 4.0 · licence
-
OpenStax, Introductory Statistics 2e (whole free textbook)
The whole book, free to read online or download as a PDF (the PDF is large: Wi-Fi).
(opens openstax.org in a new tab)
OpenStax, OpenStax, Introductory Statistics 2e (whole free textbook), CC BY-NC-SA 4.0 · licence
Watch
-
ANOVA 1: Calculating SST (total sum of squares) | Probability and Statistics | Khan Academy
8 min · ≈ 36 MB · about ₦20
(opens youtube.com in a new tab)
-
ANOVA: Crash Course Statistics #33
13 min · ≈ 59 MB · about ₦33
(opens youtube.com in a new tab)
-
How to Calculate a One-Way ANOVA by Hand
26 min · ≈ 117 MB · about ₦66
(opens youtube.com in a new tab)
-
ANOVA - A Full Lecture to learn Analysis of Variance
57 min · ≈ 257 MB · about ₦144
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.