pi00: Estimates of pi_00, the Proportion of Simultaneous True Nulls...

Description Usage Arguments Value Examples

Description

This function estimate Proportion of Simultaneous True Nulls in Two Independent Experiments from the inputs including 2 vectors of p-values.

Usage

1
pi00(p1, p2, lambda1, lambda2)

Arguments

p1, p2

vectors of p-values of the two independent experiments.

lambda1, lambda2

lambda thresholds for the two experiments.

Value

The function returns an estimate of the proportion of the number of true simultaneous nulls. The value is a real number between 0 and 1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
n <- 1000
n11 <- 25; n10 <- n01 <- 0; n00 <- n - (n11 + n10 + n01)
mu1 <- rep(0, n)
mu1[1:(n11+n10)] <- rnorm(n = n11+n10, mean = 6,sd = 1)
t1 <- plyr::laply(1:n, function(i)rt(n = 1, df = 4, ncp = mu1[i]))
p1 <- plyr::laply(1:n, function(i)2*pt(q = abs(t1[i]), df = 4, ncp = 0, lower.tail = FALSE))
lambda1 <- estimate.lambda(p1, B = 20)
mu2 <- rep(0, n)
mu2[c(1:n11, (n11+n10+1):(n11+n10+n01))] <- rnorm(n = n11+n01, mean = 6,sd = 1)
t2 <- plyr::laply(1:n, function(i)rt(n = 1, df = 4, ncp = mu2[i]))
p2 <- plyr::laply(1:n, function(i)2*pt(q = abs(t2[i]), df = 4, ncp = 0, lower.tail = FALSE))
lambda2 <- estimate.lambda(p2, B = 20)
pi_00 <- pi00(p1, p2, lambda1, lambda2)
pi_00

ntyet/sfdr documentation built on May 7, 2019, 1:30 p.m.

Related to pi00 in ntyet/sfdr...