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

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/000091HBE.R

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

1
2
3
4
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.

Note

Functions lfdr.assumedNull and lfdr.empirical are based on function locfdr from package locfdr (v1.1.7). See references.

If computation fails for all features, p0.hat is set to NA and LFDR.hat is set to a vector of NA with lenght equal to the number of features. If it fails for a given feature, only the resulting LFDR for that feature is set to NA. Error messages are not suppressed.

Author(s)

Code: David R. Bickel and Marta Padilla (modifications).
Documentation: Alaa Ali, Kyle Leckett, Marta Padilla.
Authors of R package locfdr on which these functions are based: Bradley Efron, Brit B. Turnbull, Balasubramanian Narasimhan.

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

1
2
3
4
5
6
7
# 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)

PsiHat documentation built on May 30, 2017, 7:12 a.m.