s-news
[Top] [All Lists]

Re: Bug in Fisher Exact test?

To: Salomon Minkin <minkin@uhnres.utoronto.ca>
Subject: Re: Bug in Fisher Exact test?
From: Sundar Dorai-Raj <sundar.dorai-raj@PDF.COM>
Date: Wed, 25 Aug 2004 17:45:05 -0700
Cc: S-PLUS Newsgroup <s-news@lists.biostat.wustl.edu>
In-reply-to: <412C48B4.A936BA15@uhnres.utoronto.ca>
Organization: PDF Solutions, Inc.
References: <412C48B4.A936BA15@uhnres.utoronto.ca>
Reply-to: sundar.dorai-raj@PDF.COM
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)


Salomon Minkin wrote:

I'm running Version 6.2 on Unix.

I'm surprised that I'm getting  zero  p-values when I'm running the
Fisher exact test on some 3 x 2 tables. Here are two examples:


fisher.test(matrix(c(0,1,2,0,0,3),nrow=2))


           Fisher's exact test
data:   matrix(c(0, 1, 2, 0, 0 ,3), nrow = 2)
p-value = 0
alternative hypothesis: two.sided


fisher.test(matrix(c(0,5,3,1,0,1),nrwo=2))


           Fisher's exact test
data:   matrix(c(0, 5, 3, 1, 0 ,1), nrow = 2)
p-value = 0
alternative hypothesis: two.sided

Clearly, there is a positive probability of observing these particular
tables keeping the margins fixed. According to my hand calculations,
the probability of observing the first table is 0.067, and for the
second table
the probability is 0.033.

Why do I get a p-value of zero?


In R, I get your hand-calculated answers. Not sure how it is different in S-PLUS.

R> fisher.test(matrix(c(0,1,2,0,0,3),nrow=2))

        Fisher's Exact Test for Count Data

data:  matrix(c(0, 1, 2, 0, 0, 3), nrow = 2)
p-value = 0.06667
alternative hypothesis: two.sided

R> fisher.test(matrix(c(0,5,3,1,0,1),nrow=2))

        Fisher's Exact Test for Count Data

data:  matrix(c(0, 5, 3, 1, 0, 1), nrow = 2)
p-value = 0.03333
alternative hypothesis: two.sided




<Prev in Thread] Current Thread [Next in Thread>