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

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Wed, 23 Dec 2009 10:32:50 -0700

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.
______________________________________________ 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.
Received on Wed 23 Dec 2009 - 17:36:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Dec 2009 - 20:00:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive