[Rd] Error from wilcox.test
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Jan 2 08:14:56 CET 2008
Try exact = TRUE: the default switches to a normal approximation that will
not be adequate in your extreme example.
On Tue, 1 Jan 2008, Wolfgang Huber wrote:
> When one of the two groups has only one member and the other one more
> than 49, wilcox.test will exit with the below error message,
>
> n=51; wilcox.test(1:n ~ 1:n==1, conf.int=TRUE)
>
> Error in uniroot(wdiff, c(mumin, mumax), tol = 1e-04, zq =
> qnorm(alpha/2, :
> f() values at end points not of opposite sign
>
>
> whereas with n=50 a result is returned:
>
> n=50; wilcox.test(1:n ~ 1:n==1, conf.int=TRUE)
>
> Wilcoxon rank sum test
>
> data: 1:n by 1:n == 1
> W = 49, p-value = 0.04
> alternative hypothesis: true location shift is not equal to 0
> 95 percent confidence interval:
> 1 49
> sample estimates:
> difference in location
> 25
>
>
> I wonder whether it would be worthwhile to make the wilcox.test function
> handle such (admittedly pathologic) cases more gracefully.
>
>
> Happy New Year to all -
> Wolfgang
>
> ------------------------------------------------------------------
> Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
--
Brian D. Ripley, ripley at 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
More information about the R-devel
mailing list