ANOVA Basics

Compare means across 3+ groups with an F-statistic

Back

Concept

ANOVA tests whether at least one group mean differs. It compares between-group variability to within-group variability:

F = MS_between / MS_within

If ANOVA is significant, you typically follow with post-hoc comparisons (e.g., Tukey) to identify which groups differ.

Interactive: simulate 3 treatments

Adjust group means/spreads and see how separation affects between-group vs within-group variation.

01.03
0.21.02.5
1040120
Approx F (demo): -
This page is intuition-focused; real ANOVA uses exact sums of squares and p-values.

Group distributions (samples)

When groups overlap heavily, ANOVA is less likely to find differences.

Real Dental Scenario: Whitening Treatment Sensitivity

One-way ANOVA with animated walkthrough

Study Design

A dental clinic compares tooth sensitivity scores (0-10 scale) across 3 whitening treatments. 30 patients are randomly assigned (10 per group). The question: do the treatments differ in how much sensitivity they cause?

Treatment A (n=10)

3, 4, 5, 3, 4, 5, 6, 4, 3, 5

Low-concentration peroxide gel

Treatment B (n=10)

5, 6, 7, 6, 5, 7, 8, 6, 7, 5

High-concentration peroxide gel

Treatment C (n=10)

2, 3, 2, 3, 4, 2, 3, 3, 2, 4

LED-activated whitening

1

Group Means & Grand Mean

Mean A
4.20
Mean B
6.20
Mean C
2.80
Grand Mean
4.40
2

Sum of Squares Between (SSB)

SSB = n * sum( (group_mean - grand_mean)^2 )
= 10 * [ (4.20 - 4.40)^2 + (6.20 - 4.40)^2 + (2.80 - 4.40)^2 ]
= 10 * [ 0.04 + 3.24 + 2.56 ]
= 10 * 5.84 = 58.40

SSB measures how much the group means vary around the grand mean.

3

Sum of Squares Within (SSW)

SSW = sum of (each value - its group mean)^2 across all groups
Group A: (3-4.2)^2 + (4-4.2)^2 + ... = 8.60
Group B: (5-6.2)^2 + (6-6.2)^2 + ... = 9.60
Group C: (2-2.8)^2 + (3-2.8)^2 + ... = 5.60
SSW = 8.60 + 9.60 + 5.60 = 23.80

SSW measures natural variation within each treatment group.

4

Mean Squares & F-Statistic

df_between = k - 1 = 3 - 1 = 2
df_within = N - k = 30 - 3 = 27
MSB = SSB / df_between = 58.40 / 2 = 29.20
MSW = SSW / df_within = 23.80 / 27 = 0.881
F = MSB / MSW = 29.20 / 0.881 = 33.14
5

Complete ANOVA Table

Source SS df MS F Significance
Between Groups 58.40 2 29.20 33.14 p < 0.001
Within Groups 23.80 27 0.881 - -
Total 82.20 29 - - -

Conclusion & Clinical Interpretation

Result: F(2, 27) = 33.14, p < 0.001. There is a statistically significant difference in tooth sensitivity scores across the three whitening treatments.

Treatment C
2.80
Lowest sensitivity
Best tolerated
Treatment A
4.20
Moderate sensitivity
Treatment B
6.20
Highest sensitivity
Most sensitivity

Post-hoc tests (e.g., Tukey HSD) would be needed to confirm which specific pairs of treatments differ significantly.

Dental example

Comparing mean caries score across 3 fluoride regimens is classic one-way ANOVA. If significant, use post-hoc testing to see which regimens differ.