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.
Why not repeated t-tests
With groups there are pairwise comparisons. For five groups that is ten tests, and at per test the family-wise error rate is . ANOVA answers the question with a single test at the stated .
The partition
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
| Source | Sum of squares | df | Mean square | F |
|---|---|---|---|---|
| Treatment (between) | ||||
| Error (within) | ||||
| Total |
where is the number of groups and the total number of observations. Reject when .
Note that is the pooled estimate of the common within-group variance , and its square root is the standard deviation used for post-hoc comparisons.
Worked example
Four suppliers, five specimens each, tensile strength in MPa.
| Supplier | Observations | |
|---|---|---|
| A | 412, 418, 415, 421, 414 | 416.0 |
| B | 428, 431, 425, 433, 428 | 429.0 |
| C | 409, 414, 411, 407, 414 | 411.0 |
| D | 424, 419, 427, 422, 423 | 423.0 |
Grand mean , , .
Within-group sums of squares are 50.0, 38.0, 38.0, and 34.0, giving .
| Source | SS | df | MS | F |
|---|---|---|---|---|
| Supplier | 933.75 | 3 | 311.25 | 31.13 |
| Error | 160.00 | 16 | 10.00 | |
| Total | 1093.75 | 19 |
, and , so at least one supplier mean differs. The effect size is
so supplier accounts for 85.4% of the variation in tensile strength.
After a significant F
A significant 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:
| Procedure | Use |
|---|---|
| Tukey's HSD | All pairwise comparisons; the standard default |
| Dunnett's test | Comparing several treatments against one control only |
| Fisher's LSD | Least conservative; only defensible after a significant F, and even then criticized |
| Bonferroni | Simple and conservative; adjust to for comparisons |
| Scheffe | Most 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
| Assumption | How to check | Effect of violation |
|---|---|---|
| Independent observations | Study design; residuals versus run order | Serious; invalidates the test |
| Residuals normally distributed | Normal probability plot of residuals; Anderson-Darling | Mild; ANOVA is robust with balanced designs and moderate n |
| Equal variances across groups | Levene's or Bartlett's test; residuals versus fits | Moderate; 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
| Design | Question |
|---|---|
| One-way | Does one factor with levels affect the response? |
| Two-way | Do two factors affect the response, and do they interact? |
| Randomized block | Does the factor matter, after removing a known nuisance source such as batch or day? |
| ANOVA within DOE | Which 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.
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?
5.84
3.24
31.13
93.38
A one-way ANOVA across five machines returns p = 0.003. What may be concluded?
All five machine means differ from one another
The machines have unequal variances
The machine with the highest mean is significantly different from all others
At least one machine mean differs from at least one other, but the F test does not identify which pairs
Which ANOVA assumption violation is least amenable to correction and most damaging to the validity of the test?
Dependence among observations, such as autocorrelation in time-ordered data
Unequal variances with equal group sizes
Mild non-normality of residuals in a balanced design
A small number of factor levels
Sections you finish are checked off in the contents.