[Rd] ansari.test one-tailed (PR#8730)

gael.millot at curie.fr gael.millot at curie.fr
Thu Mar 30 11:29:32 CEST 2006


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.

Gael.

Gael Millot
UMR 7147 et Universite Paris 6
Equipe Recombinaison et instabilite genetique
Pav Trouillet Rossignol 5eme etage
Institut Curie
26 rue d'Ulm
75248 Paris Cedex 05
tel : 01 42 34 66 34
fax : 01 42 34 66 44
Email : gael.millot at curie.fr



More information about the R-devel mailing list