Fit various models with weighting

fit_model_weighted(
  dat,
  outcome,
  exposure,
  covariates,
  id_var,
  weights,
  method,
  method_args
)

Arguments

dat

A dataframe containing the variables of interest. A dataframe.

outcome

A string indicating the outcome variable. A string.

exposure

A string indicating the exposure variable. A string.

covariates

A list of covariate names. A list or vector.

id_var

The variable name to be used to identify subjects. A string.

weights

The weights element of the result of the call to estimate_weights(). A weightit object.

method

The name of the model to be fitted (e.g., glm). A string.

method_args

A named list with the following variables: