# Case-control study assessing whether exposure to tap water
# is associated with cryptosporidiosis among AIDS patients
tab <- matrix(c(2, 29, 35, 64, 12, 6), 3, 2, byrow=TRUE)
dimnames(tab) <- list("Tap water exposure" = c("Lowest", "Intermediate", "Highest"),
"Outcome" = c("Case", "Control"))
tab <- Rev(tab, direction="column")
OddsRatio(tab[1:2,])
OddsRatio(tab[c(1,3),])
OddsRatio(tab[1:2,], method="mle")
OddsRatio(tab[1:2,], method="midp")
OddsRatio(tab[1:2,], method="wald", conf.level=0.95)
Run the code above in your browser using DataCamp Workspace