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

Greg Snow Greg.Snow at imail.org
Wed Dec 23 18:32:50 CET 2009


Adding random noise to data in order to avoid a warning is like removing the batteries from a smoke detector to silence it rather than investigating the what is causing the alarm to go off.

If the function is giving a warning it is best to investigate why, it is possible that you can ignore the warning (the burnt toast of smoke alarm analogies) but it is best to convince yourself that it is ok.  It is also possible in this case that another tool may be more appropriate, and investigating the warning could help you find that tool.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Bernardo Rangel Tura
> Sent: Tuesday, December 22, 2009 1:16 AM
> To: ivorytower at emails.bjut.edu.cn
> Cc: R-help at r-project.org
> Subject: Re: [R] Problem with "Cannot compute correct p-values with
> ties"
> 
> 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
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list