Description Usage Arguments Details Value References Examples
utility for computing plug-in FDR
1 |
obs |
observed association scores |
perms |
vector of association scores under permutation; length should
be integer multiple of |
legacy |
logical, if TRUE, use the approximate version of pifdr() available before 12/30/2013, with additional arguments if desired |
trimToUnit |
logical, if TRUE, values greater than 1 are replaced by 1. Such values can occur, for example, with relatively small sample sizes. |
... |
extra arguments passed if legacy is TRUE |
Revised 12/30/13 to employ hist() to rapidly bin the permuted values.
Use legacy=TRUE
to obtain the
approximate implementation, for which the following remarks held:
“As currently implemented the algorithm is quadratic in length(obs)
.
While it is possible to get a unique FDR value for every element of obs
,
an approximate approach yields practically identical precision and by default this
will be used for obs
with length 2000 or more. In this case,
approx
is used with rule=2
to interpolate from the
grid-based FDR estimates back to the data values.”
Additional parameters npts
and applier
may be supplied
if legacy
is set to TRUE.
npts
defined the number of points spanning the range
of obs
to be used for a lossy grid-based computation
only used if length(obs)>npts
.
applier
is to be an sapply
-like function.
vector of plug-in FDR estimates congruent to obs
Hastie Tibshirani and Friedman Elements of Statistical Learning ch 18.7
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(1234)
op = par(no.readonly=TRUE)
par(mfrow=c(2,2))
X = c(rchisq(30000,1),rchisq(300,10))
Y = rchisq(30300*3,1)
qqplot(Y, X, xlab="null", ylab="observed")
hist(pp <- pifdr(X,Y), xlab="plug-in FDR", main=" ")
library(multtest)
rawp = 1-pchisq(X, 1)
MT <- mt.rawp2adjp(rawp)
MT2 = MT[[1]][order(MT[[2]]),]
plot(MT2[,"BH"], pp, xlab="BH FDR", ylab="plug-in FDR")
par(op)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.