Solved – Algorithm and R code for dealing with ties in Wilcoxon rank-sum test

rrankswilcoxon-mann-whitney-test

  1. I think one of the algorithms used to handle ties for the Wilcoxon rank-sum test (a.k.a., Mann-Whitney U test) is Streitberg / Rohmel. I could not find a good source which explains the algorithm / gives a proof / or even simply outlines the algorithm. Could someone please explain this algorithm, or some other algorithm which also solves the ties problem?

  2. What would be the R code used to get exact p-values / distributions for a Wilcoxon rank-sum test (a.k.a., Mann-Whitney U test)?

Best Answer

  1. The Streitberg-Röhmel shift algorithm is described in two manuscripts:

    • Streitberg B, Röhmel J (1986). "Exact Distributions for Permutation and Rank Tests: An Introduction to Some Recently Published Algorithms." Statistical Software Newsletter, 12(1), 10-17. ISSN 1609-3631.

    • Streitberg B, Röhmel J (1987). "Exakte Verteilungen für Rang- und Randomisierungstests im allgemeinen c-Stichprobenfall." EDV in Medizin und Biologie, 18(1), 12-19.

    Both are not exactly mainstream journals and one manuscript is in German...which explains why this algorithm is less well-known than the network algorithm by Mehta & Patel underlying their proprietary StatXact software.

    The Streitberg-Röhmel shift algorithm (and Van de Wiel's split-up algorithm) are implemented in the R package coin for conditional inference. See:

    • Hothorn T, Hornik K, Van de Wiel MA, Zeileis A (2006). "A Lego System for Conditional Inference". The American Statistician, 60(3), 257-263.

    • Hothorn T, Hornik K, Van de Wiel MA, Zeileis A (2008). "Implementing a Class of Permutation Tests: The coin Package." Journal of Statistical Software, 28(8), 1-23.

  2. The R code for the Streitberg-Röhmel algorithm is contained in the file coin/R/ExactDistributions.R in the coin source package, available from CRAN.