Attributable fraction function based on Instrumental Variables (IV) regression as an ivglm object in the ivtools package.
Attributable fraction function based on Instrumental Variables (IV) regression as an ivglm object in the ivtools package.
AFivglm estimates the model-based adjusted attributable fraction from a Instrumental Variable regression from a ivglm object. The IV regression can be estimated by either G-estimation or Two Stage estimation for a binary exposure and outcome.
AFivglm(object, data)
Arguments
object: a fitted Instrumental Variable regression of class "ivglm".
data: an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment (formula), typically the environment from which the function is called.
Returns
AF.est: estimated attributable fraction.
AF.var: estimated variance of AF.est. The variance is obtained by combining the delta methods with the sandwich formula.
Details
AFivglm estimates the attributable fraction for an IV regression under the hypothetical scenario where a binary exposure X is eliminated from the population. The estimate can be adjusted for IV-outcome confounders L in the ivglm function. Let the AF function be defined as
AF=1−Pr(Y=1)Pr(Y0=1)AF=1−Pr(Y=1)Pr(Y0=1)
where Pr(Y0=1) denotes the counterfactual outcome prevalence had everyone been unexposed and Pr(Y=1) denotes the factual outcome prevalence. If the instrument Z is valid, conditional on covariates L, i.e. fulfills the IV assumptions 1) the IV should have a (preferably strong) association with the exposure, 2) the effect of the IV on the outcome should only go through the exposure and 3) the IV-outcome association should be unconfounded (Imbens and Angrist, 1994) then Pr(Y0=1) can be estimated.