One-way ANOVA with pairwise Bonferroni-adjusted t-tests
Value
Named list with f_statistic, p_value, n_groups, n_pairs, alpha, alpha_per_pair, pairs (data.frame), interpretation.
Examples
set.seed(2026)
n <- 30L
df <- data.frame(
y = c(rnorm(n, 0), rnorm(n, 0.5), rnorm(n, 1)),
g = rep(c("A", "B", "C"), each = n)
)
res <- mrm_anova_bonferroni(df, response_col = "y", group_col = "g")
res$alpha_per_pair # Bonferroni-corrected per-pair alpha
#> [1] 0.01666667
res$pairs # per-pair t-tests with adjusted significance flags
#> group_a group_b diff t p_raw p_bonferroni significant
#> 1 A B -0.4245 -1.7317 0.0892224185 0.2676672556 FALSE
#> 2 A C -1.1066 -3.9241 0.0002332851 0.0006998554 TRUE
#> 3 B C -0.6821 -2.7938 0.0072587093 0.0217761280 TRUE