R: Estimate the q-values for a given set of p-values
qvalue
R Documentation
Estimate the q-values for a given set of p-values
Description
Estimate the q-values for a given set of p-values. The q-value of a
test measures the proportion of false positives incurred (called the
false discovery rate) when that particular test is called significant.
Usage
qvalue(p, fdr.level = NULL, pfdr = FALSE, ...)
Arguments
p
A vector of p-values (only necessary input).
fdr.level
A level at which to control the FDR. Must be in (0,1]. Optional; if this is
selected, a vector of TRUE and FALSE is returned that specifies
whether each q-value is less than fdr.level or not.
pfdr
An indicator of whether it is desired to make the
estimate more robust for small p-values and a direct finite sample estimate of pFDR – optional.
...
Additional arguments passed to pi0est and lfdr.
Details
The function pi0est is called internally and calculates the estimate of pi_0,
the proportion of true null hypotheses. The function lfdr is also called internally and
calculates the estimated local FDR values. Arguments for these functions can be included via ... and
will be utilized in the internal calls made in qvalue. See http://genomine.org/papers/Storey_FDR_2011.pdf
for a brief introduction to FDRs and q-values.
Value
A list of object type "qvalue" containing:
call
Function call.
pi0
An estimate of the proportion of null p-values.
qvalues
A vector of the estimated q-values (the main quantity of interest).
pvalues
A vector of the original p-values.
lfdr
A vector of the estimated local FDR values.
significant
If fdr.level is specified, and indicator of whether the
q-value fell below fdr.level (taking all such q-values to be significant
controls FDR at level fdr.level).
pi0.lambda
An estimate of the proportion of null p-values at each lambda value (see vignette).
lambda
A vector of the lambda values utilized to obtain pi0.lambda.
Storey JD, Taylor JE, and Siegmund D. (2004) Strong control,
conservative point estimation, and simultaneous conservative
consistency of false discovery rates: A unified approach. Journal of
the Royal Statistical Society, Series B, 66: 187-205. http://onlinelibrary.wiley.com/doi/10.1111/j.1467-9868.2004.00439.x/abstract
# import data
data(hedenfalk)
p <- hedenfalk$p
# get q-value object
qobj <- qvalue(p)
plot(qobj)
hist(qobj)
# options available
qobj <- qvalue(p, lambda=0.5, pfdr=TRUE)
qobj <- qvalue(p, fdr.level=0.05, pi0.method="bootstrap", adj=1.2)
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/qvalue.Rd_%03d_medium.png", width=480, height=480)
> ### Name: qvalue
> ### Title: Estimate the q-values for a given set of p-values
> ### Aliases: qvalue
> ### Keywords: qvalue
>
> ### ** Examples
>
> # import data
> data(hedenfalk)
> p <- hedenfalk$p
>
> # get q-value object
> qobj <- qvalue(p)
> plot(qobj)
> hist(qobj)
>
> # options available
> qobj <- qvalue(p, lambda=0.5, pfdr=TRUE)
> qobj <- qvalue(p, fdr.level=0.05, pi0.method="bootstrap", adj=1.2)
>
>
>
>
>
>
> dev.off()
null device
1
>