cfdrxl: cfdrxl

Description Usage Arguments Value Author(s) Examples

View source: R/functions.R

Description

Estimate local cFDR at a set of points using parametrisation

Usage

1
cfdrxl(p, q, pars)

Arguments

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

Value

vector of cFDR values; set to 1 if index is not in 'sub'

Author(s)

James Liley

Examples

 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=cfdrxl(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") 

jamesliley/cfdr documentation built on July 31, 2020, 9:42 a.m.