epitab {epitools} | R Documentation |
Calculates risks, risk ratio, odds ratio, and confidence intervals for epidemiologic data
epitab(..., conf.level = 0.95, trow = FALSE, tcol = FALSE)
... |
four numbers from a 2x2 table (separated by commas), or two vectors (1st vector is exposure variable with r levels, 2nd vector is outcome with 2 levels), or one rx2 contingency table |
conf.level |
Confidence level (default = 0.95) |
trow |
"transpose" (reverse the order of) rows of table |
tcol |
"transpose" (reverse the order of) columns of table |
The epitab
function can take data in several forms: 4 numbers from
cells of a 2x2 table, a nx2 table, or 2 vectors (exposure
vs. 2-level outcome). It then calculates the risks for every level, the
exposure distribution, Fishers exact p value for every level, the risk
ratios with confidence intervals ("cohort analysis"), and the odds
ratios with confidence intervals ("case-control analysis"). Therefore,
submit either 4 numbers, nx2 table, or 2 categorical vectors. The risk
ratios and the odds ratios also include a small sample adjustment
(Jewell 2004). The cohort analysis includes the distribution of risk
for each level of exposure, and the case-control analysis includes the
distribution of exposure for both levels of outcome (case
vs. control).
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
$data |
Original data in table form, now with marginal totals |
$risks |
Risk for each level |
$exposure.distrib |
Distribution of exposure levels |
$cohort.analysis |
Matrix with risk and risk ratio analysis |
$case.control.analysis |
Matrix with odds ratio analysis |
Visit http://www.epitools.net for the latest.
Tomas Aragon, aragon@berkeley.edu, http://www.medepi.net/aragon
Jewell NP. Statistics for Epidemiology, 1st Edition, 2004, Chapman & Hall, pp. 73-82
See also as risk.ratio
, odds.ratio
##Cohort example ##From Jewell (2004), p. 83 risk.ratio(178, 1589, 79, 1565) epitab(1486, 79, 1411, 178)$cohort ##Case-control example ##From Jewell (2004), p. 79 odds.ratio(347, 555, 20, 88) epitab(88, 20, 555, 347)$case.control ##Infertility data set in R data(infert) epitab(infert$induced, infert$case)$case.control epitab(cut(infert$age, 2), infert$case)$case.control