The help page for ansari.test() says (emphasis added):

        By default (if exact is not specified), an exact p-value is computed if 
both    
samples contain less than 50 finite values **and there are no ties**. 
Otherwise, a normal approximation is used.

However, this does not appear to be the case in R 2.4.1 or R 2.5.0. In fact, 
even

        example(ansari.test)

produces a warning

        Warning message:
        cannot compute exact p-value with ties in: ansari.test.default(ramsay, 
jung.parekh)

although the "exact" parameter is omitted.

Patch:

Index: src/library/stats/R/ansari.test.R
===================================================================
--- src/library/stats/R/ansari.test.R   (revision 40902)
+++ src/library/stats/R/ansari.test.R   (working copy)
@@ -29,7 +29,7 @@
     TIES <- (length(r) != length(unique(r)))

     if(is.null(exact))
-        exact <- ((m < 50) && (n < 50))
+        exact <- ((m < 50) && (n < 50) && (!TIES))

     if(exact && !TIES) {
         pansari <- function(q, m, n) {


Regards
Thomas Friedrichsmeier

Attachment: pgp4plLqZm7WH.pgp
Description: PGP signature

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to