Skip to contents

Returns a data frame suitable for plotting absolute SMDs before and after matching. For a publication-ready plot, pass the same matchit object to cobalt::love.plot.

Usage

morie_matching_love_plot_data(
  unmatched_data,
  matched_data,
  treatment,
  covariates,
  weights_col = NULL
)

Arguments

unmatched_data, matched_data

Data frames.

treatment

Binary treatment column name.

covariates

Character vector of covariates.

weights_col

Optional column of matching weights in matched_data.

Value

A data frame with columns covariate, smd_before, smd_after, abs_smd_before, abs_smd_after.

Examples

if (FALSE) { # \dontrun{
morie_matching_love_plot_data(df, res$matched_data,
                              "d", c("x1", "x2"))
} # }