Skip to contents

A function to combine multiple attributable fractions from independent uncorrelated risk factors. The function follows the formula from Ezzati et al. (2003) : \[ \text{PAF} = 1 - \prod\limits_{k} \big(1 - \text{PAF}_i) \]

Usage

paf_combine(paf_class_1, paf_class_2, ...)

Arguments

paf_class_1

A pif_class object (i.e. an estimation of paf)

paf_class_2

Another pif_class object (i.e. an estimation of a different paf)

...

Additional pif_class objects (i.e. estimations of paf)

Value

A paf_aggregated object estimating the population attributable fraction for individual-level data from multiple distinct attributable fractions.

References

Ezzati M, Vander Hoorn S, Rodgers A, Lopez AD, Mathers CD, Murray CJ (2003). “Estimates of global and regional potential health gains from reducing multiple major risk factors.” The Lancet, 362(9380), 271--280.

See also

Examples

# Use the ensanut dataset
data(ensanut)

# EXAMPLE 1
# Setup the survey design
options(survey.lonely.psu = "adjust")
design <- survey::svydesign(data = ensanut, ids = ~1, weights = ~weight, strata = ~strata)
rr_1 <- function(X, theta) {
  exp(-2 +
    theta[1] * X[, "age"] + theta[2] * X[, "systolic_blood_pressure"] / 100)
}

rr_2 <- function(X, theta) {
  exp(-1 +
    theta[1] * X[, "age"] + X[, "systolic_blood_pressure"] )
}

rr_3 <- function(X, theta) {
  exp(-1 +
    theta[1] *X[, "systolic_blood_pressure"] )
}

paf_1 <- paf(design,
  theta = log(c(1.25, 1.68)), rr_1,
  additional_theta_arguments = c(0.01, 0.03), n_bootstrap_samples = 10,
)

paf_2 <- paf(design,
  theta = log(c(1.12, 1.45)), rr_2,
  additional_theta_arguments = c(0.02, 0.025), n_bootstrap_samples = 10,
)

paf_3 <- paf(design,
  theta = 0.24, rr_3,
  additional_theta_arguments = 0.01, n_bootstrap_samples = 10,
)

paf_combine(paf_1, paf_2, paf_3)
#> ── Population Attributable Fraction (PAF) ──────────────────────────────────────
#> # A tibble: 3 × 4
#>   counterfactual                 relative_risk   population_attributable…¹ type 
#>   <chr>                          <chr>                               <dbl> <chr>
#> 1 Theoretical_minimum_risk_level Relative_Risk_1                         1 poin…
#> 2 Theoretical_minimum_risk_level Relative_Risk_1                         1 Lowe…
#> 3 Theoretical_minimum_risk_level Relative_Risk_1                         1 Uppe…
#> # ℹ abbreviated name: ¹​population_attributable_fraction
#> ────────────────────────────────────────────────────────────────────────────────
#> • Number of bootstrap simulations: 10
#>  A low number of bootstrap simulations will result in an unstable estimate.
#> • Use `as.data.frame` to access values.
#> • Use `summary` to save list of main results.