Skip to contents

Applies the Sequential Bonferroni correction to a vector of p-values.

Usage

sequen_bonf(p.vals, alpha = 0.05)

Arguments

p.vals

A numeric vector of p-values to be adjusted.

alpha

A numeric value representing the significance level (default is 0.05).

Value

A list with the following components:

sig

A logical vector indicating which p-values are significant after correction.

adj.p.vals

A numeric vector of adjusted p-values.

Details

This function applies the Sequential Bonferroni correction to control the family-wise error rate (FWER) when performing multiple hypothesis tests. It adjusts the significance threshold for each p-value based on its rank in the ordered list of p-values.

Examples

# Example p-values
p.vals <- c(0.001, 0.04, 0.003, 0.08)

# Apply the sequential Bonferroni correction
results <- sequen_bonf(p.vals)

# Print significant results
results$sig
#> [1]  TRUE FALSE  TRUE FALSE

# Print adjusted p-values
results$adj.p.vals
#> [1] 0.004 0.080 0.009    NA