Eduard Szöcs

Data in Environmental Science and Eco(toxico-)logy

Quantitative Ecotoxicology, Page 162, Example 4.7, Duplicate Treatments

This is a short one (example 4.7 on page 1621 of Quantitative Ecotoxicology).

First we create the data as matrix:

TEST <- matrix(c(1,19,6,14), byrow=TRUE, ncol = 2, 
               dimnames=list(c('Tank_A', 'Tank_B'), c('Number_Dead', 'Number_Surviving')))
TEST
##        Number_Dead Number_Surviving
## Tank_A           1               19
## Tank_B           6               14

The we can easily run fisher’s Exact test for this 2x2 table using the function fisher.test():

fisher.test(TEST)
## 
## 	Fisher's Exact Test for Count Data
## 
## data:  TEST
## p-value = 0.091
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.0025451 1.2461419
## sample estimates:
## odds ratio 
##    0.12883
fisher.test(TEST, alternative='greater')
## 
## 	Fisher's Exact Test for Count Data
## 
## data:  TEST
## p-value = 1
## alternative hypothesis: true odds ratio is greater than 1
## 95 percent confidence interval:
##  0.0051465       Inf
## sample estimates:
## odds ratio 
##    0.12883
fisher.test(TEST, alternative='less')
## 
## 	Fisher's Exact Test for Count Data
## 
## data:  TEST
## p-value = 0.046
## alternative hypothesis: true odds ratio is less than 1
## 95 percent confidence interval:
##  0.00000 0.96589
## sample estimates:
## odds ratio 
##    0.12883

The results are identical to the one in the book.

Written on March 18, 2013