Skip to contents

Method for checking whether the object is a population attributable fraction

Usage

is_paf(x)

Arguments

x

An object

Value

Boolean whether an object is a potential impact fraction or not.

Note

The population attributable fraction is a type of potential impact fraction so the is_pif method will return TRUE even when estimating paf().

Examples

#Example 1
data(ensanut)
options(survey.lonely.psu = "adjust")
design <- survey::svydesign(data = ensanut, ids = ~1, weights = ~weight, strata = ~strata)
rr <- function(X, theta) {
  exp(-2 +
    theta[1] * X[, "age"] + theta[2] * X[, "systolic_blood_pressure"] / 100)
}
pafsim <- paf(design,
  theta = log(c(1.05, 1.38)), rr,
  additional_theta_arguments = c(0.01, 0.03), n_bootstrap_samples = 10,
)
is_paf(pafsim)
#> [1] TRUE