[Rd] small bug in ansari.test

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Mar 29 23:29:02 CEST 2007


On Thursday 29 March 2007 23:05, Peter Dalgaard wrote:
> Thomas Friedrichsmeier <thomas.friedrichsmeier at ruhr-uni-bochum.de>
> > Well, to be precise, the exact p-value really isn't computed in this
> > case, but there's still the warning, as though exact=TRUE had been
> > specified, which I don't believe is intended.
>
> Yes?
>
> Those samples contain less than 50 values but there are ties, so you
> get the normal approximation with a warning.  If you specify
> exact=FALSE, you get the same result without the warning.
>
> Where's the bug??

Yes, I was a bit too fast in calling this a bug. Which is why I sent the 
second mail. Sorry about that.

What behavior you expect probably depends on how you read the exact parameter. 
Initially I read it as "if exact is omitted, chose a sensible default". It 
does not warn about there being 50 or more values either, it just picks a 
useful default, in this case. That's why it looked to me, like the current 
behavior was not intended.

If it is indeed intended, I suggest to rewrite the documentation to:

"By default (if exact is not specified) an exact test is requested if and only 
if both samples contain less than 50 finite values.

If an exact test is requested (exact==TRUE or see above), and there are no 
ties, an exact p-value is computed. If an exact test is requested, and there 
are ties, a warning is issued, and an approximation is used. In all other 
cases an approximation is used."

Admittedly, not a pretty wording, but I guess it would get the point across. 
Right now it makes me feel "hey, I didn't ask it to do an exact test, so why 
does it complain?". I also tend to be surprised, when example code produces a 
warning message without any further comment about that in the example code.

All of this is due to me working with wrong assumptions, but maybe those wrong 
assumptions are prevalent in other people as well.

Regards
Thomas Friedrichsmeier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-devel/attachments/20070329/11775e09/attachment.bin 


More information about the R-devel mailing list