nlocfdr.est: LFDR based shrinkage estimator.

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

Description

Shrinkage estimator based on Efrons local false discovery rate (LFDR).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
nlocfdr.est(x.stat = NULL, y.pvalue = NULL, pval.fun = t.test, arglis.pvalfun = list(),
    alternative = "greater", param = NULL, param0 = NULL, logx = TRUE, nulltype = 0,
    q.norm = T, ...)

nlocfdr.x(x = NULL, y = NULL, pval.fun = t.test, arglis.pvalfun = list(),
    alternative = "greater", param = NULL, param0 = NULL,  logx = TRUE, nulltype = 0,
    q.norm = T, ...)

nlocfdr.stat(stat = NULL, pvalue = NULL, param = NULL, param0 = 0, nulltype = 0,
    q.norm = T, ...)

Arguments

x.stat

Input data matrix (features (rows) x samples (columns)) or numeric vector of statistics for the general function nlocfdr.est.

y.pvalue

Optional input data matrix or numeric vector of pvalues for the general function nlocfdr.est.

x

Input data matrix: features (rows) x samples (columns) for function nlocfdr.x. See examples.

y

Optional input data matrix for function nlocfdr.x.

stat

Input (numeric) vector of statistics for function nlocfdr.stat. Pvalues (pvalue) or statistics (stat) must be non null.

pvalue

Input (numeric) vector of pvalues for function nlocfdr.stat (see Note).

pval.fun

Function to compute p-values from the input data. Usually: "t.test", "wilcox.test", etc.

alternative

Argument for input function pval.fun, type of p-values to be computed: "less", "greater", "two-sided" (see stats R package).

arglis.pvalfun

Further arguments for the input function pval.fun (see stats R package).

param

Numeric vector as the parameter of interest (effect-size). If input param = NULL, it is internally computed from the input matrices x and y if they are given.

param0

Null value of the parameter of interest (i.e. log fold change corresponding to no change, usually 0). If input param0 = NULL, it is internally set.

logx

If logx = TRUE (and param = NULL and param0 = NULL), param is computed internally considering that input matrices x and y are logarithms, and param0 is set to 0.

nulltype

Parameter for selection of the type of null hypothesis distribution in Efrons method (package locfdr):

0:

theoretical null hypothesis distribution,

1-3:

empirical null hypothesis distribution (See function locfdr in locfdr package).

q.norm

If q.norm = TRUE, stat is internally computed from pvalue (see Note).

...

Further arguments to pass to function locfdr (see package locfdr).

Value

A vector of length equal to the total number of features (i.e. proteins, genes,...).

Note

when stat is empty (or q.norm = TRUE), the vector stat is internally computed by qnorm(pvalue) if pvalue is available.

When inputs param and/or param0 are not given, they are computed internally from matrices x and y.

If logx = TRUE then param = \bar{x} - \bar{y} and param0 is set to 0, while if logx = FALSE then param = \bar{x} / \bar{y} and param0 is set to 1.

Function nlocfdr.stat needs inputs param and param0.

Author(s)

Code: Corey M. Yanofsky, Zahra Montazeri, David R. Bickel and Marta Padilla (modifications)
Documentation: Alaa Ali and Marta Padilla

References

Yanofsky, C. M., & Bickel, D. R. (2010). Validation of differential gene expression algorithms: Application comparing fold-change estimation to hypothesis testing. BMC Bioinformatics, 11, 63.

Montazeri, Z., Yanofsky, C. M., & Bickel, D. R. (2010). Shrinkage estimation of effect sizes as an alternative to hypothesis testing followed by estimation in high-dimensional biology: Applications to differential gene expression. Statistical Applications in Genetics and Molecular Biology, 9, 23.

See Also

Function and package locfdr.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#simulate some data sets: matrices of log-abundance levels
nsam<-20        #number of individuals
nfeat<-40       #number of features (metabolites, genes,...)
diffs<-c(1:4)   #features with differential log-abundance levels
lfc<-5          #differential quantity

# create data sets:
x <- matrix(rnorm(nfeat*nsam), nrow = nfeat, ncol = nsam) #case
y <- matrix(rnorm(nfeat*nsam), nrow = nfeat, ncol = nsam) #control
x[diffs,] <- x[diffs,] + lfc

stat<-rnorm(nfeat) #a vector of statistics
stat[diffs]<-stat[diffs]+lfc

# shrinkage estimator ----------
z1 <- nlocfdr.stat(stat=stat,param=rowMeans(x))
z2 <- nlocfdr.x(x=x,y=y,pval.fun="wilcox.test",nulltype=1,df=3)      

Shrinkage documentation built on Sept. 12, 2016, 9:41 a.m.