af: Attributable fractions

Description Usage Arguments Details Value References

Description

In addition to measures of effect such as odds ratio, risk ratio, and risk difference, the twoxtwo framework allows for calculation of attributable fractions: attributable risk proportion in the exposed (ARP) and the population attributable risk proportion (PARP).

Estimates of the attributable fractions can be calculated with the arp() and parp() functions respectively. 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 effect 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
arp(.data, exposure, outcome, alpha = 0.05, percent = FALSE, ...)

parp(
  .data,
  exposure,
  outcome,
  alpha = 0.05,
  percent = FALSE,
  prevalence = NULL,
  ...
)

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 .data is a twoxtwo object

outcome

Name of outcome variable; ignored if input to .data is a twoxtwo object

alpha

Significance level to be used for constructing confidence interval; default is 0.05

percent

Logical as to whether or not the measure should be returned as a percentage; default is FALSE

...

Additional arguments passed to twoxtwo function; ignored if input to .data is a twoxtwo object

prevalence

Prevalence of exposure in the population; must be numeric between 0 and 1; only used in parp(); default is NULL and will be ignored

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).

Attributable Risk Proportion in the Exposed (ARP)

ARP = 1 - (1/((A/(A+B)) / (C/(C+D))))

Population Attributable Risk Proportion (PARP)

PARP = (((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):

PARP = p * (((A/(A+B)) / (C/(C+D))) - 1) / (p * (((A/(A+B)) / (C/(C+D))) - 1) + 1)

Value

A tibble with the following columns:

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

Szklo, M., & Nieto, F. J. (2007). Epidemiology: Beyond the basics. Sudbury, Massachussets: Jones and Bartlett.

Zapata-Diomedi, B., Barendregt, J. J., & Veerman, J. L. (2018). Population attributable fraction: names, types and issues with incorrect interpretation of relative risks. British journal of sports medicine, 52(4), 212–213. https://doi.org/10.1136/bjsports-2015-095531


twoxtwo documentation built on July 9, 2021, 9:08 a.m.