[R] wilcox.exact() problem

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Tue Oct 27 16:31:09 CET 2009

On Tue, 27 Oct 2009, David Croll wrote:

> Dear R friends,
> here I write again about the wilcox.exact() problem. I want to compare two sets of categorical data, and in one case it says "negative length vectors not allowed", and in the other one I get the error "cannot allocate vector of length ...".
> On http://rapidshare.com/files/298621893/wilcox.exact_trouble.Rdata.html you can download the data that cause the trouble. (Attention: 10 Downloads only, so you may have to send me an e-mail so I can mail you the Rdata file directly.)
>> library(exactRankTests)
>  Package ?exactRankTests? is no longer under development.
>  Please consider using package ?coin? instead.
>> wilcox.exact(group_1,group_2,exact=T)
> Error in .Call("cpermdist2", ma = as.integer(m), mb = as.integer(col),  :
>  negative length vectors are not allowed
>> wilcox.exact(group_3,group_4,exact=T)
> Error in .Call("cpermdist2", ma = as.integer(m), mb = as.integer(col),  :
>  cannot allocate vector of length 1621367542
> 1621367542 is the same as 2^30.59, so the memory can't be allocated on my 32-bit computer.
> Can somebody point out the problem to me?

The sample size is too large (~4000 observations per group) to solve this 
problem exactly. The error message could maybe be improved, but the 
message is clear: This is too large to deal with.

However, this is not a problem. With several thousand observations, 
standard normal approximations should work sufficiently well. And if you 
don't believe it, then you can look at approximate solutions that draw a 
sufficiently large number of permutations. Both is easily available when 
using wilcox_test() in "coin" as the startup message of "exactRankTests" 


> Kind regards,
> David
> -- 
> Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
> sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser
> ______________________________________________
> 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