Skip to contents

Front-end over stats::p.adjust and the rmorie wrappers above. Preserves the rmorie API used by stat_commands.

Usage

adjust_p_values(p_values, method = "bh", alpha = 0.05, labels = NULL)

Arguments

p_values

Numeric vector of raw p-values.

method

One of "bonferroni", "sidak", "holm", "hochberg", "hommel", "holm_sidak", "bh" / "benjamini_hochberg" / "fdr", "by" / "benjamini_yekutieli", "storey", or "fwer" (alias of holm).

alpha

Significance level.

labels

Optional character vector of test labels.

Value

A named list of adjusted p-values with method metadata (as built by the selected adjustment method).

Examples

set.seed(1)
p <- c(runif(20), runif(5, 0, 0.005))
res <- adjust_p_values(p, method = "bh")
res$n_rejected
#> [1] 5