Overview
ANOVA tests whether the means of three or more groups are significantly different. It compares variance between groups to variance within groups.
One-Way ANOVA
Hypotheses
- H0: μ1=μ2=μ3=⋯=μk (all means equal)
- H1: At least one mean is different
The F-Statistic
F=MSWMSB=Within-group varianceBetween-group variance
Large F → Evidence of differences between groups
ANOVA Table
| Source | SS | df | MS | F |
|---|
| Between | SSB | k−1 | MSB=k−1SSB | MSWMSB |
| Within | SSW | N−k | MSW=N−kSSW | |
| Total | SST | N−1 | | |
Where:
- k = number of groups
- N = total number of observations
Sum of Squares Formulas
Total Sum of Squares
SST=∑(xij−xˉ)2
Between-Group Sum of Squares
SSB=∑ni(xˉi−xˉ)2
Within-Group Sum of Squares
SSW=∑∑(xij−xˉi)2
Relationship
SST=SSB+SSW
Assumptions
- Independence of observations
- Normal distributions in each group
- Equal variances (homogeneity of variance)
Example
Three teaching methods, student scores:
| Method A | Method B | Method C |
|---|
| 85, 90, 78 | 92, 88, 95 | 75, 70, 80 |
| n1=3 | n2=3 | n3=3 |
| xˉ1=84.33 | xˉ2=91.67 | xˉ3=75 |
Grand mean: xˉ=985+90+78+92+88+95+75+70+80=83.67
SSB=3(84.33−83.67)2+3(91.67−83.67)2+3(75−83.67)2
=3(0.44)+3(64)+3(75.11)=1.32+192+225.33=418.65
SSW=(85−84.33)2+(90−84.33)2+(78−84.33)2+⋯=170.67
MSB=2418.65=209.33
MSW=6170.67=28.44
F=28.44209.33=7.36
Critical F0.05,2,6=5.14
7.36>5.14⇒ Reject H0
At least one teaching method differs significantly.
Post-Hoc Tests
If ANOVA rejects H0, use post-hoc tests to identify which pairs differ:
| Test | Use Case |
|---|
| Tukey's HSD | All pairwise comparisons |
| Bonferroni | Few specific comparisons |
| Scheffé | Complex comparisons |
| Fisher's LSD | Liberal, more Type I error |
Effect Size: Eta-Squared
η2=SSTSSB
| η2 | Interpretation |
|---|
| 0.01 | Small |
| 0.06 | Medium |
| 0.14 | Large |
Two-Way ANOVA
For two factors (A and B):
SST=SSA+SSB+SSAB+SSW
Tests:
- Main effect of Factor A
- Main effect of Factor B
- Interaction effect (A×B)
Assumptions Check
- Normality: Shapiro-Wilk test, Q-Q plots
- Equal variances: Levene's test, Bartlett's test
When to Use
| Situation | Test |
|---|
| 2 groups | t-test |
| 3+ groups | One-way ANOVA |
| 2 factors | Two-way ANOVA |
| Repeated measures | Repeated measures ANOVA |