epitab(x, y = NULL,
method = c("oddsratio", "riskratio", "rateratio"),
conf.level = 0.95,
rev = c("neither", "rows", "columns", "both"),
oddsratio = c("wald", "fisher", "midp", "small"),
riskratio = c("wald", "boot", "small"),
rateratio = c("wald", "midp"),
pvalue = c("fisher.exact", "midp.exact", "chi2"),
correction = FALSE,
verbose = FALSE)
x
into a table (default is NULL)
For rate ratio, a numeric vector of person-time at risk; if
provided, x
must be a numeepitab
calculates odds ratios, risk ratios, or rate
ratios for rx2 tables. The odds ratios are estimated using
unconditional maximum likelihood (Wald), conditional maximum
likelihood (Fisher), median-unbiased method (mid-p), or small-sample
adjusted. The confidence intervals are estimated using a normal
approximation (Wald), hypergeometric exact (Fisher), mid-p exact, or
small sample adjusted method.
The risk ratios are estimated using unconditional maximum
likelihood (Wald), or small-sample adjusted. The confidence intervals
are estimated using a normal approximation (Wald), or bootstrap
estimation.
The rate ratios are estimated using unconditional maximum likelihood
estimation (Wald), or median unbiased method (mid-p). The confidence
intervals are estimated using normal approximation, or mid-p exact
method.
Notice the expected structure of the data to be given to 'epitab':
Disease
Exposure No (ref) Yes
Level 1 (ref) a b
Level 2 c d
Level 3 e f
This function expects the following table struture for rate ratios:
counts person-time
exposed=0 (ref) n00 t01
exposed=1 n10 t11
exposed=2 n20 t21
exposed=3 n30 t31
If the table you want to provide to this function is not in the
preferred form, just use the rev
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 fisher exact, mid-p exact, or normal approximation
method.riskratio
, oddsratio
, rateratio
r243 <- matrix(c(12,2,7,9), 2, 2)
dimnames(r243) <- list(Diarrhea = c("Yes", "No"),
"Antibody level" = c("Low", "High")
)
r243
r243b <- t(r243)
r243b
epitab(r243, rev = "b", verbose = TRUE)
epitab(r243, method="riskratio",rev = "b", verbose = TRUE)
epitab(matrix(c(41, 15, 28010, 19017),2,2)[2:1,],
method="rateratio", verbose = TRUE)
Run the code above in your browser using DataLab