f_hat_1: Estimate of F^1, The Distribution of p-values Under The...

Description Usage Arguments Value Author(s) Examples

View source: R/1-estimatePi.R

Description

This function estimates the cdf of p-values under the alternative H_1.

Usage

1
f_hat_1(p, t, pi_0)

Arguments

p

the vector of p-values.

t

real number between 0 and 1.

pi_0

the proportion of true nulls.

Value

CDF of p-values under the alternative at the threshold t.

Author(s)

Yet Nguyen [email protected].

Examples

1
2
3
4
5
6
7
8
n <- 10000
n1 <- 250
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)
pi_0 <- pi0(p1, lambda0)

ntyet/sfdr documentation built on Jan. 13, 2018, 6:50 a.m.