# ============================================================
# ANOVA & Post-hoc Tests
# Biostatistics in R — Rverse Analytics
# https://rverseanalytics.com/learn-biostatistics/anova
# ============================================================

# 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")
