# NOT RUN {
##########
## example from Zelterman (1999), p. 119, Table 4.1
## mice were exposed to a fungicide (or not), some have a tumor
##########
dmn <- list(Tumor=c('y', 'n'), Exposition=c('y', 'n'))
CT <- matrix(c(4,12,5,74), nrow=2, dimnames=dmn)
# }
# NOT RUN {
CT
# }
# NOT RUN {
hypergeom.test(CT)
# }
# NOT RUN {
##########
## example from Agresti (1992), Table 2
## Fisher's tea tasting experiment
##########
dmn <- list('poured first'=c('m', 't'), guess=c('m', 't'))
CT <- matrix(c(3,1,1,3), nrow=2, dimnames=dmn)
hypergeom.test(CT, alternative="two.sided")
hypergeom.test(CT, alternative="two.sided", pval.method="double")
out <- hypergeom.test(CT, alternative="two.sided", pval.method=NULL)
hypergeom.test(CT, alternative="less")
hypergeom.test(CT, alternative="greater")
# }
# NOT RUN {
##########
## example from Zelterman (1999), p. 44, Table 1.2
## Response to three drugs
##########
dmn <- list(A=c('F', 'U'), B=c('F', 'U'), C=c('F', 'U'))
CT <- array(c(6,16,2,4,2,4,6,6), dim=c(2,2,2), dimnames=dmn)
# }
# NOT RUN {
CT
# }
# NOT RUN {
hypergeom.test(CT)
# }
Run the code above in your browser using DataLab