From Kurt.Hornik at wu-wien.ac.at  Mon Apr  3 13:30:07 2006
From: Kurt.Hornik at wu-wien.ac.at (Kurt Hornik)
Date: Mon, 3 Apr 2006 13:30:07 +0200
Subject: [Rd] (no subject)
In-Reply-To: <20060330092932.2D15D426CD@slim.kubism.ku.dk>
References: <20060330092932.2D15D426CD@slim.kubism.ku.dk>
Message-ID: <17457.1855.786556.451122@mithrandir.hornik.net>

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



[Rd] (no subject)
Kurt Hornik