BIOSTATISTICS • COMPARING MULTIPLE GROUPS

One-Way ANOVA

A powerful method for testing whether three or more group means differ significantly using variance decomposition.

Historical Context & Motivation

In the early twentieth century, researchers frequently needed to compare outcomes across more than two experimental groups — whether evaluating the effects of different fertilizers on crop yield or assessing multiple drug dosages on patient recovery. The standard tool at the time, the t-test, could only compare two groups at a time. Running multiple pairwise t-tests inflated the probability of a Type I error — the chance of incorrectly rejecting a true null hypothesis. If you performed ten separate t-tests at α = 0.05, the probability of at least one false positive climbed to roughly 40%, rendering conclusions unreliable. What the field needed was a single omnibus test capable of evaluating all groups simultaneously while controlling the overall error rate.

1908
Student's t-Test
William Sealy Gosset, publishing under the pseudonym "Student," introduced the t-test for comparing two sample means — a breakthrough, but limited to pairwise comparisons.
1918
Fisher's Variance Components
Ronald A. Fisher published foundational work on the decomposition of variance in genetic studies, laying the conceptual groundwork for analysis of variance.
1925
ANOVA Formalized
Fisher formally introduced the Analysis of Variance (ANOVA) framework in "Statistical Methods for Research Workers," establishing the F-test as its cornerstone statistic.
1935
The Design of Experiments
Fisher published his influential text linking ANOVA to experimental design principles such as randomization, replication, and blocking — ideas that remain central to biostatistics today.
1950s+
Post-Hoc Methods & Extensions
Tukey, Scheffé, Bonferroni, and others developed multiple comparison procedures to identify which specific group means differed after a significant ANOVA result, completing the analytical workflow.

The central question that ANOVA addresses remains as relevant now as it was in Fisher's era: Can the observed differences among several group means be attributed to a genuine treatment effect, or are they simply the result of random sampling variability? One-Way ANOVA provides an elegant, unified answer by partitioning the total variability in the data into components that can be compared using a single F-statistic.

Core Principles & Definitions

One-Way ANOVA examines the effect of a single categorical independent variable (the factor) on a continuous dependent variable. The factor has k levels (groups), and the test evaluates whether at least one group mean differs significantly from the others. At its heart, ANOVA is not about comparing means directly — it is about comparing variances. If the variance between group means is substantially larger than the variance within groups, then the grouping variable likely has a real effect.

1

Variance Decomposition

Total variability (SST) is partitioned into two additive components: variation between groups (SSB) and variation within groups (SSW). This decomposition is the algebraic foundation of ANOVA.
2

The F-Ratio

The test statistic is the ratio of between-group mean square (MSB) to within-group mean square (MSW). Under H₀, F follows an F-distribution with (k − 1) and (N − k) degrees of freedom.
3

Omnibus Null Hypothesis

H₀: μ₁ = μ₂ = … = μₖ. The null states that all population means are equal. Rejection means at least one mean differs, but does not specify which one.
4

Assumptions

ANOVA requires (1) independence of observations, (2) normality of residuals within each group, and (3) homogeneity of variances (homoscedasticity) across groups.
5

Post-Hoc Testing

When the omnibus F-test is significant, follow-up pairwise comparisons (e.g., Tukey HSD, Bonferroni) identify which specific group means differ while controlling the familywise error rate.
KEY TAKEAWAY
Think of ANOVA like a noise-versus-signal detector. Imagine you are in a crowded lecture hall and several study groups are discussing different topics. The "between-group" variance is how differently the groups' average speaking volumes compare (the signal), while the "within-group" variance is the natural variation in volume among individuals within each group (the noise). ANOVA asks: is the signal loud enough, relative to the noise, to conclude that the groups are genuinely different — or could all the variation you observe be random chatter?

Visual Explanation — Variance Decomposition

The following diagram illustrates how One-Way ANOVA partitions the total variability in a dataset. Three treatment groups are shown, each with individual observations scattered around their respective group means. The grand mean is the overall average of all observations. The vertical distances between group means and the grand mean represent between-group variation (SSB), while the distances from individual observations to their group mean represent within-group variation (SSW).

Each colored horizontal line marks a group mean (x̄ᵢ). The dashed amber line represents the grand mean. Dashed vertical segments between group means and the grand mean illustrate between-group variation (SSB), while the spread of individual points around each group mean represents within-group variation (SSW).

Observe that Group 1 has a mean well above the grand mean, Group 2 sits near it, and Group 3 falls below. The larger the vertical distances between group means and the grand mean relative to the scatter within each group, the larger the F-statistic becomes. If all three group means were nearly identical, the between-group variation would be negligible and the F-ratio would hover near 1.0, offering no evidence against the null hypothesis.

Mathematical Framework

The mathematical structure of One-Way ANOVA begins with an additive model for each observation and proceeds through variance decomposition to the construction of the F-statistic. Let Yᵢⱼ denote the j-th observation in group i, where i = 1, …, k and j = 1, …, nᵢ. The total number of observations is N = Σnᵢ.

ANOVA MODEL
Yᵢⱼ = μ + αᵢ + εᵢⱼ
Where μ = overall population mean, αᵢ = effect of group i (deviation of group mean from μ), and εᵢⱼ ∼ N(0, σ²) are independent error terms. Under H₀, all αᵢ = 0.
TOTAL SUM OF SQUARES (SST)
SST = Σᵢ Σⱼ (Yᵢⱼ − Ȳ..)²
SST measures the total variability of all observations around the grand mean Ȳ.. (the mean of all N observations). Degrees of freedom: N − 1.
BETWEEN-GROUP SUM OF SQUARES (SSB)
SSB = Σᵢ nᵢ (Ȳᵢ. − Ȳ..)²
SSB captures variability due to differences among group means. Each squared deviation is weighted by the group sample size nᵢ. Degrees of freedom: k − 1.
WITHIN-GROUP SUM OF SQUARES (SSW)
SSW = Σᵢ Σⱼ (Yᵢⱼ − Ȳᵢ.)²
SSW captures variability within each group — the residual noise unaccounted for by group membership. Degrees of freedom: N − k. Note that SST = SSB + SSW.
F-STATISTIC
F = MSB / MSW = (SSB / (k − 1)) / (SSW / (N − k))
MSB (Mean Square Between) and MSW (Mean Square Within) are variance estimates obtained by dividing each sum of squares by its degrees of freedom. Under H₀, F follows an F-distribution with df₁ = k − 1 and df₂ = N − k.
💡 Why Variances, Not Means?
The name "Analysis of Variance" can be puzzling since the test is used to compare means. The key insight is that if the group means truly differ, the between-group variance estimate (MSB) will systematically overestimate σ², while the within-group estimate (MSW) remains unbiased. The F-ratio exploits this discrepancy: a large F signals that MSB is inflated beyond what random error alone would predict.

Assumptions & The F-Distribution

The validity of the One-Way ANOVA test depends on three key assumptions. Violations of these assumptions can affect the Type I error rate and power of the test. Understanding these assumptions — and how to assess them — is essential for responsible application in biostatistical research.

The three assumptions required for valid One-Way ANOVA inference.
AssumptionDescriptionHow to Check
IndependenceObservations within and across groups are independent. No subject contributes to more than one group, and values within a group do not influence each other.Ensured by study design: random sampling, random assignment to groups, no repeated measures on the same subjects.
NormalityThe residuals (εᵢⱼ) within each group follow a normal distribution. Equivalently, Yᵢⱼ is normally distributed within each group.Shapiro-Wilk test, Q-Q plots of residuals. ANOVA is robust to mild departures with moderate-to-large sample sizes (n ≥ 20 per group).
HomoscedasticityAll groups share the same population variance: σ₁² = σ₂² = … = σₖ². This ensures MSW is a valid pooled estimate of σ².Levene's test, Bartlett's test. Rule of thumb: largest group variance should not exceed 4× the smallest. If violated, use Welch's ANOVA.
The F-distribution with df₁ = 2 and df₂ = 12 is right-skewed. Under H₀, the expected F-value is approximately 1.0 (green dashed line). The rejection region lies in the right tail beyond F_crit. When the observed F exceeds this critical value, we reject H₀.

Because the F-distribution is right-skewed and bounded below by zero, the ANOVA test is always one-tailed. A very small F-value (close to 0) suggests the group means are implausibly similar — possibly indicating restricted sampling — while a very large F-value suggests the between-group variation far exceeds the within-group noise. We only reject H₀ when F falls in the upper tail beyond the critical value determined by the chosen significance level α and the degrees of freedom.

Worked Example — Drug Dosage Study

A clinical researcher investigates whether three dosages of an anti-hypertensive drug produce different mean reductions in systolic blood pressure (mmHg). Fifteen patients are randomly assigned to three groups (n = 5 per group): Low Dose, Medium Dose, and High Dose. The observed reductions are shown below.

Blood pressure reductions (mmHg) for 15 patients across three dosage groups.
Low DoseMedium DoseHigh Dose
4812
61014
5711
3915
71113
One-Way ANOVA: Drug Dosage Study
1
Step 1 — Compute Group Means and Grand MeanȲ₁ = (4 + 6 + 5 + 3 + 7) / 5 = 25 / 5 = 5.0 mmHg. Ȳ₂ = (8 + 10 + 7 + 9 + 11) / 5 = 45 / 5 = 9.0 mmHg. Ȳ₃ = (12 + 14 + 11 + 15 + 13) / 5 = 65 / 5 = 13.0 mmHg. The grand mean is Ȳ.. = (25 + 45 + 65) / 15 = 135 / 15 = 9.0 mmHg.
Ȳ₁ = 5.0, Ȳ₂ = 9.0, Ȳ₃ = 13.0, Ȳ.. = 9.0
2
Step 2 — Compute SSB (Between-Group Sum of Squares)SSB = Σ nᵢ(Ȳᵢ − Ȳ..)². Group 1: 5 × (5.0 − 9.0)² = 5 × 16 = 80. Group 2: 5 × (9.0 − 9.0)² = 5 × 0 = 0. Group 3: 5 × (13.0 − 9.0)² = 5 × 16 = 80. SSB = 80 + 0 + 80 = 160.
SSB = 160
3
Step 3 — Compute SSW (Within-Group Sum of Squares)For Group 1: (4−5)² + (6−5)² + (5−5)² + (3−5)² + (7−5)² = 1 + 1 + 0 + 4 + 4 = 10. For Group 2: (8−9)² + (10−9)² + (7−9)² + (9−9)² + (11−9)² = 1 + 1 + 4 + 0 + 4 = 10. For Group 3: (12−13)² + (14−13)² + (11−13)² + (15−13)² + (13−13)² = 1 + 1 + 4 + 4 + 0 = 10. SSW = 10 + 10 + 10 = 30.
SSW = 30
4
Step 4 — Compute Mean Squares and F-StatisticDegrees of freedom: df_B = k − 1 = 3 − 1 = 2, df_W = N − k = 15 − 3 = 12. MSB = SSB / df_B = 160 / 2 = 80. MSW = SSW / df_W = 30 / 12 = 2.5. F = MSB / MSW = 80 / 2.5 = 32.0.
F(2, 12) = 32.0
5
Step 5 — Compare to Critical Value and ConcludeAt α = 0.05, the critical value F₀.₀₅(2, 12) ≈ 3.89. Since our observed F = 32.0 far exceeds 3.89, we reject H₀. The corresponding p-value is approximately 0.00001, providing very strong evidence that the three dosage groups do not all have the same mean blood pressure reduction. A post-hoc test (e.g., Tukey HSD) would reveal which specific pairs differ.
Reject H₀ — at least one dosage group mean differs significantly (p < 0.001).

The ANOVA table below summarizes the computation. Notice how SST = SSB + SSW = 160 + 30 = 190, confirming the additive decomposition.

Complete ANOVA summary table for the drug dosage study.
SourceSSdfMSF
Between160280.032.0
Within30122.5
Total19014

Strengths, Limitations & Alternatives

One-Way ANOVA is an indispensable tool in the biostatistician's toolkit, but it is not without constraints. Understanding when to use it — and when to reach for an alternative — is as important as understanding the mechanics of the test itself.

Strengths and limitations of One-Way ANOVA.
StrengthsLimitations
Controls familywise Type I error rate when comparing multiple groups simultaneously, unlike repeated t-tests.The omnibus test only indicates that at least one mean differs — it does not identify which pair(s) differ. Post-hoc tests are required.
Relatively robust to moderate violations of normality, especially with balanced designs and n ≥ 20 per group.Assumes homogeneity of variances. Unequal variances (especially with unbalanced groups) inflate the false positive rate.
Computationally simple and widely implemented in all major statistical software packages (R, SPSS, SAS, Python).Can only handle one factor. For studies with two or more factors, Two-Way or factorial ANOVA is needed.
Provides a clear framework for variance decomposition, yielding interpretable effect size measures such as η² (eta-squared).Requires independent observations. Repeated measures on the same subjects violate this assumption and require RM-ANOVA.
WHEN TO USE ALTERNATIVES
If the assumption of equal variances is violated, consider Welch's ANOVA, which does not pool variances. If the normality assumption is severely violated and sample sizes are small, the Kruskal-Wallis H test provides a nonparametric alternative that compares rank distributions rather than means. Think of these alternatives as different lenses for examining the same data — each lens is optimized for different conditions, and selecting the right one ensures your conclusions remain valid.

Connection to Advanced Methods

One-Way ANOVA occupies a foundational position within the broader statistical landscape. Recognizing how it connects to more advanced methods deepens your understanding and prepares you for complex research designs encountered in graduate-level biostatistics and epidemiology.

How One-Way ANOVA connects to more advanced statistical methods.
FeatureOne-Way ANOVAAdvanced Extension
Number of factorsSingle factor with k levelsTwo-Way / Factorial ANOVA handles two or more factors and their interactions
Repeated observationsIndependent observations onlyRepeated Measures ANOVA accounts for within-subject correlation across time points
CovariatesNo continuous covariatesANCOVA incorporates one or more continuous covariates to reduce error variance
Outcome typeContinuous dependent variableGeneralized linear models extend to binary, count, or ordinal outcomes
Regression linkEquivalent to regression with k − 1 dummy variablesThe General Linear Model (GLM) unifies ANOVA and regression into a single framework

A particularly elegant connection is that One-Way ANOVA is algebraically identical to a linear regression with k − 1 indicator (dummy) variables. The regression F-test for overall model significance produces the exact same F-statistic and p-value as the ANOVA F-test. This means that every ANOVA can be re-expressed as a regression problem, and the reverse is also true when the predictors are categorical. Understanding this equivalence is a gateway to the General Linear Model, which forms the backbone of modern applied statistics.

📊 Effect Size: η² (Eta-Squared)
Beyond statistical significance, reporting effect size is essential. η² = SSB / SST represents the proportion of total variance explained by the grouping factor. In our worked example, η² = 160 / 190 ≈ 0.842, meaning that drug dosage accounts for approximately 84% of the variability in blood pressure reduction — a very large effect. Note that η² tends to overestimate the population effect; partial η² or ω² (omega-squared) provide less biased alternatives.

Practice Problems

PROBLEM 1CONCEPTUAL
A researcher compares the mean cholesterol levels across four different diet types. She runs a One-Way ANOVA and obtains F(3, 36) = 0.85, p = 0.48. Interpret this result in context. Why is it important that she used ANOVA instead of performing six separate t-tests?
PROBLEM 2BASIC CALCULATION
Three groups of n = 4 subjects each have group means Ȳ₁ = 10, Ȳ₂ = 14, Ȳ₃ = 18. The grand mean is 14. If SSW = 36, compute SSB, MSB, MSW, and the F-statistic.
PROBLEM 3INTERMEDIATE
An epidemiologist tests whether mean recovery time (days) differs among three treatment protocols. The ANOVA table shows SSB = 200, SST = 500, with k = 3 groups and N = 30 total patients. (a) Find SSW, MSB, MSW, and F. (b) Compute η² and interpret it. (c) At α = 0.01, is the result significant? (F₀.₀₁(2, 27) ≈ 5.49)
PROBLEM 4APPLIED
A pharmaceutical company tests four formulations of an analgesic on 24 patients (6 per group). The observed group means for pain reduction (0–100 scale) are: Ȳ₁ = 42, Ȳ₂ = 50, Ȳ₃ = 48, Ȳ₄ = 60. The grand mean is 50. SSW = 840. (a) Perform the complete ANOVA. (b) Levene's test yields p = 0.02. What concern does this raise, and what alternative approach might be used? (c) If the ANOVA is significant, which post-hoc test would you recommend and why?
PROBLEM 5CRITICAL THINKING
Prove algebraically that when k = 2 (only two groups with equal sample sizes), the ANOVA F-statistic equals the square of the independent-samples t-statistic (i.e., F = t²). Then explain the conceptual implications of this relationship for the broader statistical framework.

One-Way ANOVA — Summary

One-Way ANOVA is an omnibus test that compares the means of three or more independent groups by decomposing the total variability (SST) into between-group variation (SSB) and within-group variation (SSW). The F-statistic (MSB / MSW) is compared against the F-distribution with df₁ = k − 1 and df₂ = N − k. A large F-value indicates that the between-group signal exceeds the within-group noise, leading to rejection of the null hypothesis H₀: μ₁ = μ₂ = … = μₖ.

The test requires independence, normality of residuals, and homogeneity of variances. When the omnibus test is significant, post-hoc comparisons (Tukey HSD, Bonferroni) identify which specific group means differ. Report effect sizes (η²) alongside p-values to convey practical significance. One-Way ANOVA is a special case of the General Linear Model, connecting it to regression, ANCOVA, factorial designs, and repeated measures — making it a gateway to the full spectrum of modern biostatistical analysis.

Varsity Tutors • Biostatistics • One-Way ANOVA