cem
Objectsbal.tab.cem.match.Rd
Generates balance statistics for cem.match
objects from cem.
# S3 method for cem.match
bal.tab(x,
data,
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,
...)
a cem.match
or cem.match.list
object; the output of a call to cem::cem()
.
a data frame containing variables named in other arguments. An argument to data
is required. It must be the same data used in the call to cem()
or a mids
object from which the data supplied to datalist
in the cem() call originated.
see bal.tab()
for details.
See below for a special note on the s.d.denom
argument.
The following argument has a special note when used with cem.match
or cem.match.list
objects:
the default is "treated", where the treated group corresponds to the baseline.group
in the call to cem()
.
bal.tab.cem.match()
generates a list of balance summaries for the cem.match
object given, and functions similarly to cem::imbalance()
.
If clusters and imputations are not specified, an object of class "bal.tab"
containing balance summaries for the cem.match
object. See bal.tab()
for details.
If imputations are specified, an object of class "bal.tab.imp"
containing balance summaries for each imputation and a summary of balance across imputations. See bal.tab.imp
for details.
If cem()
is used with multi-category treatments, an object of class "bal.tab.multi"
containing balance summaries for each pairwise treatment comparison. See bal.tab.multi
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.
bal.tab()
for details of calculations.
library(cem); data("lalonde", package = "cobalt")
#> Loading required package: tcltk
#>
#> How to use CEM? Type vignette("cem")
#>
#> Attaching package: ‘cem’
#> The following object is masked from ‘package:optmatch’:
#>
#> pair
## Coarsened exact matching
cem.out <- cem("treat", data = lalonde, drop = "re78")
#>
#> Using 'treat'='1' as baseline group
bal.tab(cem.out, data = lalonde, un = TRUE,
stats = c("m", "k"))
#> Balance Measures
#> Type Diff.Un KS.Un Diff.Adj KS.Adj
#> age Contin. -0.3094 0.1577 0.0512 0.1581
#> educ Contin. 0.0550 0.1114 -0.0441 0.0445
#> race_black Binary 0.6404 0.6404 0.0000 0.0000
#> race_hispan Binary -0.0827 0.0827 0.0000 0.0000
#> race_white Binary -0.5577 0.5577 0.0000 0.0000
#> married Binary -0.3236 0.3236 0.0000 0.0000
#> nodegree Binary 0.1114 0.1114 0.0000 0.0000
#> re74 Contin. -0.7211 0.4470 -0.0341 0.2418
#> re75 Contin. -0.2903 0.2876 -0.0528 0.1162
#>
#> Sample sizes
#> Control Treated
#> All 429. 185
#> Matched (ESS) 36.29 68
#> Matched (Unweighted) 78. 68
#> Unmatched 351. 117