Description Usage Arguments Value Author(s) Examples
Estimate cFDR at a set of points using parametrisation (cFDR2 or cFDR2s)
1 |
p |
vector of p-values for dependent variable of interest |
q |
vector of p-values from other dependent variable |
pars |
parameters governing fitted distribution of P,Q; get from function fit.4g |
sub |
list of indices at which to compute cFDR estimates |
adj |
include estimate of Pr(H^p=0|Q<q) in estimate |
vector of cFDR values; set to 1 if index is not in 'sub'
James Liley
1 2 3 4 5 6 7 8 9 10 11 | # Generate standardised simulated dataset
set.seed(1); n=10000; n1p=100; n1pq=100; n1q=100
zp=c(rnorm(n1p,sd=3), rnorm(n1q,sd=1),rnorm(n1pq,sd=3), rnorm(n-n1p-n1q-n1pq,sd=1))
zq=c(rnorm(n1p,sd=1), rnorm(n1q,sd=3),rnorm(n1pq,sd=3), rnorm(n-n1p-n1q-n1pq,sd=1))
p=2*pnorm(-abs(zp)); q=2*pnorm(-abs(zq))
fit_pars=fit.4g(cbind(zp,zq))$pars
cx=cfdrx(p,q,pars=fit_pars)
plot(p,q,cex=0.5,xlim=c(0,0.05)); points(p[which(cx<0.5)],q[which(cx<0.5)],col="red")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.