
Balance Statistics for sbw Objects
bal.tab.sbw.RdGenerates balance statistics for sbwcau objects from sbw.
Usage
# S3 method for sbwcau
bal.tab(x,
stats,
int = FALSE,
poly = 1,
distance = NULL,
addl = NULL,
data = 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,
...)Arguments
- x
an
sbwcauobject; the output of a call tosbw::sbw().- stats, int, poly, distance, addl, data, continuous, binary, thresholds, weights, cluster, imp, pairwise, s.weights, abs, subset, quick, ...
see
bal.tab()for details.See below for a special note on the
s.d.denomargument.
The following argument has a special note when used with sbwcau objects:
- s.d.denom
if not specified,
bal.tab()will figure out which one is best based on theparcomponent of thesbwcauobject: if "att", "treated"; if "atc", "control"; otherwise "pooled".
Details
bal.tab.sbwcau() generates a list of balance summaries for the sbwcau object given, and functions similarly to sbw::summarize().
Value
If clusters are not specified, an object of class "bal.tab" containing balance summaries for the sbwcau 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.
See also
bal.tab() for details of calculations.
Examples
library(sbw); data("lalonde", package = "cobalt")
#> Loading required package: quadprog
## Stable balancing weights for the ATT
sbw.out <- sbw(splitfactor(lalonde, drop.first = "if2"),
ind = "treat",
bal = list(bal_cov = c("age", "educ", "race_black",
"race_hispan", "race_white",
"married", "nodegree",
"re74", "re75"),
bal_alg = FALSE,
bal_tol = .001),
par = list(par_est = "att"))
#> quadprog optimizer is opening...
#> Finding the optimal weights...
#> Optimal weights found.
bal.tab(sbw.out, un = TRUE, poly = 2)
#> Balance Measures
#> Type Diff.Un Diff.Adj
#> age Contin. -0.3094 0.0015
#> educ Contin. 0.0550 0.0014
#> race_black Binary 0.6404 0.0004
#> race_hispan Binary -0.0827 0.0001
#> race_white Binary -0.5577 -0.0005
#> married Binary -0.3236 -0.0005
#> nodegree Binary 0.1114 0.0005
#> re74 Contin. -0.7211 -0.0014
#> re75 Contin. -0.2903 0.0010
#> age² Contin. -0.4276 -0.1698
#> educ² Contin. -0.0468 -0.0674
#> re74² Contin. -0.4331 0.0510
#> re75² Contin. -0.0757 0.0483
#>
#> Effective sample sizes
#> Control Treated
#> Unadjusted 429. 185
#> Adjusted 108.99 185