Re: [Rd] negative p-value from fisher.test() (PR#7064)

From: <>
Date: Thu 08 Jul 2004 - 01:52:33 EST

>>>>> "anja" == anja von heydebreck <> >>>>> 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) (

    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 mailing list Received on Thu Jul 08 01:55:52 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:01 EST