get_bh_threshold | R Documentation |
Given pvalues and a nominal significance level alpha, this function returns the rejection threshold of the Benjamini-Hochberg procedure, i.e. a value t_BH such that p-values with P_i <= t_BH get rejected by the procedure.
get_bh_threshold(pvals, alpha, mtests = length(pvals))
pvals |
Numeric, vector of p-values |
alpha |
Numeric in [0,1], significance level of the multiple testing procedure |
mtests |
Integer, total number of hypothesis tests; only set this (to non-default) when you know what you are doing! |
A numeric in [0,1], threshold of the BH procedure
pvalues <- c(runif(1000), rbeta(1000,0.5,7)) # generate some p-values
adj_pvalues <- p.adjust(pvalues, method="BH") # calculate adjusted p-values
t_BH <- get_bh_threshold(pvalues, 0.1) #get rejection threshold at alpha=0.1
all((pvalues <= t_BH) == (adj_pvalues <= 0.1)) #equivalence of two formulations
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.