Analysis of Variance (ANOVA)

Statistics
Introduced by
Ronald A. Fisher
Year
1925
Type
Method
Family
parametric-hypothesis-testing

What does it do?

ANOVA is a parametric method, developed by Ronald A. Fisher, for testing whether the means of three or more independent groups differ on a continuous outcome.

Fisher set out the variance-partitioning approach in a 1918 article on the correlation between relatives and presented the method systematically in his 1925 book Statistical Methods for Research Workers. It partitions total variability into a between-group component and a within-group component and compares them through an F-statistic. It works as an omnibus test: a significant result shows that at least one mean differs, and pairwise comparisons are needed to identify which ones.

The intuition behind the method

ANOVA extends the two-group t-test to several groups by comparing the variance explained by group membership with the variance left unexplained (random error within groups). If the groups truly differ in their underlying means, the between-group variance will be large relative to the within-group variance. The F-statistic is this ratio: a large F suggests that at least some group means differ, while a small F is consistent with similar means. The same logic underlies much of experimental design and observational group comparison.

History

Ronald A. Fisher's variance-partitioning approach traces to his 1918 article on the correlation between relatives. He set out the method systematically in his 1925 book Statistical Methods for Research Workers, in the context of agricultural field trials at Rothamsted Experimental Station, where he needed to judge whether crop yields differed across fertilizer treatments. The partitioning of variance and the F-distribution, named after him, are central to the method. Kruskal and Wallis (1952) published a rank-based test for comparing several groups without assuming normality. Later extensions include factorial designs, repeated measures ANOVA and robust variants such as Welch's F.

When to use it

Choose ANOVA when the question is whether the means of three or more independent groups differ on one continuous outcome, for example comparing several treatment arms in a randomized trial or outcomes across age bands. It is appropriate when residuals are roughly normal and group variances are similar. For two groups only, ANOVA gives the same result as a t-test, since F equals t squared. Do not use it for ordinal or categorical outcomes, or when observations are paired or clustered: use repeated measures ANOVA for repeated measurements on the same subjects, and multilevel modeling for nested data. If residuals are clearly non-normal, consider the Kruskal-Wallis test, the rank-based alternative to one-way ANOVA.

Limitations and considerations

  • The F-test assumes normal residuals and a common error variance across groups. When group sizes are unequal, unequal variances can distort the Type I error rate substantially; Welch's F does not assume equal variances and is a common alternative.
  • The omnibus test is non-specific: a significant F shows that at least one mean differs but not which ones, so post-hoc comparisons are needed, and these add multiple-comparison adjustments that reduce power.
  • Because deviations are squared, a few extreme observations can inflate MS_within, lowering F and the power to detect real differences.
  • The test assumes independent observations. Clustered data, such as students nested in classrooms, make the within-group error too small, which inflates false positives unless the clustering is modeled.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • A single F-test with one pooled error term tests the overall null hypothesis at the chosen α, avoiding the inflated familywise error that results from running many separate unadjusted t-tests.
  • The pooled within-group variance uses the data from all groups to estimate error, so the test is more stable than a comparison of two groups at a time.
  • The sum-of-squares partition reports the share of variance attributable to group membership (η², ω²) alongside the test.
  • With two groups, ANOVA reduces to the t-test, so it generalizes that test without changing its logic.
  • The same partition extends to factorial designs with several factors and their interactions, and to repeated measures designs.

Applications

  • Clinical trials: comparing efficacy of multiple drug dosages or competing treatments on patient outcomes (e.g., pain reduction across three treatment arms).
  • Educational research: testing whether student achievement differs by instructional method, school type, or socioeconomic background.
  • Agriculture and environmental science: analyzing crop yields, growth rates, or contaminant levels across field conditions, fertilizer types, or geographic regions.
  • Manufacturing and quality control: evaluating whether product quality metrics vary by production line, batch, or supplier.
  • Psychology and neuroscience: comparing cognitive performance, neural activation, or behavioral measures across experimental conditions or diagnostic groups.

How it works

How it works

1

Use ANOVA when the outcome is continuous and there is one or more categorical grouping factors. Observations must be independent, so clustered data (for example, students within classrooms) or repeated measures on the same individuals require a different model. Assign participants to groups by randomization where possible, or record existing groupings in observational studies. Before interpreting the F-test, check three assumptions: (1) independence of observations; (2) approximate normality of the residuals within groups, using Q-Q plots or a Shapiro-Wilk test; (3) homogeneity of variance across groups, using Levene's test. A non-significant Levene's test is weak evidence of equal variances, not confirmation, so compare the group spreads directly as well. Groups should be large enough for their means and variances to be estimated with reasonable stability, since very small groups make the assumption checks themselves unreliable.

2

Calculate the ANOVA F-statistic by partitioning total sum of squares (SS_total) into between-group sum of squares (SS_between) and within-group sum of squares (SS_within). Compute: (1) Grand mean (overall average across all observations), (2) SS_between = Σ n_i(M_i − M_grand)² where n_i is group size and M_i is group mean, (3) SS_within = Σ Σ (x_ij − M_i)² summed across groups and observations, (4) Mean Square Between (MS_between) = SS_between / (k − 1) where k is number of groups, (5) Mean Square Within (MS_within) = SS_within / (N − k) where N is total sample size, (6) F-statistic = MS_between / MS_within. The F follows an F-distribution with (k−1) and (N−k) degrees of freedom under the null hypothesis.

3

Compare calculated F to critical value from F-distribution tables or use software to obtain p-value. If p < α (typically 0.05), reject the null hypothesis: at least one group mean differs from the others. ANOVA does not identify which groups differ; use post-hoc tests (Tukey HSD, Bonferroni, Scheffé) for pairwise comparisons. Report effect size (η², omega-squared) to indicate practical significance: η² = SS_between / SS_total; roughly 0.01=small, 0.06=medium, 0.14=large. Omega-squared is less biased for small samples. Non-significant p-values indicate insufficient evidence of group differences; do not conclude groups are equal—absence of evidence is not evidence of absence.

Common pitfalls

  • Checking normality on the raw outcome pooled across all groups rather than on the residuals within groups. Because the group means differ, the pooled distribution can look non-normal even when the residuals are well behaved.
  • Running multiple pairwise t-tests in place of the omnibus ANOVA followed by post-hoc tests; this inflates familywise Type I error.
  • Treating a non-significant F as evidence that the groups are equal. With small groups, a non-significant result mostly reflects low power.
  • Applying ANOVA to ordinal or categorical outcomes, where a rank-based or categorical test is more suitable.
  • Reporting p-values without effect sizes such as η² or ω²; a significant result can be small in practical terms.
  • Using Tukey HSD with unbalanced groups without checking which variant the software applies. With unequal group sizes, confirm the variant before interpreting the adjusted p-values, and report which procedure was used.

Frequently asked questions

What is the difference between one-way, two-way, and repeated measures ANOVA?

One-way ANOVA tests one independent variable (factor) with multiple levels (e.g., three treatment groups). Two-way ANOVA includes two independent variables and tests main effects and their interaction (e.g., treatment and gender effects on outcome). Repeated measures ANOVA applies to within-subjects designs where the same individuals are measured multiple times (e.g., before, during, after treatment); it accounts for correlation between repeated observations. Choice depends on study design and research questions.

When should I use post-hoc tests, and which one is best?

Use post-hoc tests only after a significant omnibus ANOVA to identify which group pairs differ. Tukey HSD (Honestly Significant Difference) is the usual choice for all pairwise comparisons among group means and controls familywise error. With unequal group sizes, confirm which variant of the procedure the software applies before interpreting its adjusted p-values. Bonferroni is conservative and suits a small number of planned comparisons. Scheffé is the most flexible, allowing complex contrasts. Dunnett's test compares several treatment groups against a single control. Choose the procedure in advance; data-driven selection inflates Type I error.

How do I handle unequal sample sizes across groups?

Unequal group sizes are not themselves a violation of the ANOVA model, but they affect robustness: when group sizes are unequal and variances differ, the Type I error rate can drift from the nominal level. Check the variances, and consider a variance-robust test such as Welch's F or Games-Howell post-hoc comparisons. Missing outcome data are a separate issue. If data are missing completely at random (MCAR), the remaining cases give unbiased but smaller groups, which reduces power. If missingness is related to the outcome or the grouping, use multiple imputation or a mixed model. Report the final group sizes explicitly.

What is eta-squared (η²) and how does it differ from omega-squared (ω²)?

Both measure effect size: the proportion of total variance explained by group membership. Eta-squared (η² = SS_between / SS_total) is easier to calculate but biased upward, especially with small samples. Omega-squared (ω² = (SS_between − (k−1)MS_within) / (SS_total + MS_within)) corrects this bias and provides a less inflated estimate of population effect size. For publication, report omega-squared for accuracy. Rough benchmarks: 0.01 = small, 0.06 = medium, 0.14 = large effect.

Related methods

Sources

  1. Fisher, R. A. (1925). Statistical Methods for Research Workers. Oliver and Boyd.

    Open publication reference
  2. Kruskal, W. H., & Wallis, W. A. (1952). Use of ranks in one-criterion variance analysis. Journal of the American Statistical Association, 47(260), 583–621.

    Open DOI reference
  3. Econometrics Streamlined, Applied and e-Aware, p. 99