Learn R Programming

epitools (version 0.09)

epitab: Epidemiologic tabulation for a cohort or case-control study

Description

Calculates risks, risk ratio, odds ratio, and confidence intervals for epidemiologic data

Usage

epitab(exposure, disease = NULL, c.cell = NULL, d.cell = NULL, conf.level = 0.95)

Arguments

exposure
Exposure vector with any number of levels (e.g., from a data frame), or cell 'a' from a 2x2 table, or a nx2 table
disease
Outcome vector with 2 levels (Yes vs. No), or cell 'b' from a 2x2 table
c.cell
Cell 'c' from a 2x2 table
d.cell
Cell 'd' from a 2x2 table
conf.level
Confidence level (default = 0.95)

Value

  • $dataOriginal data in table form, now with marginal totals
  • $risksRisk for each level
  • $exposure.distribDistribution of exposure levels
  • $cohort.analysisMatrix with risk and risk ratio analysis
  • $case.control.analysisMatrix with odds ratio analysis

Details

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 Yes Level 1 (ref) a b Level 2 c d

References

Jewell NP. Statistics for Epidemiology, 1st Edition, 2004, Chapman & Hall, pp. 73-82

See Also

See also as risk.ratio, odds.ratio

Examples

Run this code
##Cohort examples
##From Jewell (2004), p. 83
risk.ratio(178, 1589, 79, 1565)
epitab(1486, 79, 1411, 178)$cohort

##Case-control examples
##From Jewell (2004), p. 79
odds.ratio(347, 555, 20, 88)
epitab(88, 20, 555, 347)$case.control

data(infert)
epitab(infert$induced, infert$case)$case.control
epitab(cut(infert$age, 2), infert$case)$case.control

Run the code above in your browser using DataLab