01 / 22

ANOVA
Assumptions

Learn the three key assumptions behind Analysis of Variance, how to check each one, and what happens when they are violated.

Biostatistics

What Is ANOVA?

Analysis of Variance (ANOVA) is a statistical test that compares the means of three or more groups to determine whether at least one group mean differs significantly from the others.

Before you can trust ANOVA results, three critical assumptions must hold. Violating them can lead to false conclusions: either detecting a difference that doesn't exist, or missing one that does.

The \(F\)-Statistic

ANOVA works by partitioning total variability into between-group and within-group components, then forming a ratio:

A large \( F \) means between-group differences are much bigger than random within-group noise: evidence against \( H_0 \). But this ratio is only valid when the assumptions are met.

The Three Key Assumptions

1. Independence
Observations within and across groups are independent of one another.
2. Normality
The residuals (or each group's data) follow a normal distribution.
3. Homogeneity of Variance
All groups share approximately equal variances (homoscedasticity).

Assumption 1: Independence

Each observation must be independent: knowing one data point tells you nothing about another. This is the most important assumption and the hardest to fix if violated.

1
Random sampling: Subjects are randomly selected from their populations.
2
Random assignment: In experiments, subjects are randomly assigned to groups.
3
No clustering: Data from the same family, classroom, or hospital ward may be correlated.

Assumption 2: Normality

The data in each group (or equivalently, the residuals \( e_{ij} = Y_{ij} - \bar{Y}_j \)) should be approximately normally distributed.

Group 1 Group 2 Measurement value Frequency

Reading a Q-Q Plot

A quantile-quantile plot compares your data quantiles to theoretical normal quantiles. Points falling close to the diagonal indicate normality.

Theoretical quantiles Sample quantiles Normal ✓ Skewed ✕

Assumption 3: Homogeneity of Variance

Also called homoscedasticity: the population variances in each group should be approximately equal:

Group A Group B Group C Equal spread ✓ Unequal ✕

How to check: Use Levene's test or Bartlett's test. A rule of thumb: if the largest group variance is no more than 4 times the smallest, the assumption is acceptable (i.e., \( \frac{s^2_{\max}}{s^2_{\min}} < 4 \)).

The ANOVA Model Formally

1
\( Y_{ij} \): the \( i \)-th observation in group \( j \).
2
\( \mu \): the overall (grand) mean.
3
\( \alpha_j \): the effect of being in group \( j \), with \( \sum \alpha_j = 0 \).
4
\( \varepsilon_{ij} \): random error: independent, normally distributed, with constant variance \( \sigma^2 \).

Checking with Residual Plots

Plot residuals vs. fitted values to check both normality and equal variance at a glance:

Good: Random scatter Fitted values Residuals Bad: Funnel pattern Fitted values

ANOVA vs. the \(t\)-Test

ANOVA Two-sample \( t \)-test
Groups compared \( k \geq 3 \) Exactly 2
Test statistic \( F \) \( t \)
Independence Required ✓ Required ✓
Normality Required ✓ Required ✓
Equal variance Required ✓ Welch's version relaxes this
Type I error control Single test at \( \alpha \) Inflated if used repeatedly

How to Check the Assumptions

1
Independence: Review the study design. Were subjects randomly sampled and randomly assigned? Any repeated measures or clustering?
2
Normality: Create a Q-Q plot or run the Shapiro-Wilk test on each group's residuals. If \( n > 30 \) per group, mild skew is acceptable.
3
Equal variance: Run Levene's test (\( p > 0.05 \) means variances are not significantly different). Or check the rule of thumb: \( \frac{s^2_{\max}}{s^2_{\min}} < 4 \).
4
Residual plot: Plot residuals vs. fitted values. Look for random scatter (good) or patterns/funnels (bad).
5
If violated: Consider data transformation (log, square root), a non-parametric alternative (Kruskal-Wallis), or Welch's ANOVA.

Example 1: Checking Independence

A researcher compares the effect of 3 diets on blood glucose levels. She randomly assigns 30 patients (10 per group) from a hospital registry.

✓
Random assignment to diet groups: each patient's outcome is not influenced by another's.
?
Potential concern: If some patients are from the same household, their diets may be correlated (shared meals).

Example 2: Checking Normality

Three fertilizer types are tested on plant height (\( n = 15 \) per group). The Shapiro-Wilk results are:

Group W statistic \( p \)-value Normal?
Fertilizer A 0.96 0.42 Yes ✓
Fertilizer B 0.94 0.28 Yes ✓
Fertilizer C 0.91 0.08 Yes ✓

Example 3: Checking Equal Variance

Continuing the fertilizer study, the group sample variances are:

A: \( s_A^2 = 4.2 \)
Smallest variance
B: \( s_B^2 = 5.8 \)
Middle variance
C: \( s_C^2 = 6.1 \)
Largest variance

Common Mistakes

✕ Ignoring Independence
Using ANOVA on repeated measures from the same subjects without a repeated-measures design inflates the \( F \)-statistic.
✕ Testing Normality on Raw Data
Normality should be assessed on residuals (or within each group), not on the combined dataset across all groups.
✕ Confusing Significance with Assumption Failure
A significant Shapiro-Wilk test (\( p < 0.05 \)) rejects normality: it means the assumption is violated, not confirmed.

When Assumptions Fail

Violated Assumption Consequence Remedy
Independence Inflated Type I error, unreliable \( F \) Repeated-measures or mixed-effects model
Normality Inaccurate \( p \)-values for small \( n \) Transform data (\(\log\), square root) or use Kruskal-Wallis
Equal variance Biased \( F \)-statistic, wrong \( p \)-values Welch's ANOVA or data transformation

Question 1 of 5

Which of the following is NOT an assumption of one-way ANOVA?

Question 2 of 5

A researcher finds that Levene's test gives \( p = 0.03 \). What should she conclude about the equal variance assumption?

Question 3 of 5

ANOVA is considered robust to mild violations of normality when:

Question 4 of 5

On a residuals vs. fitted values plot, a funnel shape (spread increasing from left to right) indicates a violation of:

Question 5 of 5

If the normality assumption is severely violated and sample sizes are small, the most appropriate non-parametric alternative to one-way ANOVA is: