Skip to contents

Delegates to qvalue::pi0est (Bioconductor) when installed and method = "storey". Otherwise computes the cutoff-based or bootstrap-based estimator inline.

Usage

estimate_pi0(p_values, method = c("storey", "bootstrap", "two_step"))

Arguments

p_values

Numeric vector of raw p-values.

method

One of "storey", "bootstrap", or "two_step".

Value

A scalar pi0 estimate in [0, 1].

Examples

set.seed(1)
p <- c(runif(80), runif(20, 0, 0.005))
estimate_pi0(p, method = "storey")
#> [1] 0.7306895