Learn R Programming

gCMAP (version 1.16.0)

signedRankSumTest: An implementation of the Wilcox rank sum test / Mann-Whitney test that takes into account the direction / sign of gene set members and possibly the correlation between cases

Description

This test evaluates whether the mean rank of statistics of gene set members is greater or less than the mean rank of the remaining statistic values. It extends the rankSumTestWithCorrelation function from the 'limma' package by taking into account the 'sign' of gene set members by reversing the ranks of down-regulated genes.

Usage

signedRankSumTest(statistics, index.up, index.down = NULL, input.is.ranks=FALSE, correlation=0, df = Inf, adjust.ties=TRUE)

Arguments

statistics
numeric vector giving values of the test statistic.
index.up
an index vector such that statistics[index.up] contains the values of the statistic for the up-regulated genes.
index.down
an index vector such that statistics[index.down] contains the values of the statistic for the down-regulated genes.
correlation
numeric scalar, average correlation between cases in the test group. Cases in the second group are assumed independent of each other and the first group.
df
degrees of freedom which the correlation has been estimated.
adjust.ties
logical: correct for ties ?
input.is.ranks
logical: is 'statistics' a vector of ranks ? If FALSE (default), ranks are computed. If FALSE, 'statistics' is assumed to represent ranks and is used directly.

Value

Numeric vector containing U-statistic, z-score and p-value.

Details

Please see the rankSumTestWithCorrelation function from the limma package for details.

References

Wu, D, and Smyth, GK (2012). Camera: a competitive gene set test accounting for inter-gene correlation. Submitted. Barry, W.T., Nobel, A.B., and Wright, F.A. (2008). A statistical framework for testing functional categories in microarray data. Annals of Applied Statistics 2, 286-315. Zar, JH (1999). Biostatistical Analysis 4th Edition. Prentice-Hall International, Upper Saddle River, New Jersey.

See Also

rankSumTestWithCorrelation

Examples

Run this code
genes.up   <- c(1:10)
genes.down <- c(21:30)

set.seed(123)
scores <- matrix(rnorm(200), ncol=2)

## the first gene set receives increased /
## decreased scores in the first experiment
scores[genes.up,1]   <- scores[genes.up  ,1] + 1 
scores[genes.down,1] <- scores[genes.down,1] - 1

## significantly greater
signedRankSumTest( statistics = scores[,1],
                   index.up   = genes.up,
                   index.down = genes.down)

## not signficant
signedRankSumTest( statistics = scores[,2],
                   index.up   = genes.up,
                   index.down = genes.down)

Run the code above in your browser using DataLab