oddsratio(x, y = NULL,
method = c("midp", "fisher", "wald", "small"),
conf.level = 0.95,
rev = c("neither", "rows", "columns", "both"),
correction = FALSE,
verbose = FALSE)
oddsratio.midp(x, y = NULL,
conf.level = 0.95,
rev = c("neither", "rows", "columns", "both"),
correction = FALSE,
verbose = FALSE,
interval = c(0, 1000))
oddsratio.fisher(x, y = NULL,
conf.level = 0.95,
rev = c("neither", "rows", "columns", "both"),
correction = FALSE,
verbose = FALSE)
oddsratio.wald(x, y = NULL,
conf.level = 0.95,
rev = c("neither", "rows", "columns", "both"),
correction = FALSE,
verbose = FALSE)
oddsratio.small(x, y = NULL,
conf.level = 0.95,
rev = c("neither", "rows", "columns", "both"),
correction = FALSE,
verbose = FALSE)y into a tx into a table (default is NULL)uniroot that finds the
odds ratio median-unbiased estimate and mid-p exact confidence
interval for oddsratio.midptab2by2.test for
calculatng tests of independence (p values): adding correction
= TRUE implements Yate's continuity correction (default is FALSE),
x but with marginal totalsrev option to "reverse" the rows,
columns, or both. If you are providing categorical variables (factors
or character vectors), the first level of the "exposure" variable is
treated as the reference. However, you can set the reference of a
factor using the relevel function.
Likewise, each row of the rx2 table is compared to the exposure
reference level and test of independence two-sided p values are
calculated using mid-p exact, Fisher's Exact, Monte Carlo simulation,
and the chi-square test.tab2by2.test, riskratio,
rateratio, ormidp.test,
epitab##Case-control study assessing whether exposure to tap water
##is associated with cryptosporidiosis among AIDS patients
tapw <- c("Lowest", "Intermediate", "Highest")
outc <- c("Case", "Control")
dat <- matrix(c(2, 29, 35, 64, 12, 6),3,2,byrow=TRUE)
dimnames(dat) <- list("Tap water exposure" = tapw, "Outcome" = outc)
oddsratio(dat, rev="c")
oddsratio.midp(dat, rev="c")
oddsratio.fisher(dat, rev="c")
oddsratio.wald(dat, rev="c")
oddsratio.small(dat, rev="c")Run the code above in your browser using DataLab