The ANOVA Family

Biostatistics

The ANOVA series: compare the means of three or more groups in R — one-way ANOVA, the normality and equal-variance assumptions, the omnibus F-test, and Tukey HSD / Games-Howell post-hoc tests — the tidy rstatix way, with base R shown.

LearnBiostatistics › The ANOVA Family

When you need to compare the means of three or more groups, the t-test isn’t enough — running it on every pair inflates the false-positive rate. ANOVA (analysis of variance) does it with a single omnibus F-test, and a post-hoc step then tells you which groups differ. This series covers the ANOVA family the tidy rstatix way, with the base-R equivalent shown, and visualized with ggpubr.

ANOVA in one minute

The fastest path: make your grouping variable a factor, run anova_test() for the omnibus F-test, and read the p-value off a boxplot that prints it on the panel:

library(ggpubr)
library(rstatix)

tg <- ToothGrowth
tg$dose <- factor(tg$dose)

ggboxplot(tg, x = "dose", y = "len", fill = "dose", palette = "jco",
          xlab = "Vitamin C dose (mg)", ylab = "Tooth length") +
  labs(subtitle = get_test_label(tg %>% anova_test(len ~ dose), detailed = TRUE))

A boxplot of guinea-pig tooth length by vitamin C dose (0.5, 1, 2 mg). Tooth length increases clearly across the three doses, with the overall one-way ANOVA p-value printed above the boxes.

library(rstatix)

tg <- ToothGrowth
tg$dose <- factor(tg$dose)

tg %>% anova_test(len ~ dose)
ANOVA Table (type II tests)

  Effect DFn DFd      F        p p<.05   ges
1   dose   2  57 67.416 9.53e-16     * 0.703

A small p-value and a large ges effect size together say: the dose really does change tooth length — now run a post-hoc test to see which doses differ.

Lessons

Note

This series is filling in wave by wave — the one-way ANOVA first (assumptions, F-test, Tukey HSD + Games-Howell post-hoc), then the Kruskal-Wallis non-parametric alternative, two-way and repeated-measures ANOVA, and a “which test should I use?” decision guide.

🟢 With an AI agent

Ask Prova “do these groups have different means, and which pairs differ?” — it answers with rstatix code you can run on your own data, then helps you read the F-test, the effect size and the post-hoc table. The runtime is the judge. Ask Prova →

Was this page helpful?

Prove you can do it. Master the whole ANOVA in R series — track your path, build projects, and earn a certificate.

Start free →

Go Pro — unlimited Prova on your own data and a verifiable certificate that proves the skill.

from $15/mo billed yearly

Go Pro →

✓ You're Pro — keep going. The runtime is the judge.

Get new R & Python lessons by email

Practical, reproducible, no spam. Unsubscribe anytime.

Double opt-in. We never share your email.

Share this pageXLinkedInRedditHN

Citation

BibTeX citation:
@online{untitled,
  author = {},
  title = {The {ANOVA} {Family}},
  url = {https://www.datanovia.com/learn/biostatistics/anova/},
  langid = {en}
}
For attribution, please cite this work as:
“The ANOVA Family.” n.d. https://www.datanovia.com/learn/biostatistics/anova/.