statforclinicians

One-way ANOVA

Tests in one step whether the mean of a measurement differs between three or more independent groups.

Statistically reviewed by Daniel Wolff on 4 November 2026.

Clinical example

Mean HbA1c after six months in patients on one of three different drugs. One measurement per patient. In a trial you would normally adjust for each patient's baseline HbA1c: see ANCOVA.

When to use it

  • The outcome is a measurement on a continuous scale.
  • You compare three or more groups, and each patient is in only one of them. With two groups, use Welch's t-test.
  • You don't need to adjust for other variables. In a randomized trial with a baseline measurement, ANCOVA adjusting for the baseline is preferred.
  • A significant result says that some means differ, not which ones.

Assumptions to check

Independent observations

One value per patient. Repeated measurements or clustered patients need a mixed model.

Roughly normal residuals, no extreme outliers

Look at a histogram or Q-Q plot of the residuals, or of each group. With moderate, similar-sized groups, ANOVA is usually fairly robust to mild non-normality. A single extreme value can still drive the result. For strong skew, see the alternatives.

Equal spread in each group (homogeneity of variance)

Compare the SDs of the groups. A much larger SD in one group is a warning sign. Unequal spread matters most when the group sizes differ, and ordinary ANOVA is not robust to it then. If the spread differs a lot, use Welch's ANOVA instead (oneway.test in R, the Welch option in SPSS). Don't let Levene's test decide for you.

What to report

  • Mean with SD, and the number of patients, per group
  • The F statistic with both degrees of freedom and the exact p-value (the Welch version if you used it)
  • Pairwise differences in means with 95% CI, adjusted for multiple comparisons
  • Which post hoc method you used and why: Tukey for all pairs, Games-Howell if the spreads differ, Dunnett if only comparisons with a control matter
  • Whether Welch's ANOVA was used

Common mistakes

Don't run many separate tests

Testing every pair of groups, outcome or time point separately piles up false positives. Use one model, prespecify the main comparison, and correct for multiple comparisons where needed.

Concluding which groups differ from the overall F-test alone. A significant F only says that some means differ.

Reporting only the p-value, without the differences in means and their 95% CIs.

Using Tukey after Welch's ANOVA. When the spreads differ, use a post hoc test that does not assume equal variances, such as Games-Howell.

Reading a non-significant ANOVA as proof that the groups are equal.

Treating ordered groups, such as dose levels, as unordered. That ignores the order and can lose power.

Ignoring the baseline value in a trial.

In R, coding the group as numbers (1, 2, 3) without making it a factor. aov then fits one slope with 1 degree of freedom instead of comparing the groups, and gives no error.

Alternatives

If your situation is…Use
Two groupsWelch's t-test
A baseline measurement is available, as in a trialANCOVA (adjusting for baseline)
The same patients are in every group, or patients are clusteredLinear mixed model
The groups are formed by two factors, or you want to test an interactionTwo-way ANOVA
You need to adjust for other variables, or the groups are ordered (regression on dose, or a linear contrast, as a test for trend, which can have more power than ANOVA)Linear regression
Skewed, always-positive outcome (analysis on the log scale gives ratios of geometric means; that page describes two groups, and the idea is the same for three or more)Unpaired t-test on log-transformed data
Strongly skewed data, small groups. This changes the question: it compares the distributions (roughly, whether values in one group tend to be higher), not the means, and it is not simply a test of medians when the spreads differKruskal-Wallis test

In your software

R
# R
trial$drug <- factor(trial$drug)   # a group coded 1/2/3 must be a factor
fit <- aov(hba1c_6m ~ drug, data = trial)
summary(fit)    # F, both degrees of freedom and the exact p-value
TukeyHSD(fit)   # diff = mean difference, lwr/upr = adjusted 95% CI, p adj = adjusted p
# If the spreads differ a lot: Welch's ANOVA, then Games-Howell
oneway.test(hba1c_6m ~ drug, data = trial)
rstatix::games_howell_test(trial, hba1c_6m ~ drug)   # install.packages("rstatix") first
SPSS
* Read the ANOVA table, or Robust Tests of Equality of Means if you use Welch.
* Levene's test is printed for information. Don't let it decide.
ONEWAY hba1c_6m BY drug
  /STATISTICS DESCRIPTIVES HOMOGENEITY WELCH
  /POSTHOC=TUKEY GH ALPHA(0.05).

Sources