7.9 Analysis of Variance

Key Takeaways

  • ANOVA partitions total sum of squares into between-groups (treatment) and within-groups (error) components.

  • The F statistic is the ratio of mean square treatment to mean square error, and a large F indicates that group means differ.

  • ANOVA controls the family-wise error rate that repeated pairwise t-tests would inflate.

  • A significant F test says that at least one mean differs but not which; post-hoc tests such as Tukey's HSD identify the pairs.

  • ANOVA assumes independence, normality of residuals, and homogeneity of variances, and is most sensitive to violations of independence.

Last updated: August 2026

Why not repeated t-tests

With kk groups there are k(k−1)/2k(k-1)/2 pairwise comparisons. For five groups that is ten tests, and at α=0.05\alpha = 0.05 per test the family-wise error rate is 1−0.9510=0.401 - 0.95^{10} = 0.40. ANOVA answers the question with a single test at the stated α\alpha.

The partition

SStotal=SStreatment+SSerrorSS_{total} = SS_{treatment} + SS_{error} SStotal=∑i∑j(yij−yˉ)2,SStreat=∑ini(yˉi−yˉ)2,SSerror=∑i∑j(yij−yˉi)2SS_{total} = \sum_{i}\sum_{j}(y_{ij} - \bar{y})^2, \qquad SS_{treat} = \sum_{i} n_i(\bar{y}_i - \bar{y})^2, \qquad SS_{error} = \sum_{i}\sum_{j}(y_{ij} - \bar{y}_i)^2

The logic: if the group means were all equal, the only reason group averages would differ is random error, so between-group variation would be about the same size as within-group variation. If treatment means genuinely differ, between-group variation is inflated.

The ANOVA table

SourceSum of squaresdfMean squareF
Treatment (between)SStreatSS_{treat}k−1k - 1MStreat=SStreat/(k−1)MS_{treat} = SS_{treat}/(k-1)MStreat/MSerrorMS_{treat}/MS_{error}
Error (within)SSerrorSS_{error}N−kN - kMSerror=SSerror/(N−k)MS_{error} = SS_{error}/(N-k)
TotalSStotalSS_{total}N−1N - 1

where kk is the number of groups and NN the total number of observations. Reject H0:μ1=μ2=⋯=μkH_0: \mu_1 = \mu_2 = \cdots = \mu_k when F>Fα, k−1, N−kF > F_{\alpha,\,k-1,\,N-k}.

Note that MSerrorMS_{error} is the pooled estimate of the common within-group variance σ2\sigma^2, and its square root is the standard deviation used for post-hoc comparisons.

Worked example

Four suppliers, five specimens each, tensile strength in MPa.

SupplierObservationsyˉi\bar{y}_i
A412, 418, 415, 421, 414416.0
B428, 431, 425, 433, 428429.0
C409, 414, 411, 407, 414411.0
D424, 419, 427, 422, 423423.0

Grand mean yˉ=419.75\bar{y} = 419.75, N=20N = 20, k=4k = 4.

SStreat=5[(416.0−419.75)2+(429.0−419.75)2+(411.0−419.75)2+(423.0−419.75)2]SS_{treat} = 5\left[(416.0 - 419.75)^2 + (429.0 - 419.75)^2 + (411.0 - 419.75)^2 + (423.0 - 419.75)^2\right] =5[14.06+85.56+76.56+10.56]=5×186.75=933.75= 5\left[14.06 + 85.56 + 76.56 + 10.56\right] = 5 \times 186.75 = 933.75

Within-group sums of squares are 50.0, 38.0, 38.0, and 34.0, giving SSerror=160.0SS_{error} = 160.0.

SourceSSdfMSF
Supplier933.753311.2531.13
Error160.001610.00
Total1093.7519

F0.05,3,16=3.24F_{0.05,3,16} = 3.24, and 31.13≫3.2431.13 \gg 3.24, so at least one supplier mean differs. The effect size is

η2=SStreatSStotal=933.751093.75=0.854\eta^2 = \frac{SS_{treat}}{SS_{total}} = \frac{933.75}{1093.75} = 0.854

so supplier accounts for 85.4% of the variation in tensile strength.

After a significant F

A significant FF says at least one mean differs; it does not say which. Post-hoc procedures control the family-wise error rate while making the pairwise comparisons:

ProcedureUse
Tukey's HSDAll pairwise comparisons; the standard default
Dunnett's testComparing several treatments against one control only
Fisher's LSDLeast conservative; only defensible after a significant F, and even then criticized
BonferroniSimple and conservative; adjust α\alpha to α/m\alpha/m for mm comparisons
ScheffeMost conservative; permits arbitrary contrasts decided after seeing the data

Running post-hoc tests without a significant omnibus F reintroduces the error-rate inflation that ANOVA exists to prevent.

Assumptions

AssumptionHow to checkEffect of violation
Independent observationsStudy design; residuals versus run orderSerious; invalidates the test
Residuals normally distributedNormal probability plot of residuals; Anderson-DarlingMild; ANOVA is robust with balanced designs and moderate n
Equal variances across groupsLevene's or Bartlett's test; residuals versus fitsModerate; serious with unequal group sizes

ANOVA is robust to moderate non-normality when the design is balanced, but it is not robust to dependence. Time-ordered data with autocorrelation, or observations clustered within batches, violate the assumption in a way no transformation fixes; the design must change.

Bartlett's test for equal variances is itself very sensitive to non-normality, so Levene's test is preferred in practice. Where variances differ materially, use Welch's ANOVA or transform the response. When normality fails badly, the Kruskal-Wallis test is the non-parametric alternative.

Residual analysis is the practical way to check all three at once: plot residuals against fitted values (equal variance), on a normal probability plot (normality), and against run order (independence).

Beyond one-way

DesignQuestion
One-wayDoes one factor with kk levels affect the response?
Two-wayDo two factors affect the response, and do they interact?
Randomized blockDoes the factor matter, after removing a known nuisance source such as batch or day?
ANOVA within DOEWhich main effects and interactions in a factorial design are significant?

The two-way case introduces the interaction term, which tests whether the effect of one factor depends on the level of the other. Interactions are frequently the most important finding in a Six Sigma analysis, because they are invisible to one-factor-at-a-time experimentation. This is the direct link between ANOVA and the Improve phase: the analysis of a factorial experiment is an ANOVA.

Test Your Knowledge

A one-way ANOVA on four suppliers with five specimens each yields SS treatment = 933.75 and SS error = 160.00. What is the F statistic?

A

5.84

B

3.24

C

31.13

D

93.38

Test Your Knowledge

A one-way ANOVA across five machines returns p = 0.003. What may be concluded?

A

All five machine means differ from one another

B

The machines have unequal variances

C

The machine with the highest mean is significantly different from all others

D

At least one machine mean differs from at least one other, but the F test does not identify which pairs

Test Your Knowledge

Which ANOVA assumption violation is least amenable to correction and most damaging to the validity of the test?

A

Dependence among observations, such as autocorrelation in time-ordered data

B

Unequal variances with equal group sizes

C

Mild non-normality of residuals in a balanced design

D

A small number of factor levels

Sections you finish are checked off in the contents.