Skip to contents

Given a vector of p-values, this function computes the per-hypothesis critical alpha thresholds following Holm's step-down procedure (1979). Unlike p.adjust, which returns adjusted p-values, this function returns the maximum allowable alpha for each test under Holm's method.

Usage

p_to_holmalpha(p, sig.level = 0.05, na.rm = FALSE, warn = TRUE)

Arguments

p

A numeric vector of p-values. Must be within \([0, 1]\).

sig.level

Overall significance level (family-wise error rate), a single numeric value between 0 and 1. Default is 0.05.

na.rm

Logical. If TRUE, missing values in p are removed with a warning (unless warn = FALSE); if FALSE, the function stops when missing values are detected. Default is FALSE.

warn

Logical. If TRUE (default), warnings are issued for duplicated p-values or removed NAs. If FALSE, warnings are suppressed.

Value

A numeric vector of the same length as p, containing the per-hypothesis critical alpha thresholds.

Details

Holm's method sorts p-values in ascending order, compares them to sequentially adjusted thresholds \(\alpha / (K - i + 1)\), and fixes the subsequent thresholds once the first non-significant result is encountered. This function implements that procedure and restores the results to the original order of p.

References

Holm, S. (1979). A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6(2), 65–70.

See also

p.adjust for adjusted p-values.

Examples

p <- c(0.01, 0.04, 0.03, 0.20)
p_to_holmalpha(p)
#> [1] 0.01250000 0.01666667 0.01666667 0.01666667