From maechler at stat.math.ethz.ch  Wed Oct 22 17:44:57 2003
From: maechler at stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Wed Oct 22 17:43:55 2003
Subject: [Rd] bug in fisher test---p-value cannot be Inf (PR#4688)
Message-ID: <200310221544.h9MFiv0P015644@pubhealth.ku.dk>

>>>>> "kjetil" == kjetil halvorsen <kjetil@entelnet.bo>
>>>>>     on Mon, 20 Oct 2003 20:18:11 +0200 (MET DST) writes:

    kjetil> I just found a bug in fisher.test(). This is rw1080, on windows XP.
    kjetil> A p-value can certainly not be Inf, but:

Thank you, Kjetil.
The bug does not seem to be version or platform dependent,
I see the same on Linux R versions 1.8.0, 1.7.1, 1.5.x.

    >> religion
    kjetil> Costumbres rel orig
    kjetil> Religion      Si Algunas veces Nunca
    kjetil> catlica  2121          4700  6234
    kjetil> prot/evan  100           216  2461
    kjetil> otra C      27            67   502
    kjetil> otra         0             0    14

Please use something like  dput() for example data in bug
reports. That way, others can easily use the same data;
alternatively, the following is sufficient to reproduce the bug :

religion <- cbind(Si = c(2121, 100, 27, 0),
                  av = c(4700, 216, 67, 0),
                  Nc = c(6234,2461,502,14))


    >> fisher.test(religion, workspace=2000000)

    kjetil> Fisher's Exact Test for Count Data

    kjetil> data:  religion 
    kjetil> p-value = Inf
    kjetil> alternative hypothesis: two.sided 

Note that this is not the first bug report on fisher.test()...

we have more cases that don't behave as desired, but these at
least give error messages instead of non-sensical results.

I have ordered the original papers and started reading them..

Martin Maechler <maechler@stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><


[Rd] bug in fisher test---p-value cannot be Inf (PR#4688)
maechler@stat.math.ethz.ch