From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>

Date: Thu 18 Aug 2005 - 16:45:48 EST

Date: Thu 18 Aug 2005 - 16:45:48 EST

On Wed, 17 Aug 2005, Greg Hather wrote:

> I'm having trouble with the wilcox.test command in R.

> To demonstrate the anomalous behavior of wilcox.test, consider

*>
**>> wilcox.test(c(1.5,5.5), c(1:10000), exact = F)$p.value
**> [1] 0.01438390
**>> wilcox.test(c(1.5,5.5), c(1:10000), exact = T)$p.value
**> [1] 6.39808e-07 (this calculation takes noticeably longer).
**>> wilcox.test(c(1.5,5.5), c(1:20000), exact = T)$p.value
**> (R closes/crashes)
**>
**> I believe that wilcox.test(c(1.5,5.5), c(1:10000), exact = F)$p.value
**> yields a bad result because of the normal approximation which R uses
**> when exact = F.
*

*> wilcox.test(5000+c(1.5,5.5), c(1:10000), exact = T)$p.value
*

[1] 0.9989005

even though the two samples differ in important ways.

> Any suggestions for how to compute

*> wilcox.test(c(1.5,5.5), c(1:20000), exact = T)$p.value?
*

I get (current R 2.1.1 on Linux)

*> wilcox.test(c(1.5,5.5), c(1:20000), exact = T)$p.value
*

[1] 1.59976e-07

and no crash. So the suggestion is to use a machine adequate to the task, and that probably means an OS with adequate stack size.

> [[alternative HTML version deleted]]

> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.htmlReceived on Thu Aug 18 16:52:05 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:39:51 EST
*