shrinkt.stat {st}R Documentation

The Shrinkage t Statistic

Description

shrinkt.stat and shrinkt.fun compute the ``shrinkage t'' statistic of Opgen-Rhein and Strimmer (2007).

Usage

shrinkt.stat(X, L, var.equal=TRUE, verbose=TRUE)
shrinkt.fun(L, var.equal=TRUE, verbose=TRUE)

Arguments

X data matrix. Note that the columns correspond to variables (``genes'') and the rows to samples.
L group indicator vector. Samples belonging to the first group are assigned a `1', and those belonging to the second group a `2'.
var.equal assume equal (default) or unequal variances in each group.
verbose print out some (more or less useful) information during computation.

Details

The ``shrinkage t'' statistic is similar to the usual t statistic, with the replacement of the sample variances by corresponding shrinkage estimates. These are derived in a distribution-free fashion and with little a priori assumptions. Despite its simplicity, it can be shown that ``shrinkage t'' procduces highly accurate rankings - see Opgen-Rhein and Strimmer (2007).

Value

shrinkt.stat returns a vector containing the ``shrinkage t'' statistic for each variable/gene.
The corresponding shrinkt.fun functions return a function that produces the ``shrinkage t'' statistics when applied to a data matrix (this is very useful for simulations).

Author(s)

Rainer Opgen-Rhein (http://opgen-rhein.de) and Korbinian Strimmer (http://strimmerlab.org).

References

Opgen-Rhein, R., and K. Strimmer. 2007. Accurate ranking of differentially expressed genes by a distribution-free shrinkage approach. Statist. Appl. Genet. Mol. Biol. 6:9. (http://www.bepress.com/sagmb/vol6/iss1/art9/)

See Also

studentt.stat, diffmean.stat, efront.stat, sam.stat, samL1.stat, modt.stat.

Examples

# load st library 
library("st")

# load Choe et al. (2005) data
data(choedata)
X <- choe2.mat
dim(X) # 6 11475  
L <- choe2.L
L

# shrinkage t statistic (equal variances)
score = shrinkt.stat(X, L)
order(abs(score), decreasing=TRUE)[1:10]

# [1] 10979 11068    50  1022   724  5762    43  4790 10936  9939
#  lambda.var (variance vector):  0.3882

# shrinkage t statistic (unequal variances)
score = shrinkt.stat(X, L, var.equal=FALSE)
order(abs(score), decreasing=TRUE)[1:10]

# [1] 11068    50 10979   724    43  1022  5762 10936  9939  9769
#  lambda.var (variance vector):  0.3673   0.3362

# compute q-values and local false discovery rates
# note the procedure automatically estimates the degree of freedom 
# so any statistic following a t distribution may be supplied
library("fdrtool")
fdr.out = fdrtool(score, statistic="studentt") 
sum( fdr.out$qval < 0.05 )
sum( fdr.out$lfdr < 0.2 )
fdr.out$param

 

[Package st version 1.0.2 Index]