cfdry: cfdry

Description Usage Arguments Value Author(s) Examples

View source: R/functions.R

Description

Estimate cFDR at a set of points using kernel density estimate (cFDR3 or cFDR3s)

Usage

1
cfdry(p, q, sub = 1:length(p), exclude = NULL, adj = F, ...)

Arguments

p

vector of p-values for dependent variable of interest

q

vector of p-values from other dependent variable

sub

list of indices at which to compute cFDR estimates

exclude

list of indices to exclude (each point (p[i],q[i]) is still automatically included in the computation of its own cFDR value)

adj

include estimate of Pr(H^p=0|Q<q) in estimate

...

other parameters passed to kde2d

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
# 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))


cx=cfdry(p,q)

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.