[R] strange fisher.test result

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Mar 31 16:29:21 CEST 2007


The two-sided test of odds-ratio=1 is not necessarily (nor in 
this case) the same thing as an equal-tailed confidence interval: see the 
help page comment

      Two-sided tests are based on the probabilities of the tables, and
      take as 'more extreme' all tables with probabilities less than or
      equal to that of the observed table, the p-value being the sum of
      such probabilities.

> fisher.test(data.50p10min, alternative="greater", conf.level=0.975)

         Fisher's Exact Test for Count Data

data:  data.50p10min
p-value = 0.02727
alternative hypothesis: true odds ratio is greater than 1
97.5 percent confidence interval:
  0.9810441       Inf
sample estimates:
odds ratio
   3.138456

which is not significant at 2.5%, and the two-tailed p-value is not double 
it.  There are other ways to compute confidence intervals, but R's 
fisher.test() gives the 97.5% lower and upper confidence limits.


On Sat, 31 Mar 2007, 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


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list