Learn R Programming

IHW (version 1.0.2)

get_bh_threshold: Data-driven threshold of Benjamini Hochberg Procedure

Description

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

Usage

get_bh_threshold(pvals, alpha, mtests = length(pvals))

Arguments

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!

Value

A numeric in [0,1], threshold of the BH procedure

Examples

Run this code
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

Run the code above in your browser using DataLab