comp.stat {DEDS} | R Documentation

## Computing Test Statistics for Differential Expression

### Description

This function computes test statistics, e.g., t-statitics, F-statistics, SAM, fold changes, moderated t or F statistics, B statistics, for each row of a microarray data matrix.

### Usage

    comp.stat(X, L, test = c("t", "fc", "sam", "f", "modt", "modf", "B"), extra = NULL)

### Arguments

`X` | A matrix, with m rows corresponding to variables (hypotheses) and n columns to observations. In the case of gene expression data, rows correspond to genes and columns to mRNA samples. The data can be read using `read.table`.
`L` | A vector of integers corresponding to observation (column) class labels. For k classes, the labels must be integers between 0 and k-1.
`test` | A character string specifying the statistic to be used to test the null hypothesis of no association between the variables and the class labels.
`test="t"`: | t-statistics;
`test="f"`: | F-statistics;
`test="fc"`: | fold changes;
`test="sam"`: | SAM-statistics;
`test="modt"`: | moderated t-statistics;
`test="modf"`: | moderated F-statistics;
`test="B"`: | B-statistics.
`extra` | Extra parameter needed for the test specified; see `deds.genExtra`.

### Details

The function `comp.stat` interfaces to a C function and computes various statistics for differential expression in the C environment and therefore faster than functions in R. However, functions in R that are implemented in the DEDS packages may have more flexibility in terms of specifications of arguments. Below is a table the details `comp.stat` and its equivalent R functions in the DEDS package. Note that all the R functions listed in the 2nd column of the table below return a function with bindings for a series of arguments which accept the microarray data matrix as its single argument and compute accordingly statistics.

Interface to C | R functions | Statistics
deds.stat(X, L, test="t") | tTest(L=NULL, mu=0, var.equal=FALSE) | t statistics
deds.stat(X, L, test="fc") | FC(L=NULL, is.log=TRUE, FUN=mean) | fold change
deds.stat(X, L, test="sam") | Sam(L=NULL, prob=0.5, B=200, stat.only=TRUE, verbose=FALSE, deltas, s.step=0.01, alpha.step=0.01, plot.it=FALSE) | SAM statistics
deds.stat(X, L, test="f") | fTest(L=NULL) | F statistics
deds.stat(X, L, test="modt") | tmodTest(L=NULL) | moderated t statistics
deds.stat(X, L, test="modf") | fmodTest(L=NULL) | moderated F statistics
deds.stat(X, L, test="B") | BTest(L=NULL, proportion=0.01) | B statistics

### Value

A vector of test statistics for each row of the matrix.

### Author(s)

Yuanyuan Xiao, yxiao@itsa.ucsf.edu,
Jean Yee Hwa Yang, jean@biostat.ucsf.edu.

### References

For references on B-statistics and moderated t and F statistics:

Lönnstedt, I. and Speed, T. P. (2002). Replicated microarray data. Statistica Sinica 12, 31-46.

Smyth, G. K. (2003). Linear models and empirical Bayes methods for assessing differential expression in microarray experiments. http://www.statsci.org/smyth/pubs/ebayes.pdf

### See Also

`deds.genExtra`, for B statistics: `lm.series` and `ebayes`

### Examples

    X <- matrix(rnorm(1000,0,0.5), nc=10)
    L <- rep(0:1,c(5,5))

    # genes 1-10 are differentially expressed
    X[1:10,6:10]<-X[1:10,6:10]+1

    # t statistics
    tstat <- comp.stat(X, L, test="t")

    # SAM, fudge factor set as the median of pooled genewise standard deviations
    samstat <- comp.stat(X, L, test="sam")
    # SAM, fudge factor set as the 90% of pooled genewise standard deviations
    samstat <- comp.stat(X, L, test="sam", extra=c(0.9))

    # moderated t
    modtstat <- comp.stat(X, L, test="modt")

    # B, proportion of differentially expressed genes is set at default, 1%
    Bstat <- comp.stat(X, L, test="B")
    # B, proportion of differentially expressed genes is set at  10%
    Bstat <- comp.stat(X, L, test="B", extra=c(0.1))

[Package DEDS version 1.6.0 Index]