Home / Courses / Statistics 2 / Unit 4
Statistics 2 Unit 4: One-Way ANOVA
One-way ANOVA compares the means of three or more groups with a single F test, avoiding the false positives of many t tests. You will build the ANOVA table, interpret F, check conditions and follow up with multiple comparisons.
Covers: Logic of analysis of variance, Sums of squares and the ANOVA table, The F statistic and its distribution, Conditions for ANOVA, Multiple comparisons (Tukey, Bonferroni), Effect size and the link to the t test
Study guide
Analysis of variance asks whether several population means are equal by comparing two kinds of variation. Between-group variation measures how far the group means sit from the grand mean. Within-group variation measures how much individual values scatter around their own group mean. If H₀: μ₁ = μ₂ = … = μ_k is true, group means should differ only about as much as random noise would make them. If group means are spread out far more than within-group noise predicts, we have evidence that at least one population mean differs. Running a single ANOVA avoids the inflated false-positive rate of many separate t tests.
The total sum of squares, SST = Σ(x − x̄)², splits exactly into SSG = Σnᵢ(x̄ᵢ − x̄)² for groups and SSE = Σ(nᵢ − 1)sᵢ² for error. Each is divided by its df to form a mean square: MSG = SSG/(k − 1) and MSE = SSE/(N − k). MSE is the pooled estimate of the common variance σ². The test statistic is F = MSG/MSE, which follows an F distribution with (k − 1, N − k) df when H₀ is true. Under H₀ both mean squares estimate σ², so F is near 1; large F values give small right-tail p-values.
ANOVA conditions are independent random samples or random assignment, approximately normal populations, and a common standard deviation. Check normality with dot plots or normal plots of residuals, and check equal spread with the rule that the largest sample SD should be less than about twice the smallest. ANOVA is fairly robust to mild non-normality and to unequal SDs when group sizes are similar, but unequal SDs combined with very unequal n can seriously distort the error rate. A residual spread that grows with the group mean often responds to a log transformation; otherwise use Welch's ANOVA.
A significant F tells you only that at least one mean differs. To find which, use multiple comparisons that control the familywise error rate. Bonferroni tests each of m comparisons at α/m and works for any set of comparisons, though it becomes conservative when m is large. Tukey's HSD is designed for all pairwise differences and is usually more powerful for that job. Pairwise t statistics use the pooled MSE: t = (x̄ᵢ − x̄ⱼ)/√(MSE(1/nᵢ + 1/nⱼ)). Because adjusted tests are conservative, a borderline F can be significant even when no single pair is.
Report effect size alongside the p-value. η² = SSG/SST (equal to R² in regression terms) gives the share of total variation explained by group membership. With only two groups, one-way ANOVA is identical to the pooled two-sample t test: F = t² with (1, N − 2) df and the same p-value. As always, the design decides the scope: random assignment to treatments supports causal claims, while comparing self-selected or naturally occurring groups shows only association. Do not go hunting through pairwise tests after a non-significant F; that is a recipe for false discoveries.
Key ideas
- ANOVA compares between-group variation with within-group variation to test equality of means.
- SST = SSG + SSE, and each sum of squares has its own degrees of freedom.
- F = MSG/MSE is near 1 under H₀; large values are evidence against it.
- A significant F says at least one mean differs, not which one.
- Equal SDs matter most when group sizes are unequal; use the largest/smallest SD < 2 rule.
- Bonferroni and Tukey control the familywise error rate in follow-up comparisons.
- For two groups, F = t² from the pooled t test.
Formulas and rules
Common mistakes
- Stating H₀ in terms of sample means or concluding all means differ after a significant F.
- Dividing sums of squares by the wrong degrees of freedom (using N instead of N − k).
- Running many unadjusted t tests instead of ANOVA plus a multiple-comparison method.
- Ignoring unequal SDs when group sizes are very different.
- Treating η² or F as if it were a p-value.
Before the test, make sure you can
- State ANOVA hypotheses in terms of population means.
- Compute SSG, SSE, the mean squares and F from summary statistics.
- Fill in a partially completed ANOVA table and find the p-value.
- Check ANOVA conditions, including the equal-SD rule of thumb.
- Explain why ANOVA is used instead of many t tests.
- Apply Bonferroni adjustments and interpret multiple-comparison results.
- Compute and interpret η² as an effect size.
- Explain the relationship F = t² for two groups.
Words to know
- ANOVA
- Analysis of variance; tests equality of several means by comparing variation between and within groups.
- Factor
- The categorical explanatory variable that defines the groups.
- Grand mean
- The mean of all N observations combined.
- SSG
- Sum of squares for groups: Σnᵢ(x̄ᵢ − x̄)², variation of group means around the grand mean.
- SSE
- Sum of squares for error: Σ(nᵢ − 1)sᵢ², variation within groups.
- MSG
- SSG/(k − 1), the between-group mean square.
- MSE
- SSE/(N − k), the pooled estimate of the common variance σ².
- F statistic
- MSG/MSE; compared with an F distribution with (k − 1, N − k) df.
- F distribution
- A right-skewed distribution of ratios of mean squares, indexed by numerator and denominator df.
- Familywise error rate
- The probability of at least one Type I error across a set of comparisons.
- Bonferroni correction
- Testing each of m comparisons at level α/m to keep the familywise rate at most α.
- Tukey's HSD
- A multiple-comparison method for all pairwise differences among group means.
- η² (eta-squared)
- SSG/SST, the proportion of total variation explained by the groups.
- Welch's ANOVA
- A version of one-way ANOVA that does not assume equal variances.
- Residual
- An observation minus its group mean; used to check ANOVA conditions.
Sample practice questions
30 more questions like these, from level 1 to 5, are in the practice set.
One-way ANOVA tests the null hypothesis that:
- All k population means are equal
- All k sample means are equal
- All k population variances differ
- At least two population means are equal
Show the answer and steps
Answer: A) All k population means are equal
- H₀: μ₁ = μ₂ = … = μ_k.
- Hₐ: at least one mean differs from the others.
- Hypotheses concern population parameters, never sample means.
In one-way ANOVA, the F statistic is the ratio:
- MSG/MSE, between-group over within-group mean square
- MSE/MSG, within-group over between-group mean square
- SSE/SSG, within-group over between-group sum of squares
- SST/SSE, total over within-group sum of squares
Show the answer and steps
Answer: A) MSG/MSE, between-group over within-group mean square
- MSG measures how far group means are from the grand mean.
- MSE measures typical spread inside groups.
- F = MSG/MSE; values near 1 are consistent with H₀.
Three fertilizers are each tested on 10 plots. Mean yields are 20, 24 and 25 kg with SDs 4, 5 and 4.5 kg. What are F and the p-value?
- F = 0.25, p ≈ 0.78
- F = 3.43, p ≈ 0.012
- F = 6.86, p ≈ 0.004
- F = 3.43, p ≈ 0.047
Show the answer and steps
Answer: D) F = 3.43, p ≈ 0.047
- Grand mean = 23; SSG = 10(9 + 1 + 4) = 140; MSG = 70.
- SSE = 9(16 + 25 + 20.25) = 551.25; MSE = 551.25/27 = 20.42.
- F = 70/20.42 = 3.43 with (2, 27) df, p ≈ 0.047; 6.86 forgets to divide SSG by its df.