Estimated proportion of true null p-values. If NULL, then pi0est is called.
trunc
If TRUE, local FDR values >1 are set to 1. Default is TRUE.
monotone
If TRUE, local FDR values are non-decreasing with increasing p-values. Default is TRUE; this is recommended.
transf
Either a "probit" or "logit" transformation is applied to the p-values so that a local FDR estimate can be formed that
does not involve edge effects of the [0,1] interval in which the p-values lie.
adj
Numeric value that is applied as a multiple of the smoothing bandwidth used in the density estimation. Default is adj=1.0.
eps
Numeric value that is threshold for the tails of the empirical p-value distribution. Default is 10^-8.
...
Additional arguments, passed to pi0est.
Details
It is assumed that null p-values follow a Uniform(0,1) distribution.
The estimated proportion of true null hypotheses pi_0 is either
a user-provided value or the value calculated via pi0est.
This function works by forming an estimate of the marginal density of the
observed p-values, say f(p). Then the local FDR is estimated as
lFDR(p) = pi_0/f(p), with
adjustments for monotonicity and to guarantee that lFDR(p) <= 1. See the Storey (2011) reference below for a concise
mathematical definition of local FDR.
Value
A vector of estimated local FDR values, with each entry corresponding to the entries of the input p-value vector p.
# import data
data(hedenfalk)
p <- hedenfalk$p
lfdrVals <- lfdr(p)
# plot local FDR values
qobj = qvalue(p)
hist(qobj)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(qvalue)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/qvalue/lfdr.Rd_%03d_medium.png", width=480, height=480)
> ### Name: lfdr
> ### Title: Estimate local False Discovery Rate (FDR)
> ### Aliases: lfdr
> ### Keywords: Discovery False Rate, lfdr local
>
> ### ** Examples
>
> # import data
> data(hedenfalk)
> p <- hedenfalk$p
> lfdrVals <- lfdr(p)
>
> # plot local FDR values
> qobj = qvalue(p)
> hist(qobj)
>
>
>
>
>
>
> dev.off()
null device
1
>