[Rd] (no subject)

Kurt Hornik Kurt.Hornik at wu-wien.ac.at
Mon Apr 3 13:30:07 CEST 2006


>>>>> 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



More information about the R-devel mailing list