The Bonferroni adjustment tests each of \(C\) contrasts at
\(\alpha/C\) rather than \(\alpha\), which holds the family-wise
error rate at or below \(\alpha\) whatever the contrasts are and
however they are correlated. The critical value is therefore an ordinary
upper-tail F quantile read at the smaller per-comparison rate,
$$F_{\alpha/C;\,\mathrm{df_{num}},\,\mathrm{df_{den}}},$$
which is what cv_f would return if handed alpha / C.
This function exists because the adjustment is worth naming: the whole of
it is the division, and seeing \(\alpha/C\) reported back in
area_greater is the point. Maxwell, Delaney, and Kelley (2027)
tabulate these values for one numerator degree of freedom and a
family-wise alpha of .05 in their Appendix Table A.3.
The default df_numerator = 1 covers the case the table addresses
and the one that arises in practice, since a contrast among means is a
single-degree-of-freedom question. Supply a larger value to Bonferroni
adjust a family of multiple-degree-of-freedom model comparisons.
The procedure is often called Dunn's, after Dunn (1961), who first
applied the Bonferroni inequality to multiple contrasts. It is not the
rank-sum procedure of dunn_test, which the same author
published three years later.
When something else is better. Bonferroni makes no use of the
structure of the family, so a procedure built for a particular structure
beats it there: cv_tukey_hsd is more powerful for all
pairwise comparisons, and cv_dunnett is more powerful for
comparing several treatments to one control. Bonferroni's advantage is
generality; it applies to any set of contrasts chosen in advance, and it
can beat Tukey's method when only a few of the pairwise comparisons were
planned. Because it is conservative, a step-down variant such as Holm's
is uniformly more powerful while controlling the same rate, and is
available through the method argument of
contrast_adjusted and p.adjust.