ANOVA (Analysis of Variance) › The Logic of ANOVA: Comparing Variances to Test Means
Machine Learning from ScratchAll chapters ANOVA (Analysis of Variance) › The Logic of ANOVA: Comparing Variances to Test MeansOne section · Sections in this chapter3 / 13 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
ANOVA's name, "Analysis of Variance," seems paradoxical. If we want to compare means, why analyze variances? The genius of ANOVA lies in recognizing that differences among means manifest as a specific pattern of variance.
The Core Insight
Consider three groups with potentially different population means , , and . When we collect samples from these groups, we observe two types of variation:
1. Within-group variation: How much individuals vary around their own group mean. This reflects natural variability in the data, measurement error, and individual differences. This variation exists regardless of whether the population means differ.
2. Between-group variation: How much the group means vary around the overall (grand) mean. This reflects sampling variation plus any true differences among population means.
If all population means are equal, the between-group variation should be similar to what we'd expect from sampling variation alone. The group means will differ somewhat, but only because of random sampling, not because the populations are truly different.
But if population means differ, the between-group variation will be inflated beyond what sampling alone would produce. The group means will be more spread out than chance would predict.
ANOVA formalizes this by computing the ratio:
- If : Between and within variation are similar; no evidence of mean differences
- If : Between variation is much larger than within; evidence that means differ

