Skip to content

One-way ANOVA, step by step

6 min read

Short answer

ANOVA tests whether kk group means are all equal by comparing between-group variation with within-group variation: F=MSbetweenMSwithinF=\dfrac{MS_\text{between}}{MS_\text{within}}. If the group means differ much more than the scatter inside groups, FF is large and you reject equal means.

Bar chartABCGroup means 5, 7, 9 with small scatter inside each group.
Well-separated means relative to the scatter inside each group give a large F.

The decomposition

Total variation splits exactly: SStotal=SSbetween+SSwithinSS_\text{total}=SS_\text{between}+SS_\text{within}. Divide each by its degrees of freedom (k−1k-1 and N−kN-k) to get mean squares, then take their ratio.

After a significant F

ANOVA says that some means differ, not which. Follow with post-hoc comparisons (for example Tukey's test) that control the overall error rate.

Worked example

Groups A: 4,5,64,5,6; B: 6,7,86,7,8; C: 8,9,108,9,10. Test equal means at 5%.

Group means 5,7,95,7,9, grand mean 77. SSB=3(4+0+4)=24SS_B=3(4+0+4)=24. Within each group SS=2SS=2, so SSW=6SS_W=6. dfB=2df_B=2, dfW=6df_W=6: MSB=12MS_B=12, MSW=1MS_W=1, F=12F=12. The 5% critical value for F(2,6)F(2,6) is 5.145.14, so reject: the means are not all equal.

Try it yourself

How many degrees of freedom for the numerator and denominator with 4 groups and 20 observations in total?

Show the answer

Numerator k−1=3k-1=3; denominator N−k=16N-k=16.

Keep going with practice

Vidi's variance lessons are the foundation: ANOVA is a bookkeeping of variance.