I'd wish to know how is calculated p-value
in a fisher.test
using as alternative hypothesis a two.sided
distribution. It looks to me that R
firstly find whether the odd ratio is greater
or less
than 1, then calculate the p-value
for the corrisponding case and then multiply it by 2 to obtain the two.sided
case.
This is my contingency table:
mytable <- rbind(c(57248,52891),c(51367,50307))
This is the output from a two.sided
test:
> fisher.test(mytable,alternative='two.sided')
Fisher's Exact Test for Count Data
data: mytable
p-value = 2.086e-11
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
1.042062 1.078306
sample estimates:
odds ratio
1.060024
And here from a greater
test:
> fisher.test(mytable,alternative='greater')
Fisher's Exact Test for Count Data
data: mytable
p-value = 1.066e-11
alternative hypothesis: true odds ratio is greater than 1
95 percent confidence interval:
1.044927 Inf
sample estimates:
odds ratio
1.060024