Analysis of Variance & the F-Test
ANOVA turns a question about several group means into a comparison of two variance estimates: variation explained by group membership and variation left within groups. The F-ratio is meaningful only with the design, assumptions, and planned comparisons that make those estimates comparable.
Analysis of variance (ANOVA) asks whether a categorical grouping variable explains variation in a quantitative response. The name sounds indirect because the scientific question concerns means, but the evidence comes from variance: if group means really differ, observations should be more dispersed around the grand mean than they are around their own group means.
That comparison is the F-test. It is not a generic ritual for three or more groups, and a significant result does not say which means differ or whether the difference matters.
From a means question to two noise estimates #
For a one-factor design, observation is the $j$th replicate in group :
is the overall level, is the effect of group , and is unexplained variation. Under the classical model, the errors are independent, have mean zero and common variance , and are approximately normal when exact small-sample inference matters. The null hypothesis is
equivalently, all group means are equal.
Let be group 's mean, the grand mean, its sample size, and . Total squared variation partitions exactly:
is between-group variation; is residual, or within-group, variation. The cross-term vanishes because residuals within each group sum to zero. This algebra is the mechanism behind ANOVA, not merely a bookkeeping identity.
Each sum of squares grows with its number of independent directions, so compare mean squares:
Under , both numerator and denominator estimate the same , so their ratio should be near one apart from sampling variation. If group effects are present, also contains their signal and tends to exceed . Under the model, follows an distribution.
Worked example #
Suppose three process settings produce:
| Setting | Measurements | Mean |
|---|---|---|
| A | 7, 8, 9 | 8 |
| B | 10, 11, 12 | 11 |
| C | 13, 14, 15 | 14 |
The grand mean is 11. Therefore
Each group has residuals , so . With and ,
The effect is large relative to within-setting scatter. But the omnibus test still answers only “not all means are equal.” A planned contrast such as C versus A, or a multiplicity-controlled post-hoc procedure, is needed to identify the relevant difference. Reporting mean differences and uncertainty is more informative than reporting the p-value alone.
ANOVA is a linear model #
ANOVA and regression are the same machinery with different encodings. A factor with levels becomes indicator columns in a design matrix ; least squares fits . The F-test compares a reduced model, without selected factor terms, to a full model:
This view scales naturally to several factors, covariates, unequal group sizes, and interaction terms. In a two-factor model,
the interaction asks whether one factor's effect changes with the other. If interaction is material, a single “main effect” average can hide the mechanism—for example, a treatment that helps at low temperature but harms at high temperature.
Assumptions belong to the design #
- Independence is usually the most important assumption. Ten readings from one device are not ten independent devices. Repeated measures, clusters, batches, or time order require blocking, mixed models, or an explicit dependence model.
- Equal variance means comparable residual spread across groups. Severe imbalance plus unequal variances can badly distort the classical F-test. Welch's ANOVA is a useful unequal-variance alternative for a one-factor comparison.
- Normality concerns residuals, not raw observations. The F-test is often reasonably robust to mild non-normality in balanced designs, but small samples, strong skew, and outliers demand residual diagnostics or a model suited to the response distribution.
- The model must include the design. Omitting blocks, interactions, or covariates can inflate residual noise or confound an effect.
Plot residuals against fitted values, group, run order, and important covariates. A normal quantile plot can expose heavy tails, but no diagnostic plot repairs pseudoreplication.
What the F-test does not establish #
A tiny p-value is not an effect size, a causal claim, or evidence that every group differs. With very large , practically negligible differences can be statistically clear. Conversely, failure to reject does not establish equality; it may reflect poor precision. Equivalence requires margins and an equivalence design.
A common counterexample is an experiment with identical group means but different variances. Classical mean ANOVA may not reject the mean null, although the groups plainly have different distributions. If the scientific question concerns spread, tails, or failure probability, use a method that targets that property.
Practical reasoning sequence #
- Identify the experimental unit and the source of independent replication.
- Write the model implied by randomization, blocking, and repeated measurement.
- Visualize group distributions and residuals, not only means.
- Test the scientifically relevant factor or contrast.
- Report estimates, intervals, effect size, and residual diagnostics alongside the F-test.
ANOVA is strongest when it reflects how data were generated. Applied mechanically to an arbitrary spreadsheet column, its clean decomposition can conceal a broken causal comparison.
Sources
- bookData Recognition and Classification: Lecture Notespdfnotes
- docsNIST/SEMATECH e-Handbook: One-Factor ANOVA
- docsNIST/SEMATECH e-Handbook: Multi-Factor ANOVA
- docsNIST/SEMATECH e-Handbook: Analysis of Variance Models