inferential statistics
Analysis of Variance (ANOVA)
You should know: hypothesis testing, variance and standard deviation
Overview
Analysis of variance (ANOVA) is a hypothesis-testing technique used to compare the means of three or more groups simultaneously, testing the null hypothesis that all group means are equal. Rather than running many pairwise t-tests (which inflates the chance of a false positive), one-way ANOVA partitions the total variability in the data into variability between groups and variability within groups, and compares these two sources via an F-statistic. A large F-statistic indicates that the variation between group means is large relative to the variation within groups, providing evidence that at least one group mean differs from the others. If ANOVA rejects the null hypothesis, follow-up post-hoc tests (like Tukey's HSD) are typically used to identify which specific groups differ.
Intuition
ANOVA works by comparing two ways of measuring spread. Between-group variability captures how far the individual group means are scattered from the overall grand mean — large scatter suggests real differences among groups. Within-group variability captures the natural noise inside each group, which would exist even if all group means were truly equal. The F-statistic is the ratio of these two: if between-group variability is much larger than the ordinary within-group noise, that's evidence the groups really do differ, not just random fluctuation.
Formal Definition
For k groups with group means x̄ᵢ, overall grand mean x̄, and nᵢ observations per group:
Worked Examples
Degrees of freedom between = k - 1 = 3 - 1 = 2; degrees of freedom within = N - k = 15 - 3 = 12.
Compute mean squares and the F ratio.
Answer: F = 4, with df = (2, 12).
Practice Problems
Three groups, n=4 each (N=12). SS_between = 30, SS_within = 36. Compute F.
For a one-way ANOVA with 5 groups and 40 total observations, find df_between and df_within.
A researcher wants to compare average test scores across 5 teaching methods. Why should they use ANOVA rather than running 10 separate pairwise t-tests?
Quiz
Summary
- ANOVA tests whether three or more group means are all equal by comparing between-group and within-group variability.
- The F-statistic is the ratio of mean square between groups to mean square within groups; a large F suggests real differences among group means.
- ANOVA avoids the inflated false-positive risk of running many pairwise t-tests, and significant results are typically followed by post-hoc tests.
Mathematics