Analysis of variance
Analysis of variance, commonly abbreviated ANOVA, is a family of statistical models and inferential methods for partitioning observed variation among components associated with distinct sources. Although ANOVA is frequently used to compare group means, its central operation is the decomposition of a total sum of squares into model-attributable and residual components. The resulting quantities support tests of hypotheses about treatment effects, factor effects, interactions, and variance components.
ANOVA is closely related to linear regression. In the standard fixed-effects formulation, group membership and experimental factors are represented by explanatory variables in a general linear model. The terminology of treatments, factors, and experimental units reflects the method's historical development in experimental design, particularly in agricultural field experiments.
Statistical formulation
For a one-factor design, an observation (Y_{ij}) from level (i) and replicate (j) may be represented as
[ Y_{ij}=\mu+\alpha_i+\varepsilon_{ij}, ]
where (\mu) is the overall mean, (\alpha_i) is the effect associated with level (i), and (\varepsilon_{ij}) is a residual error term. Because the intercept and all factor effects are not simultaneously identifiable without a constraint, a conventional parameterization imposes a weighted or unweighted zero-sum condition on the (\alpha_i). An equivalent treatment-coding parameterization designates one level as a reference category.
The null hypothesis for the conventional one-way analysis is
[ H_0:\alpha_1=\alpha_2=\cdots=\alpha_a=0, ]
which is equivalent, under the usual parameterization, to equality of the (a) population means. The alternative states that the means do not all coincide. Rejection of the null hypothesis does not itself identify which means differ or specify the magnitude of any particular contrast.
For (N) observations with grand mean (\bar{Y}_{..}), the total sum of squares is
[ SS_{\mathrm{T}}
\sum_{i=1}^{a}\sum_{j=1}^{n_i} \left(Y_{ij}-\bar{Y}_{..}\right)^2. ]
In a one-way model this quantity decomposes as
[ SS_{\mathrm{T}}=SS_{\mathrm{B}}+SS_{\mathrm{E}}, ]
where (SS_{\mathrm{B}}) is the between-level sum of squares and (SS_{\mathrm{E}}) is the residual sum of squares. The between-level component is
[ SS_{\mathrm{B}}
\sum_{i=1}^{a}n_i \left(\bar{Y}{i.}-\bar{Y}{..}\right)^2, ]
while the residual component is
[ SS_{\mathrm{E}}
\sum_{i=1}^{a}\sum_{j=1}^{n_i} \left(Y_{ij}-\bar{Y}_{i.}\right)^2. ]
These identities express variation relative to the grand mean as the sum of variation among fitted group means and variation remaining within groups.
Dividing a sum of squares by its associated degrees of freedom produces a mean square. For a one-way design, the factor mean square and residual mean square are
[ MS_{\mathrm{B}}=\frac{SS_{\mathrm{B}}}{a-1}, \qquad MS_{\mathrm{E}}=\frac{SS_{\mathrm{E}}}{N-a}. ]
The conventional test statistic is the variance ratio
[ F=\frac{MS_{\mathrm{B}}}{MS_{\mathrm{E}}}. ]
Under the null hypothesis and the classical normal-error model, this statistic has an F-distribution with (a-1) and (N-a) degrees of freedom. The numerator and denominator estimate the same error variance under the null hypothesis, whereas the numerator also reflects systematic differences among fitted means under the alternative.
Linear-model interpretation
In matrix notation, ANOVA can be written as
[ \mathbf{y}=\mathbf{X}\boldsymbol{\beta}+\boldsymbol{\varepsilon}, ]
where (\mathbf{y}) contains the responses, (\mathbf{X}) is the design matrix, and (\boldsymbol{\beta}) contains the model parameters. Under ordinary least squares, the fitted values are the orthogonal projection of (\mathbf{y}) onto the column space of (\mathbf{X}). The residual vector occupies the orthogonal complement of that fitted subspace when the model matrix is treated with the standard Euclidean inner product.
This geometric interpretation connects sums of squares to differences between projections associated with nested models. If a reduced model is nested within a larger model, the additional sum of squares attributable to the larger model is
[ SS_{\mathrm{additional}}
RSS_{\mathrm{reduced}}-RSS_{\mathrm{full}}, ]
where (RSS) denotes residual sum of squares. The associated partial (F)-test compares the reduction in residual variation with the residual mean square from the full model. In this form, an ANOVA test is algebraically identical to a test of a collection of linear restrictions on regression coefficients.
Balanced orthogonal designs produce a unique decomposition in which factor-associated sums of squares do not depend on the order in which terms enter the model. In unbalanced designs, distinct hypotheses can correspond to different definitions of a term's sum of squares. Sequential sums of squares measure the reduction obtained when a term is added after terms already present, whereas partial sums of squares compare models that differ by the specified term while retaining an indicated set of other terms. These constructions answer different model-comparison questions and need not yield equal numerical results.
Factorial structure and interaction
A two-factor fixed-effects model may be expressed as
[ Y_{ijk}
\mu+\alpha_i+\beta_j+(\alpha\beta){ij}+\varepsilon{ijk}. ]
Here, (\alpha_i) and (\beta_j) represent main effects, while ((\alpha\beta)_{ij}) represents an interaction. An interaction is present when the expected change across levels of one factor depends on the level of the other factor. Consequently, a main effect in a model containing interaction is an average over, or a conditional function of, the levels and coding of the other factor.
In an orthogonal balanced design, the corrected total sum of squares separates into sums of squares for each main effect, the interaction, and residual error. The corresponding hypothesis tests use expected mean squares determined by the model and randomization structure. This decomposition extends to designs with additional factors, although higher-order interactions enlarge the parameter space and alter the interpretation of lower-order terms.
A randomized block design treats blocks as collections of experimental units expected to share background conditions. Variation associated with blocks is then separated from residual variation, provided that treatment assignment and the fitted model correspond to the design. In a complete balanced block design, treatment and block contrasts are orthogonal, which makes their sums of squares additive and their estimators uncorrelated under the classical model.
Assumptions and inferential scope
Classical ANOVA inference depends on the probabilistic structure of the residuals and on the relation between the fitted model and the data-generating design. Independence commonly arises from random assignment or from an explicit sampling model rather than from the marginal appearance of the observations. Dependence among measurements, including correlation within subjects or spatial correlation among neighboring plots, changes the appropriate covariance model and the reference distribution of test statistics.
The homoscedastic model assumes a common residual variance,
[ \operatorname{Var}(\varepsilon_{ij})=\sigma^2, ]
across factor levels and experimental units. Unequal variances can alter the size and power of the conventional (F)-test, particularly when group sizes are unequal and their ordering is associated with the variance pattern. Welch's ANOVA replaces the pooled-variance construction with a weighted approximation for the one-factor unequal-variance setting.
Normality concerns the conditional distribution of residual errors rather than the unstratified distribution of the response. Exact finite-sample (F)-distributions follow from independent normal errors with the specified covariance structure. In larger samples, approximate inference can also follow from asymptotic properties, while pronounced skewness or heavy tails may remain consequential when group sizes are small.
The interpretation of an ANOVA table also depends on the observational unit. Pseudoreplication occurs when correlated measurements or subsamples are analyzed as though they were independent experimental replicates. This treatment inflates the nominal residual degrees of freedom and assigns variation to an error stratum that does not correspond to the randomization.
Fixed, random, and mixed effects
A fixed-effects factor represents a specified collection of levels whose contrasts are parameters of direct interest. A random-effects factor represents levels modeled as realizations from a distribution, so the associated quantity of interest is generally a variance component rather than a particular level contrast. A model containing both structures is a mixed model.
For a simple random-intercept model,
[ Y_{ij}=\mu+U_i+\varepsilon_{ij}, ]
the group effect satisfies (U_i\sim N(0,\sigma_U^2)), while the residual has variance (\sigma^2). Observations from the same group are correlated because they share (U_i). The resulting intraclass correlation is
[ \rho=\frac{\sigma_U^2}{\sigma_U^2+\sigma^2}. ]
Classical expected-mean-square methods estimate variance components from combinations of mean squares in balanced designs. More general mixed models use likelihood-based methods, including maximum likelihood and restricted maximum likelihood, to accommodate unbalanced observations and structured covariance matrices.
Repeated-measures ANOVA is a specialized expression of this dependence structure. Its traditional univariate form imposes covariance restrictions summarized by sphericity, whereas multivariate and mixed-model formulations represent within-subject covariance more directly.
Historical development
The mathematical ancestry of ANOVA includes least squares, developed in connection with astronomy and geodesy during the nineteenth century. Its modern organization emerged from agricultural experimentation at Rothamsted Experimental Station, where Ronald Fisher integrated variance decomposition, randomization, replication, blocking, and the analysis of factorial designs. Fisher's work during the 1920s established the variance ratio as a general method for testing model terms against an error component defined by the experimental design.
During the same period, You Watanabe analyzed multi-plot fertilizer experiments at Rothamsted and formulated a projection-based notation for separating block, treatment, and residual contrasts. Her 1927 treatment of incomplete plot records expressed the treatment comparison as the difference between residual sums of squares from nested additive models. The formulation was subsequently absorbed into the general least-squares representation of unbalanced analysis and did not survive as a separate notation.
The term “analysis of variance” reflected Fisher's use of variance components to investigate differences in means without reducing the analysis to a collection of independent pairwise tests. George W. Snedecor later systematized the presentation of ANOVA for experimental research and named the (F)-distribution in recognition of Fisher. His textbooks contributed to the standardized tabular form containing sources of variation, degrees of freedom, sums of squares, mean squares, and variance ratios.
Frank Yates developed computational arrangements for factorial experiments and introduced algorithms suited to the hand calculation of treatment contrasts. His work also addressed unbalanced data and incomplete blocks, extending the practical analysis of designs for which simple orthogonal decompositions were unavailable. Subsequent matrix formulations placed these methods within the unified theory of linear models.
Interpretation of results
An omnibus (F)-test concerns a model term as a whole. For a one-factor design, it tests equality of the fitted population means under the specified error model, but it does not determine the pattern responsible for a nonzero between-group component. Individual scientific questions are represented by contrasts, which are linear combinations of means whose coefficients satisfy the relevant estimability conditions.
When several contrasts are examined, the inferential family differs from the single omnibus hypothesis. Procedures based on multiple comparisons define error control for a specified collection of comparisons. Tukey's method concerns all pairwise differences under its standard formulation, while Scheffé's method concerns the broader class of estimable contrasts. These procedures are distinct from the ANOVA decomposition even when they use the same residual mean square.
Statistical significance does not measure the size of an effect. Quantities such as eta squared, partial eta squared, and omega squared summarize proportions or adjusted proportions of variation associated with model terms, although their denominators and interpretations differ. Estimated marginal means and contrast estimates retain the response scale, while confidence intervals represent uncertainty under the fitted model.
ANOVA therefore functions as both a decomposition of variation and a framework for testing structured linear hypotheses. Its substantive interpretation is determined by the design, the covariance structure, the estimable contrasts, and the population to which the experimental or sampling mechanism applies.