rankSumTestWithCorrelation {limma} | R Documentation

## Two Sample Wilcoxon-Mann-Whitney Rank Sum Test Allowing For Correlation

### Description

A extension of the well-known rank-based test, but allowing for correlations between cases.

### Usage

    rankSumTestWithCorrelation(index, statistics, correlation=0, df=Inf)

### Arguments

`index` | any index vector such that `statistics[index]` contains the values of the statistic for the test group.
`statistics` | numeric vector giving values of the test statistic.
`correlation` | numeric scalar, average correlation between cases in the test group. Cases in the second group are assumed independent of each other and other the first group.
`df` | degrees of freedom which the correlation has been estimated.

### Details

This function implements a correlation-adjusted version of the Wilcoxon-Mann-Whitney test proposed by Wu and Smyth (2012). It tests whether the mean rank of statistics in the test group is greater or less than the mean rank of the remaining statistic values.

When the correlation (or variance inflation factor) is zero, the function performs the usual two-sample Wilcoxon-Mann-Whitney rank sum test. The Wilcoxon-Mann-Whitney test is implemented following the formulas given in Zar (1999) Section 8.10, including corrections for ties and for continuity.

The test allows for the possibility that cases in the test group may be more highly correlated on average than cases not in the group. When the correlation is non-zero, the variance of the rank-sum statistic is computing using a formula derived from equation (4.5) of Barry et al (2008). When the correlation is positive, the variance is increased and test will become more conservative.

### Value

Numeric vector of length 2 containing the `left.tail` and `right.tail` p-values.

### Author(s)

Gordon Smyth and Di Wu

### References

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.

Wu, D, and Smyth, GK (2012). Camera: a competitive gene set test accounting for inter-gene correlation. Nucleic Acids Research 40, e133. http://nar.oxfordjournals.org/content/40/17/e133

Zar, JH (1999). Biostatistical Analysis 4th Edition. Prentice-Hall International, Upper Saddle River, New Jersey.

### See Also

`wilcox.test` performs the usual Wilcoxon-Mann-Whitney test assuming independence.

An overview of tests in limma is given in 08.Tests.

### Examples

    stat <- rnorm(100)
    index <- 1:10
    stat[index] <- stat[1:10]+1

    rankSumTestWithCorrelation(index, stat)
    rankSumTestWithCorrelation(index, stat, correlation=0.1)

    group <- rep(1,100)
    group[index] <- 2
    group <- factor(group)
    wilcox.test(stat ~ group)

[Package limma version 3.44.3 Index]