Create formulas for multiple imputation. impute_formula() creates the imputation formulas as functions of an existing formula object (e.g, a formula used for a propensity score model) and add_impute_formula() adds them to an analysis object.

impute_formula(formula, interaction = TRUE)

add_impute_formula(x, formula, interaction = TRUE)

Arguments

formula

A formula object in impute_formula and a column identifier for the formula objects in add_impute_formula().

interaction

Logical. If TRUE, then treatment status is interacted with each covariate, which results in separate imputations models for the trial and external control.

x

An analysis object.

Value

impute_formula() returns a single formula object. add_impute_formuls returns an analysis object with a new list column named impute_formula, where each element is the formula used for imputation of covariates required for a particular pairwise analysis.

See also