Compare the means of three or more groups, then find out which pairs differ.
Your browser does not support embedded video. Download the video (MP4).
:::
Everything in the video, ready to copy:
# One-way ANOVA & post-hoc # Do iris species differ in sepal length? fit <- aov(Sepal.Length ~ Species, data = iris) summary(fit) # Tukey post-hoc: which pairs differ? TukeyHSD(fit) # Visualise the groups boxplot(Sepal.Length ~ Species, data = iris, col = "#2f6fed33", border = "#1b2a4a", ylab = "Sepal length")
Download this R script · ▶ Practice in the playground
When to use it. Use ANOVA when comparing 3+ group means on a roughly normal outcome; follow a significant result with Tukey’s HSD, which adjusts for multiple comparisons.
Read one-way ANOVA with post-hoc · t-test vs ANOVA.
Next: Non-parametric Tests →