One-Way ANOVA

Canonical reference: Maxwell, Delaney, & Kelley (MDK) ref/mdk

An independent-samples test compares two group means. When a single factor has three or more independent groups, testing every pair separately at level runs several tests on the same data and inflates the familywise Type I error rate well above . One-way analysis of variance (ANOVA) instead poses a single question: are all population means equal? It answers with one omnibus test that holds the Type I error rate at the nominal level. The test works by splitting the total variability in the data into a portion attributable to differences among the group means and a portion attributable to variability among individuals within groups, and asking whether the first is large relative to the second.

Omnibus hypotheses

For independent groups with population means , the hypotheses are

The alternative is stated in words because it is not one specific pattern: it is satisfied when a single mean departs from the rest, when the means split into subsets, or when all of them differ. The null hypothesis of the omnibus test is a single restriction on all means at once, which is what keeps the error rate at — and also why the test, by itself, cannot say where among the groups the differences lie.

Two sources of variability

Let denote observation in group , with observations in group and in total. Write for the mean of group and for the grand mean, the mean of all observations:

With equal group sizes the grand mean is the ordinary average of the group means; with unequal sizes it is weighted toward the larger groups.

Each observation’s deviation from the grand mean decomposes exactly into a between-group part and a within-group part:

which pairs the two sources of variability the test compares:

  • Within-group variability, deviations of individuals from their own group mean. It reflects unsystematic sources — individual differences, sampling variability, and measurement error — and estimates the variation that is present regardless of any systematic difference among the treatments.
  • Between-group variability, deviations of group means from the grand mean. It reflects the same unsystematic sources plus any systematic treatment effect, so it grows (relative to within-group variability) as the population means separate.

The central question of the classic ANOVA is whether the group means are more variable than would be expected given the variability among individuals within the groups — that is, whether the ratio of between-group to within-group variance exceeds what chance alone produces.

Sums of squares

Squaring and summing the deviations over all observations yields the three sums of squares:

with pooling the squared deviations within each group and weighting each squared deviation of a group mean by that group’s size — which is why is not simply the variance of the group means. The deviations are not addable observation by observation once squared; additivity is recovered after summing, and the partition is exact:

When only and are convenient to compute, follows from the partition.

Degrees of freedom and mean squares

Each sum of squares carries its own degrees of freedom, partitioned in the same way:

A mean square is a variance estimate — the term ANOVA uses for a sum of squares divided by its degrees of freedom:

Sums of squares and degrees of freedom are additive across the two sources; mean squares are not. Under the null hypothesis both mean squares estimate the same within-population variance, so their ratio tends to be near 1. When the population means differ, additionally carries the systematic differences among groups and is inflated, while continues to estimate only the within-population variance. The many names these degrees of freedom carry elsewhere — numerator and denominator df, df_error, model comparison’s and — are aligned in Crosswalk of ANOVA Quantities.

The F ratio and its distribution

The test statistic is the ratio of the two variance estimates,

which under the null hypothesis follows an distribution with and degrees of freedom. ratios cannot be negative and their sampling distributions are right-skewed, centered near 1 when the null is true; the shape depends on the pair of degrees of freedom, forming a family of distributions.

The test is one-tailed even though the alternative hypothesis is nondirected. Any configuration of unequal population means — whatever its direction or pattern — acts on the ratio by inflating and therefore pushing upward. Evidence against the null can only move the statistic into the upper tail, so the rejection region lies entirely there: reject when exceeds the critical value .

The ANOVA summary table

The computations are conventionally organized in a summary table:

Source
Between groups
Within groups (error)
Total

The table encodes the structure of the test: and add down to the total row, each is formed within its row, and the single is the ratio of the between row’s mean square to the within row’s. The within-group row is often labeled error, because estimates the unexplained variation against which group differences are judged.

Computation from summary statistics

A one-way ANOVA does not require the raw data. Given the group sizes , sample means , and sample variances for each group:

The degrees of freedom, mean squares, and ratio then follow exactly as above. This route reproduces published analyses from the summary statistics reported in them and is often the quickest hand computation even when raw data are available.

Worked example

Three independent groups of each () have sample means , , and , and sample variances , , and .

The grand mean is . The sums of squares:

so , in agreement with summing all 15 squared deviations from the grand mean. Degrees of freedom are , , and . The mean squares are and , giving

with . The statistic far exceeds the critical value of , so the null hypothesis of equal population means is rejected: the data provide evidence that at least one population mean differs from the others. Which means differ, and by how much, is a separate question that the omnibus test does not answer.

Assumptions and robustness

AssumptionStatement
IndependenceObservations are independent within and across groups
NormalityThe outcome is approximately normal within each population
Equal variancesThe populations share a common variance

Equivalently, in error form: independent errors, each with mean zero and common variance , following a normal distribution.

The test is fairly tolerant of the distributional assumptions but not of the design one:

  • Normality: moderate violations have little effect on the accuracy of the -values; the concern grows with small or unequal group sizes.
  • Equal variances: with equal group sizes the test is largely robust to moderate variance inequality. With unequal sizes and unequal variances, direction matters: a larger variance attached to the smaller group inflates the Type I error rate, while a larger variance attached to the larger group makes the test conservative. Balance reduces sensitivity to variance inequality but does not make every violation harmless.
  • Independence: violations are the serious case. They distort — the denominator of — and with it the Type I error rate, usually inflating it, and no amount of sample size or balance repairs them.

When unequal group sizes and unequal variances are a genuine concern, the omnibus-level remedy is Welch’s heteroscedastic ANOVA, a separate-variance generalization of the two-group Welch correction that holds the Type I error rate near its nominal level without assuming equal variances; standard software provides it. Separate-variance procedures for follow-up comparisons, analogous in spirit to the Welch correction for two groups, are discussed with linear contrasts and multiple comparisons.

What the omnibus test establishes — and what it does not

  • A rejected omnibus null is evidence that at least one population mean differs. It does not locate the difference: any pattern of partially or wholly separated means is compatible with the same rejection.
  • A non-rejected null is not evidence that the means are equal. The test may simply lack the sensitivity to detect the differences present; see statistical power.
  • Statistical significance is a statement about compatibility with equal means, not about magnitude or importance; a large can reflect a large effect, a large sample, low within-group variability, or a combination. Measures of explained variance for the ANOVA context are treated under model comparison and effect sizes.
  • Locating and quantifying differences requires planned linear contrasts or multiple-comparison procedures chosen with the familywise error rate in mind.