brentp / fishers_exact_test

Fishers Exact Test for Python (Cython)
BSD 3-Clause "New" or "Revised" License
62 stars 21 forks source link

two-tailed pvalue wrong results #1

Open i000 opened 12 years ago

i000 commented 12 years ago

Python: fisher.pvalue(94, 48, 3577, 16988) Pvalue(left_tail=1, right_tail=2.069e-37, two_tail=1.101e-10)

R:

r = fisher.test(matrix(c(94, 48, 3577, 16988), nrow = 2)) r$p.value [1] 2.069356e-37

the reason is the very high epsilon:

cdef double epsilon = 1e-10 .... if p < cutoff + epsilon: two_tail += p

so if cutoff < epsilon the two_tail is not even close

gokceneraslan commented 3 years ago

Any news on this? Shall I send a PR to lower the epsilon?