Joint PIF: Combine impact fractions from independent and uncorrelated risk factors
pif_combine.Rd
A function to combine multiple impact fractions from independent uncorrelated risk factors. The function follows the formula from Ezzati et al. (2003) : \[ \text{PIF} = 1 - \prod\limits_{k} \big(1 - \text{PIF}_i) \]
Arguments
- pif_class_1
A
pif_class
object (i.e. an estimation ofpif
orpaf
)- pif_class_2
Another
pif_class
object (i.e. an estimation of a differentpif
orpaf
)- ...
Additional
pif_class
objects (i.e. estimations ofpif
orpaf
)
Value
A pif_aggregated
object estimating the potential impact fraction for
individual-level data from multiple distinct impact 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.
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"] )
}
cft <- function(X) {
X[, "systolic_blood_pressure"] <- X[, "systolic_blood_pressure"] - 5
return(X)
}
pif_1 <- pif(design,
theta = log(c(1.25, 1.68)), rr_1, cft,
additional_theta_arguments = c(0.01, 0.03), n_bootstrap_samples = 10,
)
pif_2 <- pif(design,
theta = log(c(1.12, 1.45)), rr_2, cft,
additional_theta_arguments = c(0.02, 0.025), n_bootstrap_samples = 10,
)
pif_3 <- pif(design,
theta = 0.24, rr_3, cft,
additional_theta_arguments = 0.01, n_bootstrap_samples = 10,
)
pif_combine(pif_1, pif_2, pif_3)
#> ── Potential Impact Fraction (PIF) ─────────────────────────────────────────────
#> # A tibble: 3 × 4
#> counterfactual relative_risk potential_impact_fraction type
#> <chr> <chr> <dbl> <chr>
#> 1 Counterfactual_1 Relative_Risk_1 0.998 point_estimate
#> 2 Counterfactual_1 Relative_Risk_1 0.996 Lower 2.5%
#> 3 Counterfactual_1 Relative_Risk_1 1.00 Upper 97.5%
#> ────────────────────────────────────────────────────────────────────────────────
#> • 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.