pi0: Estimate The Proportion of Nulls

Description Usage Arguments Value Examples

Description

This function estimates the proportion of true nulls using Storey's FDR method.

Usage

1
pi0(p, lambda0)

Arguments

p

a numerical vector of p-value.

lambda0

the threshold lambda where all pvalue greater than lambda are null. This is used to calculate estimator of the proportion of true nulls.

Value

estimate of the proportion of true null

Examples

1
2
3
4
5
6
7
8
n <- 1000
n1 <- 25
mu1 <- rep(0, n)
mu1[1:n1] <- rnorm(n = n1, 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))
lambda0 <- estimate.lambda(p1, B = 20)
pi0(p1, lambda0)

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

Related to pi0 in ntyet/sfdr...