nFDR {nFDR}R Documentation

Nonparametric Estimate of FDR Based on Bernstein Polynomials

Description

Using the Bernstein polynomial density estimation to estimate the proportion π0 of true null hypotheses based p-values. A nonparametric estimate of false discovery rates (FDR's) are also calculated. nFDR calls a C program to search the minimizer (r,k) of a partial mean square error and returns the proportion of true null hypotheses, FDR, FNR, and q-values.

Usage

nFDR(x, r0, k0, K, alpha = 0.05, Trial.r = 5, Trial.k = 10, Method = "approx", Smooth = TRUE)

Arguments

x a vector of p-values
r0 initial guess of r
k0 initial guess of k
K Upper limit for r
alpha significance level
Trial.r number of trials for searching r
Trial.k number of trials for searching k
Method default is "approx"
Smooth default is TRUE

Details

If either of Trial.r or Trial.k is zero, then the search of (r,k) is skipped and choose (r,k)=(r0,k0).

Value

a list containing:

p sorted p-values
(r,k) minimizer of the partial mean square error pMSE
PI0 estimated proportion π0 of true null hypotheses
cint.pi0 confidence interval for the proportion π0 of true null hypotheses
FDR estimated false discovery rate (FDR) according to p
FNR estimated false nondiscovery rate (FNR) according to p
Cint.fdr confidence interval for FDR according to p
qvalue qvalue according to p

Author(s)

Zhong Guan {zguan@iusb.edu}

References

Zhong Guan, Baolin Wu and Hongyu Zhao(2005), Nonparametric estimator of false discovery rate based on Bernstein polynomials

Examples

set.seed (777)
library(nFDR) # load the package
n<-200  # sample size
pi0<-0.70 # proportion of true null hypotheses
x<-c(runif(n*pi0,0,1), rbeta(n*(1-pi0), 1, 6))
 ## simulate n p-values from mixture of beta(1,6) and uniform(0,1)
res<-nFDR(x, r0 = 5, k0 = 50, K = .5*n, alpha = 0.05, Trial.r = 3, Trial.k = 5, Method = "approx", Smooth = TRUE)
res$PI0 # estimated proportion of true nulls

[Package nFDR version 0.0 Index]