I aim to conduct Fisher exact test on 2×2 matrix. It took a while to understand difference in R and Python scipy.stats
implementation. Now I see that p-values are calculated the same way. And it seems like it doesn't use odds ratio doing that!
I still don't get connection between p-value and odds ratio. As far as I understood googling, odds ratio is a parameter of hypergeometric distribution matrices with fixed sum for rows and columns have.
R returns as output p-value, odds ratio and its confidence interval. I can either accept H0 (odds ratio = 1) or reject (than according to 'alternative' parameter it can be >1 or <1) depending on significance level.
I've also read that H0 is rejected if CI for odds ratio contains 1.
I have no idea how these two checks are related! Is there in this case dependence between significance and confidence level? Does it work like CI=95 then SL=2,5? Should I check both criteria or one of them is a consequence of the other?
Does it work the same in Python? It counts odds ratio differently and returns no confidence interval. Is it enough to test only p-value?
Best Answer
So yes the two "checks" (tests) are related: $p<0.05$ should be true only when the 95% CI does not include 1. All these results apply for other $\alpha$ levels as well.