Applies the Sequential Bonferroni correction to a vector of p-values.
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