sffdr | R Documentation |
Estimate the functional p-values, q-values, and local false discovery rates given a set of p-values and informative variables. The functional p-values is mapping from the functional q-value (FDR-based measure) to a p-value for type I error rate control.
sffdr(
p.value,
fpi0,
surrogate = NULL,
indep_snps = NULL,
monotone.window = NULL,
epsilon = 1e-15,
nn = NULL,
fp_ties = TRUE,
...
)
p.value |
A vector of p-values. |
fpi0 |
An estimate of the function proportion of null tests using the |
surrogate |
A surrogate variable that compresses more than one informative variables.
Default is NULL. If |
indep_snps |
A boolean vector (same size as p) specifying the set of independent tests. Default is NULL and all tests are treated independently. |
monotone.window |
Enforce monotonicity at specified step size. Default is NULL. |
epsilon |
A numerical value the truncation for the p-values during density estimation. Default is 1e-15. You may want to consider decreasing this value if there are a substantial number of small p-values. |
nn |
A numerical value specifying the nearest neighbor parameter in |
fp_ties |
A boolean specifying whether ties should be broken using the ordering of the p-values when calculating the fp-values. Only impacts the tests when the local FDR is tied. Default is TRUE. |
... |
Additional arguments passed to |
The function fpi0est
should be called externally to estimate the
functional proportion of null tests given the set of informative variables.
The surrogate functional FDR methodology builds from the functional FDR
methodology and implements some of the functions from the package.
A list of object type "sffdr" containing:
pvalues |
A vector of the original p-values. |
fpvalues |
A vector of the estimated functional p-values. |
fqvalues |
A vector of the estimated functional q-values. |
flfdr |
A vector of the estimated functional local FDR values. |
pi0 |
An vector of the original functional proportion of null tests. |
density |
An object containing the kernel density estimates from |
Andrew J. Bass
fpi0est
, plot.sffdr
# import data
data(bmi)
# separate main p-values and conditioning p-values
p <- sumstats$bmi
z <- as.matrix(sumstats[, -1])
# apply pi0_model to create model
knots <- c(0.005, 0.01, 0.025, 0.05, 0.1)
fmod <- pi0_model(z, knots = knots)
# estimate functional pi0
fpi0_out <- fpi0est(p, z = fmod$zt, pi0_model = fmod$fmod)
fpi0 <- fpi0_out$fpi0
# apply sffdr
# Note all tests are independent see 'indep_snps' argument
# The data has very small p-values, set epsilon to min of p
sffdr_out <- sffdr(p, fpi0, epsilon = min(p))
# Plot significance results
plot(sffdr_out, rng = c(0, 5e-4))
# Functional P-values, Q-values, and local FDR
fp <- sffdr_out$fpvalues
fq <- sffdr_out$fqvalues
flfdr <- sffdr_out$flfdr
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.