corr_lfdr: Quantifying Information Loss of Adaptive P-Value Thresholding

Description Usage Arguments Value Examples

View source: R/corr-lfdr.R

Description

corr_lfdr computes the oracle local FDR estimate, by using revealing all p-values, and computes the Pearson correlation between it and the estimate within each step of adapt.

Usage

1
corr_lfdr(obj, x, pvals, model = NULL, niter_oracle = 100)

Arguments

obj

an 'adapt' object. Output of adapt function

x

covariates (i.e. side-information). Should be compatible to models.

pvals

a vector of values in [0, 1]. P-values

model

an optional argument. If model = NULL then the last model in obj$models is used for fitting the oracle model (i.e. with all p-values revealed). Otherwise it should be an 'adapt_model' object

niter_oracle

an positive integer. Number of iterations in EM algorithm

Value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Load estrogen data
data(estrogen)
pvals <- as.numeric(estrogen$pvals)
x <- data.frame(x = as.numeric(estrogen$ord_high))
dist <- beta_family()

# Subsample the data for convenience
inds <- (x$x <= 5000)
pvals <- pvals[inds]
x <- x[inds,,drop = FALSE]

# Run adapt_glm
library("splines")
formulas <- paste0("ns(x, df = ", 6:10, ")")
res <- adapt_glm(x = x, pvals = pvals, pi_formulas = formulas,
                 mu_formulas = formulas, dist = dist, nfits = 10)

# Run corr_lfdr
obj <- corr_lfdr(res, x, pvals)
obj$corr

adaptMT documentation built on May 1, 2019, 10:15 p.m.