Module 10

ANOVA

Comparing multiple groups at once

Analysis of Variance

  • 01

    The Problem

    Why not multiple t-tests?

  • 02

    F-Statistic

    Between vs within variance

  • 03

    Post-Hoc Tests

    Finding which groups differ

  • 04

    Effect Size

    Eta-squared and practical significance

01

The Multiple Comparison Problem

Interactive ANOVA Calculator

ANOVA Visualizer
F-statistic-
df (between)-
df (within)-
p-value-
η² (effect size)-
Click Calculate to run ANOVA

Compare three groups with ANOVA! Enter comma-separated values for each group and click Calculate F. The visualizer shows group means as bars and computes the F-statistic, degrees of freedom, p-value, and eta-squared effect size. Try making groups similar or very different to see how F changes.

The Problem with Multiple t-Tests

Comparing 4 Groups with t-tests:
A vs BA vs CA vs DB vs CB vs DC vs D
6 tests! Each with 5% Type I error rate

With 4 groups, you'd need 6 t-tests. Each has a 5% false positive rate. The chance of at least one false positive becomes 1 - (0.95)⁶ = 26%! This is the 'multiple comparison problem.'

Family-Wise Error Rate

GroupsComparisonsFamily-Wise Error
3314%
4626%
51040%
104590%
Formula: 1 - (1 - α)^k where k = number of comparisons

Family-wise error rate (FWER) is the probability of at least one false positive across all comparisons. With 10 groups, you're almost guaranteed a false positive using multiple t-tests!

ANOVA: One Omnibus Test

A
B
C
D
One Test: Are ANY means different?
α stays at 5%

ANOVA asks one question: 'Is there ANY difference among the group means?' If yes, then you do follow-up tests. This keeps Type I error controlled at α for the initial test.

02

The F-Statistic

Between vs Within Variance

Group A
Group B
Group C
F = Between-group variance / Within-group variance

F compares two types of variance: (1) Between-groups: how much do group means differ from the grand mean? (2) Within-groups: how much do individuals vary within their groups?

What Makes F Large?

Large F (significant)
Groups far apart, tight clusters
Small F (not significant)
Groups overlap, high spread

Large F means groups are well-separated relative to individual variation. Small F means groups overlap heavily. Think of it as signal-to-noise ratio.

Reading the ANOVA Table

SourceSSdfMSFp
Between120k-1 = 2605.00.012
Within324N-k = 2712--
Total444N-1 = 29---
SS = Sum of Squares | MS = Mean Square (SS/df) | F = MS_between / MS_within

The ANOVA table partitions total variance into between-group and within-group components. F = MS_between / MS_within. If p < α, at least one group mean differs significantly.

ANOVA Hypotheses

H₀
μ₁ = μ₂ = μ₃ = ... = μₖ
All group means are equal
Hₐ
At least one μᵢ differs
NOT that all are different

H₀: All group means are equal. Hₐ: At least one mean is different (not necessarily ALL different). Rejecting H₀ doesn't tell you WHICH groups differ—that requires post-hoc tests.

03

Post-Hoc Tests

After a Significant F

✓
ANOVA significant (p < 0.05)
↓
?
But WHICH groups differ?
↓
!
Post-hoc tests: pairwise comparisons

A significant ANOVA tells you 'something differs' but not what. Post-hoc tests make all pairwise comparisons while controlling family-wise error rate.

Popular Post-Hoc Tests

TestControlPowerUse When
Tukey HSDStrictModerateEqual n, all pairs
BonferroniVery strictLowerFew comparisons
SchefféVery strictLowestComplex contrasts
Games-HowellModerateGoodUnequal variances

Tukey's HSD is most common for all pairwise comparisons. Bonferroni is simpler but conservative. Scheffé allows complex contrasts. Games-Howell doesn't assume equal variances.

The Bonferroni Correction

α_adjusted = α / k
Example: 4 groups = 6 comparisons
α_adjusted = 0.05 / 6 = 0.0083
Only reject if p < 0.0083
⚠️ Very conservative with many comparisons

Bonferroni divides α by the number of comparisons. Simple but conservative—with many groups, the adjusted α becomes so small that real differences may be missed.

How to Report Results

Example write-up:

"A one-way ANOVA revealed a significant effect of treatment on test scores, F(2, 57) = 8.42, p < .001, η² = .23. Post-hoc comparisons using Tukey's HSD indicated that Group A (M = 85.2, SD = 7.1) scored significantly higher than Group B (M = 76.4, SD = 8.3), p = .003, and Group C (M = 74.1, SD = 6.9), p < .001. Groups B and C did not differ significantly (p = .58)."

Report: F(df_between, df_within) = value, p-value, effect size. Then describe post-hoc results specifying which pairs differed and which didn't.

04

Effect Size: Eta-Squared

η² (Eta-Squared)

η² = SS_between / SS_total
■ Between (35%)■ Within (65%)
η² = 0.35: Group explains 35% of variance

Eta-squared is the proportion of total variance explained by group membership. It's analogous to R² in regression. η² = 0.35 means 35% of score differences are due to group differences.

How Big is Big?

η² = .01
Small
η² = .06
Medium
η² = .14
Large
Cohen's benchmarks for ANOVA

Cohen's guidelines: η² = .01 (small), .06 (medium), .14 (large). But context matters—in some fields, η² = .04 might be practically important.

Omega-Squared: Less Biased

η² (Eta-squared)
• Easier to calculate
• Overestimates population effect
• Sample-specific
ω² (Omega-squared)
• Less biased estimate
• Better for small samples
• Preferred by some journals
ω² = (SS_between - df_between × MS_within) / (SS_total + MS_within)

η² tends to overestimate the true population effect, especially with small samples. ω² (omega-squared) provides a less biased estimate. Some journals prefer ω².

★

Real-World Examples

Apply your knowledge to practical scenarios

01

Comparing Teaching Methods

A school tests three teaching methods: Traditional lecture (Group A, n=25, x̄=72), Interactive (Group B, n=25, x̄=81), and Online (Group C, n=25, x̄=78). Total N=75. ANOVA gives F(2,72) = 8.45, p = 0.001, η² = 0.19.

Sample Data
{
  "groupA": {
    "n": 25,
    "mean": 72
  },
  "groupB": {
    "n": 25,
    "mean": 81
  },
  "groupC": {
    "n": 25,
    "mean": 78
  },
  "F": 8.45,
  "df_between": 2,
  "df_within": 72,
  "p": 0.001,
  "eta_squared": 0.19
}
Q What can we conclude from F(2,72) = 8.45, p = 0.001? +
A At least one teaching method differs significantly from the others. We reject H₀ (that all means are equal). But we don't know WHICH methods differ yet.
Q What does η² = 0.19 tell us? +
A 19% of the variance in test scores is explained by teaching method. By Cohen's guidelines (0.14 = large), this is a large effect—teaching method matters substantially.
Q Tukey HSD post-hoc tests show: A vs B: p = 0.001, A vs C: p = 0.02, B vs C: p = 0.34. Interpret these results. +
A Interactive (B) is significantly better than Traditional (A). Online (C) is also significantly better than Traditional (A). But Interactive (B) and Online (C) don't significantly differ.
Q Based on these results, what would you recommend to the school? +
A Abandon Traditional lectures for Interactive or Online methods. Both modern approaches outperform lectures. The choice between Interactive and Online could depend on costs and resources.
Key Insights
  • ANOVA answers 'is there ANY difference?' not 'which groups differ?'
  • Post-hoc tests (Tukey HSD) are needed to identify specific differences
  • Effect size (η²) helps assess practical importance beyond p-value
02

The Danger of Multiple t-Tests

A researcher wants to compare 5 training programs. Instead of ANOVA, they run all possible t-tests: 10 comparisons. They find 2 'significant' results at α = 0.05.

Q What's the probability of at least one false positive with 10 t-tests at α = 0.05? +
A Family-wise error rate = 1 - (0.95)^10 = 1 - 0.599 = 0.401. There's a 40% chance of at least one false positive even if all training programs are identical!
Q If the researcher found 2 'significant' results, how likely is it they're both false positives? +
A With 40% chance of at least one false positive, finding exactly 2 'significant' results is plausible under the null. Without correction, we can't trust these results.
Q What should the researcher have done instead? +
A Use ANOVA first. If significant, apply post-hoc tests with correction (Tukey HSD, Bonferroni). This controls family-wise error rate at α = 0.05.
Q If using Bonferroni correction, what would be the adjusted α per comparison? +
A α_adjusted = 0.05 / 10 = 0.005. Each individual test must have p < 0.005 to be considered significant. This is very conservative but controls error.
Key Insights
  • 10 t-tests at α = 0.05 gives ~40% false positive rate overall
  • ANOVA keeps family-wise error at α for the omnibus test
  • Post-hoc corrections (Tukey, Bonferroni) are essential for pairwise comparisons
03

Drug Dosage Optimization

A pharmaceutical study tests 4 doses of a pain reliever: Placebo (0mg), Low (100mg), Medium (200mg), High (400mg). N = 20 per group, 80 total. Pain reduction scores recorded. ANOVA: F(3,76) = 12.3, p < 0.001.

Q The F-test is highly significant. What do we know? +
A At least one dose differs from others in pain reduction. We don't know if higher doses are better, if there's a ceiling effect, or which specific doses differ.
Q Post-hoc shows: Placebo differs from all others (p < 0.01). Low, Medium, High don't differ from each other (p > 0.05). What does this suggest? +
A Any dose of the drug works better than placebo, but increasing the dose beyond 100mg provides no additional benefit. This suggests a ceiling effect at the low dose.
Q What are the practical implications of this finding? +
A Prescribe the lowest effective dose (100mg). Higher doses have more side effects without additional benefit. This saves costs and minimizes patient risk.
Q Could this result be a power issue (failure to detect real differences)? +
A Possibly. With n=20 per group, we might not detect small differences between doses. A larger study could reveal a dose-response relationship within the active doses.
Key Insights
  • Significant ANOVA doesn't mean all groups differ—pattern could be complex
  • Post-hoc tests reveal the actual structure of group differences
  • Ceiling effects and practical considerations matter beyond statistics
?

ANOVA Quiz

Test your understanding • Passing score: 70%

0 of 10 answered
Q1 multiple-choice

Why is ANOVA preferred over multiple t-tests when comparing 3+ groups?

Explanation: Multiple t-tests inflate Type I error rate. With 4 groups, 6 comparisons give ~26% false positive rate. ANOVA keeps error at α (e.g., 5%) for the omnibus test.
Q2 multiple-choice

The F-statistic in ANOVA is calculated as:

Explanation: F = MS_between / MS_within = Between-group variance / Within-group variance. Large F means groups differ more than individuals within groups vary.
Q3 multiple-choice

A significant ANOVA F-test tells us:

Explanation: Significant F only says 'something differs'—not what. It could be one group differs from all others, two groups differ, etc. Post-hoc tests identify which specific groups differ.
Q4 calculation

An ANOVA has k = 4 groups and N = 40 total participants. What are the degrees of freedom?

Explanation: df_between = k - 1 = 4 - 1 = 3. df_within = N - k = 40 - 4 = 36. Total df = N - 1 = 39, which equals df_between + df_within.
Q5 multiple-choice

When should you conduct post-hoc tests?

Explanation: Post-hoc tests are conducted AFTER a significant ANOVA. If F is not significant, there's no evidence of any differences, so pairwise comparisons aren't warranted.
Q6 multiple-choice

What is the interpretation of η² = 0.06?

Explanation: η² (eta-squared) is the proportion of total variance explained by group differences. η² = 0.06 means 6% of outcome variance is due to group membership (medium effect by Cohen's standards).
Q7 multiple-choice

Tukey's HSD is preferred over Bonferroni correction when:

Explanation: Tukey's HSD is designed for all pairwise comparisons with equal n. It's more powerful than Bonferroni in this case. Bonferroni is better for few specific comparisons.
Q8 multiple-choice

Cohen's benchmarks for η² effect sizes are:

Explanation: For ANOVA effect sizes: η² = .01 (small), .06 (medium), .14 (large). These differ from Cohen's d benchmarks for t-tests.
Q9 multiple-choice

What assumption is NOT required for one-way ANOVA?

Explanation: ANOVA doesn't require equal sample sizes, though unequal n can affect power and robustness. The key assumptions are independence, normality, and equal variances.
Q10 multiple-choice

If ANOVA F is not significant (p > 0.05), what's the appropriate conclusion?

Explanation: Non-significant F means we fail to reject H₀—insufficient evidence of differences. We don't conclude means ARE equal (could be low power). No post-hoc tests are needed or appropriate.

Quiz Results

0 %

← t-Tests Next: Chi-Square →