corr_lfdr {adaptMT} | R Documentation |
Quantifying Information Loss of Adaptive P-Value Thresholding
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
corr_lfdr(obj, x, pvals, model = NULL, niter_oracle = 100)
Arguments
obj |
an 'adapt' object. Output of |
x |
covariates (i.e. side-information). Should be compatible to |
pvals |
a vector of values in [0, 1]. P-values |
model |
an optional argument. If |
niter_oracle |
an positive integer. Number of iterations in EM algorithm |
Value
corra vector of values in [0, 1]. Pearson correlation of oracle local FDR estimate and the estimates within each step. Each value corresponds to an entry of
obj$params
oracle_lfdra vector of values in [0, 1]. Oracle local FDR estimate
lfdra matrix of values in [0, 1]. Local FDR estimates within each step.
alphasa vector of values in [0, 1]. The target FDR levels corresponding to each local FDR estimate
nmasksa vector of integers. The number of masked p-values corresponding to each local FDR estimate
Examples
# 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