ANOVA (Analysis of Variance) › ANOVA (Analysis of Variance)
Machine Learning from ScratchAll chapters ANOVA (Analysis of Variance) › ANOVA (Analysis of Variance)One section · Sections in this chapter1 / 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
Imagine you're running a clinical trial comparing four different medications for lowering blood pressure. You've recruited patients, randomly assigned them to treatment groups, and measured their outcomes. Now you need to determine: do any of these medications work differently from the others?
Your first instinct might be to run t-tests comparing each pair of medications: Drug A vs B, A vs C, A vs D, B vs C, B vs D, and C vs D. That's six separate tests. But here's the problem: even if all four drugs are equally effective (no real differences), you'd falsely conclude that at least one pair differs about 26% of the time, not the 5% you expect from a single test at . With more groups, this gets worse. Ten groups would require 45 pairwise comparisons, with a false positive rate exceeding 90%.
This is the multiple comparisons problem, and it's why Analysis of Variance (ANOVA) exists. ANOVA tests whether any group means differ using a single test that maintains your chosen Type I error rate. Developed by Ronald Fisher in the 1920s for agricultural experiments, ANOVA has become one of the most widely used statistical techniques in scientific research and industry, from medicine to psychology.
This chapter builds directly on the F-distribution and F-tests you learned previously. ANOVA uses the same logic: partition total variation into components, then test whether the ratio of variance estimates is larger than expected by chance. By the end of this chapter, you'll understand how to perform ANOVA, why it works, and when to use it.