When do I use ANOVA instead of a t-test?

Comparing three or more groups, choosing a post-hoc test, and reading interactions in a two-factor design

TL;DR

Use ANOVA to compare the means of three or more groups in a continuous outcome. A significant ANOVA tells you some groups differ, but not which. Follow it with a post-hoc test (Tukey for all pairwise comparisons; Dunnett vs. a single control) that corrects for multiple comparisons.

Why not just use many t-tests?

With three groups you could run three t-tests, but each test carries its own false-positive risk, and they accumulate. ANOVA tests the single question "do any of these group means differ?" while controlling the overall error rate. Then post-hoc tests pinpoint the differences with appropriate correction.

Which ANOVA?

  • One-way ANOVA: one categorical factor with 3+ levels. Example: expression across four cell lines.
  • Two-way ANOVA: two factors at once, and crucially their interaction. Example: genotype (WT/KO) × treatment (drug/vehicle). The interaction term asks whether the drug effect depends on genotype, often the actual biological question.
  • Repeated-measures ANOVA / mixed-effects models: when the same subjects are measured repeatedly (over time, or under several conditions). For anything beyond simple repeated measures, a linear mixed-effects model is the more flexible modern tool and handles missing time points gracefully.

Drag the KO group's drug response to feel what an interaction is: parallel lines mean none, diverging or crossing lines mean the drug effect depends on genotype:

0.03.06.09.012.0response (a.u.)VehicleDrugWTKO

Interaction = +1.8. The lines diverge (or cross): the drug effect depends on genotype. That's an interaction, the usual biological question.

Assumptions

Same family as the t-test: continuous outcome, approximately normal residuals, homogeneity of variance across groups, and independent observations. Check residuals, not raw groups. If variances are clearly unequal, use Welch's ANOVA. If normality fails, use the Kruskal–Wallis test.

Post-hoc tests

A significant ANOVA tells you some group differs, not which one. Always follow it with a post-hoc test; reporting only the omnibus p-value leaves readers guessing.

Run these after a significant ANOVA (or as planned comparisons):

  • Tukey's HSD: all pairwise comparisons among groups.
  • Dunnett's: every group vs. a single control (more powerful than Tukey when control comparison is all you need).
  • Šidák / Bonferroni: a small, pre-specified set of comparisons.

Report the F statistic, degrees of freedom, p-value, and the effect sizes and CIs for the comparisons you care about.

A biology example

You compare a phenotype across vehicle, low-dose, and high-dose. One-way ANOVA gives p = 0.01 (some group differs). Dunnett's test vs. vehicle then shows high-dose differs (p = 0.008) but low-dose does not (p = 0.21). Reporting only the omnibus ANOVA would have left readers guessing which dose mattered.

Common mistakes

  • Stopping at the omnibus p-value. "ANOVA was significant" doesn't say which groups differ. You must do the post-hoc!
  • Uncorrected pairwise t-tests in place of a proper post-hoc test → inflated false positives.
  • Ignoring the interaction in a two-factor design.
  • Treating ordered doses as unordered groups. If your factor is a dose or time, a regression/trend test often uses the information better.
  • Repeated measures analyzed as independent. Use RM-ANOVA or a mixed model.

t-tests · Non-parametric tests · Multiple comparisons

Ready to run this analysis on your own data?