ldd: Latent dependency detection

Description Usage Arguments Value Examples

Description

Given two sequences of paired test statistics, tests whether the latent indicators of significance are positively dependent.

Usage

1
2
ldd(T1, T2, m1 = 1000, m2 = 1000, perm = 0, p1 = TRUE, p2 = TRUE,
  jitter = NULL)

Arguments

T1, T2

paired vectors of test statistics, both must be the same length; can be p-values or otherwise; if not p-values, must be stochastically larger under the null

m1, m2

search only up the m1th (m2th) most significant test statistic in T1 (T2); NULL to search through all statistics

perm

the indices of T1 will be randomly permuted perm times; the permutation p-value will be calculated as a fraction of perm+1

p1, p2

TRUE if T1 (T2) is a vector of p-values

jitter

NULL if no jittering is desired to resolve ties, otherwise a jitter of runif(0,jitter) will be added to all entries of T1 and T2

Value

D

value of the test statistic

p.perm

permutation p-value

p.asymp

asymptotic approximate p-value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## generate paired test statistics

p <- 10^6; ## total number of pairs
X <- c(rep(0,p-30),rep(1,10),rep(2,10),rep(3,10));
## X=0: no signal in either sequence of tests
## X=1: signal in sequence 1 only
## X=2: signal in sequence 2 only
## X=3: simultaneous signal
set.seed(1);
Z1 <- rnorm(p,0,1); Z1[X==1|X==3] <- rnorm(20,3,1);
Z2 <- rnorm(p,0,1); Z2[X==2|X==3] <- rnorm(20,4,1);
## convert to p-value
P1 <- 2*pnorm(-abs(Z1));
P2 <- 2*pnorm(-abs(Z2));
## run different version of ldd()
out.pp <- ldd(P1,P2,perm=100);
out.zp <- ldd(abs(Z1),P2,p1=FALSE,perm=100);
out.pz <- ldd(P1,abs(Z2),p2=FALSE,perm=100);
out.zz <- ldd(abs(Z1),abs(Z2),p1=FALSE,p2=FALSE,perm=100);

ssa documentation built on May 1, 2019, 10:27 p.m.

Related to ldd in ssa...