Learn R Programming

pi0 (version 1.3-250)

znormix: Normal-mixture based estimation of LFDR and pi0

Description

This function implements the method of McLachLan, Bean and Jones (2006).

Usage

znormix(p, theoretical.null=TRUE, start.pi0, eps=1e-5, niter=Inf, verbose=FALSE)

Arguments

p
a numeric vector the p-values
theoretical.null
logical scalar, indicating whether theoretical N(0,1) null distribution is assumed for z-scores.
start.pi0
optional numeric scalar, starting value of pi0 for EM algorithm; if missing, qvalue will be called with default arguments to get this starting value.
eps
numeric scalar, maximum tolerable absolute difference of parameter estimates for successive iterations in the EM algorithm.
niter
numeric scalar, maximum number of EM iterations.
verbose
logical scalar, indicating whether excessive outputs will be printed during EM algorithm.

Value

  • A length 5 numeric named vector of estimated parameters, with class 'znormix' and attributes
  • theoretical.nullthe same as input.
  • convergedlogical, convergence status.
  • iternumeric, number of iterations.
  • callthe match.call() result.
  • lfdrnumeric vector of local false discovery rates, with order being the same as the input p-values.
  • fdrnumeric vector of false discovery rates, with order being the same as the input p-values.

Details

A two-component normal mixture model is fit thru EM algorithm on the z-scores, where z=qnorm(1-p).

References

G.J. McLachlan, R.W. Bean and L. Ben-Tovim Jones. (2006) A Simple implementation of a normal mixture approach to differential gene expression in multiclass microarrays. Bioinformatics, 22(13):1608-1615.

See Also

qvalue, histf1

Examples

Run this code
set.seed(9992722)
p=1-pnorm(c(rnorm(7000),rnorm(3000,1)))
znormix(p, eps=1e-5)['pi0'] ##  0.6759555

Run the code above in your browser using DataLab