summary.lmw {lmw} | R Documentation |
Assess balance for an lmw
object
Description
Computes balance statistics for an lmw
object created by
lmw()
. Balance involves not only the similarity between the treatment
groups but also the similarity between each treatment group and the target
population.
Usage
## S3 method for class 'lmw'
summary(
object,
un = TRUE,
addlvariables = NULL,
standardize = TRUE,
data = NULL,
stat = "balance",
...
)
## S3 method for class 'lmw_multi'
summary(
object,
un = TRUE,
addlvariables = NULL,
standardize = TRUE,
data = NULL,
contrast = NULL,
stat = "balance",
...
)
## S3 method for class 'summary.lmw'
print(x, digits = max(3, getOption("digits") - 4), ...)
Arguments
object |
an |
un |
|
addlvariables |
additional variables for which balance statistics are to
be computed along with the covariates in the |
standardize |
|
data |
a optional data frame containing variables named in
|
stat |
|
... |
ignored. |
contrast |
for multi-category treatments with |
x |
a |
digits |
the number of digits to print. |
Details
summary.lmw()
produces covariate balance or distribution
statistics and effective samples sizes before and after adjustment by the
regression weights and base weights, if supplied. For each covariate, the
following balance statistics are computed when stat = "balance"
:
-
SMD
- the standardized mean difference (SMD) between the treated and control groups -
TSMD Treated
- the target standardized mean difference (TSMD) between the treated group and target sample -
TSMD Control
- the TSMD between between the control group and target sample -
KS
- the Kolmogorov-Smirnov (KS) statistic between the treated and control groups -
TKS Treated
- the target KS (TKS) statistic between the treated group and target sample -
TKS Control
- the TKS statistic between the control group and target sample
For multi-category treatments with method = "MRI"
, balance statistics are
are computed between each treatment group and the target sample.
When stat = "distribution"
the mean and standard deviation of each
covariate is compute before and after adjustment and for the target sample.
(Standard deviations are printed in parentheses for visual clarity.)
After weighting with the regression weights, the mean difference between
the treated and control groups of each covariate included in the original
call to lmw()
will be equal to zero. However, the mean difference between
each treatment group and the target sample may not be equal to zero when
method = "URI"
in the call to lmw()
, and covariates supplied to
addlvariables
not included in the call to lmw()
may not be well
balanced.
When s.weights
are supplied to lmw()
, the unadjusted statistics (if
requested) will incorporate the sampling weights. When base.weights
are
supplied to lmw()
, the unadjusted statistics will not incorporate the
base weights; rather, balance with base weights applied (if supplied) will
be produced in a separate balance table (see Value below).
SMDs are computed as the difference between the (weighted) means divided by
a standardization factor, which is the standard deviation of the covariate
in the target sample. When estimand = "ATT"
in the call to lmw()
, the
standardization factor is the standard deviation in the treated group; when
estimand = "ATC"
, the standardization factor is the standard deviation in
the control group; when estimand = "ATE"
or when estimand = "CATE"
and
a target profile is supplied, the standardization factor is the square root
of the average of the variances of both treatment groups; when estimand = "CATE"
and a target dataset is supplied, the standardization factor is the
standard deviation in the target dataset. When s.weights
is supplied, the
standardization factor is computed including the sampling weights;
otherwise it is computed in the unweighted sample.
For binary covariates, the KS statistic is equal to the unstandardized difference in means and is computed as such.
When estimand = "CATE"
in the original call to lmw()
, any variables
supplied to addlvariables
that were not given a target value will not
have any target statistics computed (e.g., TSMD, TKS, target means, etc.).
The effective sample size (ESS) is computed within each group as (\sum w)^2/\sum w^2
.
With uniform weights, this is equal to the sample size.
Value
A summary.lmw
object, which contains the following components:
call |
The original call to |
nn |
The (effective) sample sizes before and after weighting. |
bal.un |
When |
bal.base.weighted |
When |
bal.weighted |
When |
dist.un |
When |
dist.base.weighted |
When
|
dist.weighted |
When |
method |
The method used to estimate the weights (i.e., URI or MRI) |
base.weights.origin |
If base weights were supplied through the
|
With multi-category treatments and method = "MRI"
, the object will also
inherit from class summary.lmw_multi
.
See Also
lmw()
for computing the implied regression weights,
plot.summary.lmw()
for plotting the balance statistics in a Love plot,
plot.lmw()
for assessing the representativeness and extrapolation of the
weights
Examples
data("lalonde")
# URI regression for ATT
lmw.out1 <- lmw(~ treat + age + education + race + married +
nodegree + re74 + re75, data = lalonde,
estimand = "ATT", method = "URI",
treat = "treat")
lmw.out1
summary(lmw.out1)
summary(lmw.out1, stat = "distribution")
# Adding additional variables to summary, removing unweighted
summary(lmw.out1, un = FALSE,
addlvariables = ~I(age^2) + I(nodegree*re74))
# MRI regression for ATT after PS matching
m.out <- MatchIt::matchit(treat ~ age + education + race + married +
nodegree + re74 + re75,
data = lalonde, method = "nearest",
estimand = "ATT")
lmw.out2 <- lmw(~ treat + age + education + race + married +
nodegree + re74 + re75, data = lalonde,
method = "MRI", treat = "treat", obj = m.out)
lmw.out2
summary(lmw.out2)
# MRI for a multi-category treatment ATE
lmw.out3 <- lmw(~ treat_multi + age + education + race + married +
nodegree + re74 + re75, data = lalonde,
estimand = "ATE", method = "MRI",
treat = "treat_multi")
lmw.out3
summary(lmw.out3)
summary(lmw.out3, contrast = c("2", "1"))