# [R] Fisher test problem

Viju Moses vijumoses at gmail.com
Sun Mar 22 07:39:53 CET 2009

```As you say, I guess that's not possible. Meanwhile I've got R's results verified in Stata

. tabi 17 6 \ 2 1, chi2 exact

|          col
row |         1          2 |     Total
-----------+----------------------+----------
1 |        17          6 |        23
2 |         2          1 |         3
-----------+----------------------+----------
Total |        19          7 |        26

Pearson chi2(1) =   0.0708   Pr = 0.790
Fisher's exact =                 1.000
1-sided Fisher's exact =                 0.627

The OpenEpi.com output was: (note the 2 tailed P value (fisher test))

Chi Square and Exact Measures of Association
Test	Value	p-value(1-tail)	p-value(2-tail)
Uncorrected chi square	0.07083	0.3951	0.7901
Yates corrected chi square	0.1813	0.3351	0.6702
Mantel-Haenszel chi square	0.06811	0.3971	0.7941
Fisher exact		0.6273	1.25
Mid-P exact		0.3971	0.7942

Thanks for pointing it out.. Had been under the notion that OpenEpi was very... strong (being associated with EpiInfo and WHO).

Viju

Tal Galili wrote:
> Viju Moses,
> Are you sure you got a P-value of 1.25  ?
> Since P-value could only be between 0 to 1...
>
> Tal
>
>
>
>
>
> On Sat, Mar 21, 2009 at 9:17 PM, Viju Moses <vijumoses at gmail.com
> <mailto:vijumoses at gmail.com>> wrote:
>
>     Hi, I noted a discrepancy between R and openepi when I ran a fisher
>     test with the same matrix. In R:
>
>      > a=matrix(c(1,2,6,17), nrow=2)
>      > a
>        [,1] [,2]
>     [1,]    1    6
>     [2,]    2   17
>      > fisher.test(a, conf.int <http://conf.int>=T)
>
>           Fisher's Exact Test for Count Data
>
>     data:  a
>     p-value = 1
>     alternative hypothesis: true odds ratio is not equal to 1
>     95 percent confidence interval:
>      0.02061498 31.73691924
>     sample estimates:
>     odds ratio
>      1.396646
>
>     But in openepi the P value is 1.25. (In another instance too for
>     other sets of data, I had got a p value of 1 in 3 instances for a
>     prop.test when I got 3 other answers on a friend's stata software
>     with the same data. )
>
>     I'm using R on Ubuntu Intrepid. Is there anything I'm doing wrong?
>     Any other packages I have to install?
>
>     Thanks in advance
>
>     Viju Moses
>
>     ______________________________________________
>     R-help at r-project.org <mailto:R-help at r-project.org> mailing list
>     https://stat.ethz.ch/mailman/listinfo/r-help
>     PLEASE do read the posting guide
>     http://www.R-project.org/posting-guide.html
>     and provide commented, minimal, self-contained, reproducible code.
>
>
>
>
> --
> ----------------------------------------------
>
>
> My contact information:
> Tal Galili
> Phone number: 972-50-3373767
> FaceBook: Tal Galili
> My Blogs:
> http://www.r-statistics.com/
> http://www.talgalili.com
> http://www.biostatistics.co.il
>
>

```

More information about the R-help mailing list