Re: [R] strange fisher.test result

From: Ted Harding <>
Date: Sat 31 Mar 2007 - 14:05:12 GMT

On 31-Mar-07 13:36:04, Williams Scott wrote:
> A simple question - using the following fishers test it appears that
> the P value is significant, but the CI includes 1. Is this result
> correct?

>> data.50p10min <- matrix(c(16,15, 8, 24),nrow=2)

>> fisher.test(data.50p10min)

> Fisher's Exact Test for Count Data
> data: data.50p10min
> p-value = 0.03941
> alternative hypothesis: true odds ratio is not equal to 1
> 95 percent confidence interval:
> 0.9810441 10.7771597
> sample estimates:
> odds ratio
> 3.138456
> Thanks for comments
> Scott

Remember that the distribution on which the Fisher Exact Test is based is a discrete distribution, so what you might expect based on experience with continuous distributions will not always be the case.

In the above case, I can see a possible explanation. The p-value is the probability of the set of data (more extreme to either side) such that the probability of (say) the element in row 1, col 1 of the 2x2 table exceeding an upper critical value is less than or equal to 0.25, and the same probabiltiy 0.025 for being less than a lower critical value.

On the other hand, the lower confidence bound for the OR is the smallest value of OR that would not be rejected by a 1-sided test at P-value 0.025, and the upper confidence bound for the OR is the largest value of OR that would not be rejected by a corresponding 1-sided test at P-value 0.025, on the given data.

There is no reason, with a discrete distribution, for the confidence interval results for OR to agree exactly with the significance test of "OR=1".

More than that I cannot say without further information.

If you would post the 2x2 table of your data, it would be possible to be more specific.

Best wishes,

E-Mail: (Ted Harding) <> Fax-to-email: +44 (0)870 094 0861
Date: 31-Mar-07                                       Time: 15:05:09
------------------------------ XFMail ------------------------------

______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sun Apr 01 00:09:08 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 31 Mar 2007 - 15:00:36 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.