Learn R Programming

PsiHat (version 1.0)

lfdr.empiricalNull: Histogram-based estimator (HBE).

Description

Wrapper of Efrons LFDR (here called Histogram-based estimator (HBE)) with empirical estimation of the null hypothesis distribution (HBEE): lfdr.empiricalNull (nulltype=1 by default) or with assumed theoretical null hypothesis distribution as N(0,1) (HBEA): lfdr.assumedNull.

Usage

lfdr.assumedNull(stat= NULL, pvalue = NULL, bre = 120, df = 7, plot = 0, ...)
lfdr.empiricalNull(stat= NULL, pvalue = NULL, nulltype = 1, bre = 120, df = 7, plot = 0, ...)

Arguments

stat
Input numeric vector of statistics. At least one of the inputs (pvalue or stat) must be non null.
pvalue
Optional input numeric vector of p-values. At least one of the inputs (pvalue or stat) must be non null. If the non empty input is a vector of p-values, the function qnorm is applied to it (see manual of package locfdr).
nulltype
Parameter for selection of the type of null hypothesis distribution in Efrons method. The value nulltype = 1 is the default in lfdr.elfdr (See function locfdr in locfdr package).
bre
Number of breaks in the discretization of the z-score axis in Efrons method (see package locfdr). Useful when the number of features is small.
df
Degrees of freedom for fitting the estimated density $f(z)$ in Efrons method (see package locfdr). Useful when the number of features is small.
plot
Optional. If plot = 0, no plots are made (see package locfdr).
...
Further arguments to pass to function locfdr to compute HBEE (see locfdr R package).

Value

A list with:
LFDR.hat
Vector of estimates of the HBE.
p0.hat
Estimated proportion of affected features p0 (null hypothesis).
stat
Input vector of statistics.
info
Method name and information about computation failure.

References

Efron, B., Turnbull, B. B., & Narasimhan, B. (2011). locfdr: Computes local false discovery rates. Retrieved from http://cran.r-project.org/src/contrib/Archive/locfdr/

See Also

lfdr.elfdr, locfdr function and package, and R package splines.

Examples

Run this code
# a statistic vector with missing elements
ss <- runif(55,-1,5) ;ss[c(13,2,5)]<-NA
# a p-values vector with missing elements
pp <- runif(55) ;pp[c(13,2,5)]<-NA

z1 <- lfdr.assumedNull(stat = ss, df = 3)
z2 <- lfdr.empiricalNull(pvalue = pp, df=3)


Run the code above in your browser using DataLab