Skip to contents

Visualize balance of variables between treatment and control groups. Balance plot reflects balance in standardized units.

Usage

plot_balance(
  .data,
  treatment,
  confounders,
  compare = c("means", "variance", "covariance"),
  estimand = c("ATE", "ATT", "ATC"),
  limit_continuous = NULL,
  limit_catagorical = NULL
)

Arguments

.data

dataframe

treatment

the column denoted treatment. Must be binary.

confounders

character list of column names denoting the X columns of interest

compare

character of either means or variance denotes what to compare balance on

estimand

character of either ATE, ATT or ATC the causal estimand you are making inferences about

limit_continuous

integer that can be used to limit the plot to only show the limit_continuous most imbalanced variables

limit_catagorical

integer that can be used to limit the plot to only show the limit_categorical most imbalanced variables

Value

ggplot object

Author

George Perrett & Joseph Marlo

Examples

data(lalonde)
plot_balance(lalonde, 'treat', c('re78', 'age', 'educ'),
compare = 'means', estimand = 'ATE') +
labs(title = 'My new title')