From maechler at stat.math.ethz.ch  Wed Jul  7 17:52:33 2004
From: maechler at stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Wed Jul  7 17:52:38 2004
Subject: [Rd] negative p-value from fisher.test() (PR#7064)
Message-ID: <20040707155233.DAC65108C7@slim.kubism.ku.dk>

>>>>> "anja" == anja von heydebreck <anja.von.heydebreck@merck.de>
>>>>>     on Wed,  7 Jul 2004 17:19:01 +0200 (CEST) writes:

    anja> Full_Name: Anja von Heydebreck Version: 1.9.1 OS:
    anja> Linux Submission from: (NULL) (155.250.128.25)


    anja> I obtained a negative p-value from the fisher.test()
    anja> function:

    >> fisher.test(matrix(c(14576,3023,89,68),2),
    >> alternative="g")$p.value
    anja> [1] -8.426593e-13

[I do get a slightly different negative P-value here].

    anja> With R 1.8.1, I got a p-value of -6.239231e-12 for
    anja> this example.

(which is slightly worse ;-)

    anja> Anja von Heydebreck

Thank you, Anja!

Note that this is the  2x2 case which does not resort to the
(in)famous FEXACT routine.  The rounding / precision problem is
rather from  dhyper() and/or phyper().

Now, as bug report PR#6772   "phyper accuracy and efficiency",
Morten Welinder
had proposed a new algorithm for phyper().
I'm about to try that and see if it cures this example.

Best regards,
Martin Maechler


[Rd] negative p-value from fisher.test() (PR#7064)
maechler@stat.math.ethz.ch