R: Exact p-values Wilcoxon Matched Pairs Test with Ties

2k Views Asked by At

How can exact p-values be obtained for this test when there are ties? Wilcox.test returns warnings when this happens as shown:

1: In wilcox.test.default(x = c3a0, y = c3a1, alternative = c("two.sided",  :
  cannot compute exact p-value with ties
2: In wilcox.test.default(x = c3a0, y = c3a1, alternative = c("two.sided",  :
  cannot compute exact confidence interval with ties 
1

There are 1 best solutions below

0
On

The coin::wilcoxsign_test() method handles ties using two options: Wilcoxon and Pratt. Let me quote the documentation ("zeros" refer to the ties):

For wilcoxsign_test, the default method of handling zeros (zero.method = "Pratt"), due to Pratt (1959), first rank-transforms the absolute differences (including zeros) and then discards the ranks corresponding to the zero-differences. The proposal by Wilcoxon (1949, p. 6) first discards the zero-differences and then rank-transforms the remaining absolute differences (zero.method ="Wilcoxon").

Starting with coin version 1.0-16, the zero.method argument replaced the (now removed) ties.method argument. The current default is zero.method = "Pratt" whereas earlier versions had ties.method= "HollanderWolfe", which is equivalent to zero.method = "Wilcoxon"

https://cran.r-project.org/web/packages/coin/coin.pdf