Chapter 2 epiR

2.1 epi.2by2

  • Summary measures for count data presented in a 2 by 2 table
library(epiR)
epi.2by2(dat, 
         method = c("cohort.count", "cohort.time", "case.control", "cross.sectional"), 
         conf.level = 0.95, 
         units = 100, 
         outcome = c("as.columns","as.rows"))
  • dat: an object of class table containing the individual cell frequencies.

  • method: a character string indicating the study design on which the tabular data has been based.

    • Based on the study design specified by the user, appropriate measures of association, measures of effect in the exposed and measures of effect in the population are returned by the function.
cohort.count case.control
Measures of association
RR \(\checkmark\)
OR \(\checkmark\) \(\checkmark\)
Measures of effect in the exposed
ARisk \(\checkmark\) \(\checkmark\)
AFRisk \(\checkmark\) AFest
Measures of effect in the population
PARisk \(\checkmark\) \(\checkmark\)
PAFRisk \(\checkmark\) PAFest
chi-squared test
chisq.strata \(\checkmark\) \(\checkmark\)
chisq.crude \(\checkmark\) \(\checkmark\)
chisq.mh \(\checkmark\) \(\checkmark\)
Mantel-Haenszel (Woolf) test of homogeneity
RR.homog \(\checkmark\)
OR.homog \(\checkmark\) \(\checkmark\)
  • conf.level: magnitude of the returned confidence intervals. The default value is 0.95.

  • units: multiplier for prevalence and incidence (risk or rate) estimates. Default value is 100.

    • unit=1 Outcomes per population unit

    • unit=100 Outcomes per 100 population unit

    • The multiplier is applied to Attributable risk, Attributable risk in population, etc.

  • outcome: how the outcome variable is represented in the contingency table.