Analysis of variance (ANOVA)
- Statistical test
It compares the means of three or more groups at once, in a single test, without inflating the risk of a false positive.
What it is
One-way analysis of variance (ANOVA) compares the means of three or more independent groups. It splits the total variation into a between-group part and a within-group part; if the variation between groups is much larger than expected from the variation within them, the F statistic is large. A significant ANOVA says that at least one mean differs, but not which: post-hoc tests with a multiple-comparison adjustment answer that.
When to use it
- Three or more means of independent groups, with a numerical outcome.
- Two-way ANOVA: two factors at once (for example treatment and sex) and their interaction.
- Repeated-measures ANOVA: the same people measured at several time points.
Worked example
- Data: sleep quality score (0 to 15) with 3 routines, 4 people each. A: 4, 5, 6, 5; B: 6, 7, 8, 7; C: 7, 9, 10, 10.
- Means: A = 5, B = 7, C = 9; grand mean = 7.
- Between-group sum of squares = 4 × [(5 − 7)² + 0² + (9 − 7)²] = 4 × 8 = 32; df = 3 − 1 = 2; mean square = 16.
- Within groups: A = 1 + 0 + 1 + 0 = 2; B = 2; C = 4 + 0 + 1 + 1 = 6; total = 10; df = 12 − 3 = 9.
- Mean square within = 10 / 9 = 1.11.
- F = 16 / 1.11 = 14.4. The critical F(2, 9) at α = 0.05 is 4.26; p ≈ 0.002.
- H0 is rejected. A post-hoc test (for example Tukey) would show which pairs of routines differ.
- Reading: at least one routine gives different sleep; ANOVA alone does not say which.
Markers
- F
- df
- post hoc
- Tukey
Assumptions and pitfalls
- Stopping at a significant ANOVA without saying which groups differ.
- Running post-hoc tests without a multiple-comparison adjustment.
- Using one-way ANOVA for repeated measurements in the same people.
Test yourself
Think of the answer, then tap the question to see it.
What null hypothesis does a one-way ANOVA test?
That the means of all groups are equal.
What follows a significant ANOVA?
Post-hoc tests with a multiple-comparison adjustment, such as Tukey or Bonferroni, to find which pairs of groups differ.
Which non-parametric test replaces one-way ANOVA?
The Kruskal-Wallis test.
With 4 groups and 40 people in total, what are the ANOVA degrees of freedom?
Between groups: 4 − 1 = 3. Within groups: 40 − 4 = 36.
Connections
Educational content on epidemiological and statistical methods; the examples use made-up numbers to teach the calculation. Not a clinical or legal guide: current Colombian rules are in the official sources.
Sources: One-Factor ANOVA (NIST/SEMATECH e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012); One-way ANOVA overview (NIST/SEMATECH e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012); How can we make multiple comparisons? (NIST/SEMATECH e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012).
Spotted a mistake?We are always improving for the community. Tell us what is wrong and our team will review it.Report a mistake
Representative model, for educational purposes only.
