Why stats.fisher_exact gives results different from R?

Peng Yu <[email protected]>
Newsgroups gmane.comp.python.scientific.user
Message-ID <CABrM6w=51u_DuwAuRptaRAexJva5PHCYJiYysvFbHBK-dXoH4Q@mail.gmail.com>
See below for the output of python and R.

Why there is a difference in the odds ratio? Given that R is most
widely used by statisticians, I'd prefer the python version print the
same results. Also, confidence intervals are missing in the python's
output.

>>> stats.fisher_exact([[8, 2], [1, 5]])
(20.0, 0.03496503496503495)

R> fisher.test(rbind(c(8, 2), c(1,5)))

    Fisher's Exact Test for Count Data

data:  rbind(c(8, 2), c(1, 5))
p-value = 0.03497
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
    1.008849 1049.791446
sample estimates:
odds ratio
  15.46969

-- 
Regards,
Peng
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.