[Rd] (no subject)

From: Kurt Hornik <Kurt.Hornik_at_wu-wien.ac.at>
Date: Mon 03 Apr 2006 - 11:30:07 GMT

>>>>> gael millot writes:

> Full_Name: Gael Millot
> Version: 2.2.0.
> OS: XP
> Submission from: (NULL) (195.220.102.20)

> Hello.

> I sent an Email in r-help without answer for the moment.

> I am wondering if it could have a mistake
> in the code of the ansari.test function. For me, it seems that the function
> do not recover the p value at the correct side of the normal law N(0, 1) when it
> use
> the normal approximation (presence of ties) in a one tailed test.

> Here is what is written in ansari.test :
> p <- pnorm(normalize(STATISTIC, r, TIES))
> PVAL <- switch(alternative,
> two.sided = 2 * min(p, 1 - p),
> less = 1 - p,
> greater = p)

> pnorm() is written without "lowertail = FALSE". So it should be :
> less = p
> greater = 1-p

> Am I wrong ???

> Thanks very much for your help.

I think the code does what the docs say:

     Suppose that 'x' and 'y' are independent samples from
     distributions with densities f((t-m)/s)/s and f(t-m),
     respectively, where m is an unknown nuisance parameter and s, the
     ratio of scales, is the parameter of interest.  The Ansari-Bradley
     test is used for testing the null that s equals 1, the two-sided
     alternative being that s != 1 (the distributions differ only in
     variance), and the one-sided alternatives being s > 1 (the
     distribution underlying 'x' has a larger variance, '"greater"') or
     s < 1 ('"less"').

-k



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon Apr 03 21:58:47 2006

This archive was generated by hypermail 2.1.8 : Mon 03 Apr 2006 - 14:16:53 GMT