[R] Problem with "Cannot compute correct p-values with ties"

Bernardo Rangel Tura tura at centroin.com.br
Tue Dec 22 09:16:11 CET 2009


On Wed, 2009-12-02 at 16:52 +0800, Zhijiang Wang wrote:
> Dear All,
>    1. why did the problem happen?
>    2. How to solve it?
> 
>    --
> 
> Best wishes,
> Zhijiang Wang


Well... The algorithm for Mann-whitney test have problem with ties

To solve you can use jitter

a<-1:10
b<-1:10
wilcox.test(a,b)

	Wilcoxon rank sum test with continuity correction

data:  a and b 
W = 50, p-value = 1
alternative hypothesis: true location shift is not equal to 0 

Warning message:
In wilcox.test.default(a, b) : cannot compute exact p-value with ties

wilcox.test(a,jitter(b))

	Wilcoxon rank sum test

data:  a and jitter(b) 
W = 49, p-value = 0.9705
alternative hypothesis: true location shift is not equal to 0 

look ?jitter for more information

-- 
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
Brazil




More information about the R-help mailing list