impact {twoxtwo} | R Documentation |
Impact numbers
Description
Impact numbers are designed to communicate how impactful interventions and/or exposures can be on a population. The twoxtwo framework allows for calculation of impact numbers: exposure impact number (EIN), case impact number (CIN), and the exposed cases impact number (ECIN).
The ein()
, cin()
, and ecin()
functions provide interfaces for calculating impact number estimates. Each function takes an input dataset and arguments for outcome and exposure as bare, unquoted variable names. If the input has the twoxtwo class then the measures will be calculated using exposure and outcome information from that object. The functions all return a tidy tibble
with the name of the measure, the point estimate, and lower/upper bounds of a confidence interval (CI) based on the SE.
Formulas used in point estimate and SE calculations are available in 'Details'.
Usage
ein(.data, exposure, outcome, alpha = 0.05, ...)
cin(.data, exposure, outcome, alpha = 0.05, prevalence = NULL, ...)
ecin(.data, exposure, outcome, alpha = 0.05, ...)
Arguments
.data |
Either a data frame with observation-level exposure and outcome data or a twoxtwo object |
exposure |
Name of exposure variable; ignored if input to |
outcome |
Name of outcome variable; ignored if input to |
alpha |
Significance level to be used for constructing confidence interval; default is |
... |
Additional arguments passed to twoxtwo function; ignored if input to |
prevalence |
Prevalence of exposure in the population; must be numeric between |
Details
The formulas below denote cell values as A,B,C,D. For more on twoxtwo
notation see the twoxtwo documentation.
Note that formulas for standard errors are not provided below but are based on forumlas described in Hildebrandt et al (2006).
Exposure Impact Number (EIN)
EIN = 1/((A/(A+B)) - (C/(C+D)))
Case Impact Number (CIN)
CIN = 1/(((A+C)/(A+B+C+D))-(C/(C+D)))) / ((A+C)/(A+B+C+D))
If "prevalence" argument is not NULL
then the formula uses the value specified for prevalence of exposure (p):
CIN = 1/ ((p * (((A/(A+B)) / (C/(C+D))) - 1)) / (p * (((A/(A+B)) / (C/(C+D))) - 1) + 1))
Exposed Cases Impact Number (ECIN)
ECIN = 1/(1 - (1/((A/(A+B)) / (C/(C+D)))))
Value
A tibble
with the following columns:
-
measure: Name of the measure calculated
-
estimate: Point estimate for the impact number
-
ci_lower: The lower bound of the confidence interval for the estimate
-
ci_upper: The upper bound of the confidence interval for the estimate
-
exposure: Name of the exposure variable followed by +/- levels (e.g. smoking::yes/no)
-
outcome: Name of the outcome variable followed by +/- levels (e.g. heart_disease::yes/no)
References
Hildebrandt, M., Bender, R., Gehrmann, U., & Blettner, M. (2006). Calculating confidence intervals for impact numbers. BMC medical research methodology, 6, 32. https://doi.org/10.1186/1471-2288-6-32
Heller, R. F., Dobson, A. J., Attia, J., & Page, J. (2002). Impact numbers: measures of risk factor impact on the whole population from case-control and cohort studies. Journal of epidemiology and community health, 56(8), 606–610. https://doi.org/10.1136/jech.56.8.606