What does this test do?


Running the test

x <- matrix(c(2,10,20,13), ncol=2, byrow=T)
x
##      [,1] [,2]
## [1,]    2   10
## [2,]   20   13
fisher.test(x)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  x
## p-value = 0.01655
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.01256709 0.78740829
## sample estimates:
## odds ratio 
##  0.1360765


Reading the output

The point estimate for the odds ratio is calculated as \(\frac{2 \cdot 13}{10 \cdot 20} = 0.13\) in this case. The confidence interval refers to the odds ratio, i.e. the given interval includes the true value with 95% chance. For this example, \(H_0\) is rejected, i.e. the proportions are significantly different (no independence).