Fit a propensity score model using a specified engine. fit_ps() fits a model on a single dataset and fit_ps_mi() fits a model on each of m multiply imputed datasets.

fit_ps(formula, data, engine = "glm", ...)

fit_ps_mi(formula, data, engine = "glm", ...)

Arguments

formula

An object of class formula with the treatment variable to the left of the ~ operator and the model terms on the right.

data

A data frame containing the variables in the model. For fit_ps_mi(), there must be an additional column imp denoting the imputation number.

engine

The "engine" used to fit the propensity score model. Currently limited to logistic regression fit with stats::glm().

...

Additional arguments to pass to stats::glm().

Value

fit_ps() returns an object of class fit_ps with an element fit containing the underlying fitted model. fit_ps_mi() returns an object of classfit_ps_mi, which is a list of fit_ps objects.