Matching
, optmatch
, ebal
, and designmatch
ObjectsGenerates balance statistics for output objects from Matching, optmatch, ebal, and designmatch.
# S3 method for Match
bal.tab(x,
formula = NULL,
data = NULL,
treat = NULL,
covs = NULL,
stats,
int = FALSE,
poly = 1,
distance = NULL,
addl = NULL,
continuous,
binary,
s.d.denom,
thresholds = NULL,
weights = NULL,
cluster = NULL,
imp = NULL,
pairwise = TRUE,
s.weights = NULL,
abs = FALSE,
subset = NULL,
quick = TRUE,
...)
For point treatments, if clusters and imputations are not specified, an object of class "bal.tab"
containing balance summaries for the given object. See bal.tab()
for details.
If clusters are specified, an object of class "bal.tab.cluster"
containing balance summaries within each cluster and a summary of balance across clusters. See bal.tab.cluster
for details.
either a Match
object (the output of a call to Matching::Match()
or Matching::Matchby()
), an optmatch
object (the output of a call to optmatch::pairmatch()
or optmatch::fullmatch()
), an ebalance
object (the output of a call to ebal::ebalance()
or ebal::ebalance.trim()
), or the output of a call to designmatch::bmatch()
or related wrapper functions from the designmatch package.
a formula
with the treatment variable as the response and the covariates for which balance is to be assessed as the predictors. All named variables must be in data
. See Details.
a data frame containing variables named in formula
, if supplied, and other arguments.
a vector of treatment statuses. See Details.
a data frame of covariate values for which to check balance. See Details.
see bal.tab()
for details.
See below for a special note on the s.d.denom
argument.
The following argument has a special notes when used with these input objects:
if not specified, for Match
objects, bal.tab()
will use "treated" if the estimand of the call to Match()
is the ATT, "pooled" if the estimand is the ATE, and "control" if the estimand is the ATC; for optmatch
, ebal
, and designmatch
objects, bal.tab()
will determine which value makes the most sense based on the input. Abbreviations allowed.
Noah Greifer
bal.tab()
generates a list of balance summaries for the object given, and function similarly to Matching::MatchBalance()
and designmatch::meantab()
. Note that output objects from designmatch do not have their own class; bal.tab()
first checks whether the object meets the criteria to be treated as a designmatch
object before dispatching the correct method. Renaming or removing items from the output object can create unintended consequences.
The input to bal.tab.Match()
, bal.tab.optmatch()
, bal.tab.ebalance()
, and bal.tab.designmatch()
must include either both formula
and data
or both covs
and treat
. Using the formula
+ data
inputs mirrors how Matching::MatchBalance()
is used, and using the covs
+ treat
input mirrors how designmatch::meantab()
is used. (Note that to see identical results to meantab()
, s.d.denom
must be set to "pooled"
, though this is not recommended.) For optmatch
output objects, specifying a treatment is not required.
bal.tab()
for details of calculations.