| optweightMV | R Documentation |
Estimates stable balancing weights for the supplied multivariate (i.e., multiple) treatments and covariates. The degree of balance for each covariate is specified by tols.list. See Zubizarreta (2015) and Wang & Zubizarreta (2020) for details of the properties of the weights and the methods used to fit them.
optweightMV(
formula.list,
data = NULL,
tols.list = list(0),
estimand = "ATE",
targets = NULL,
target.tols.list = list(0),
s.weights = NULL,
b.weights = NULL,
norm = "l2",
min.w = 1e-08,
verbose = FALSE,
...
)
optweightMV.fit(
covs.list,
treat.list,
tols.list = list(0),
estimand = "ATE",
targets = NULL,
target.tols.list = list(0),
s.weights = NULL,
b.weights = NULL,
norm = "l2",
std.binary = FALSE,
std.cont = TRUE,
min.w = 1e-08,
verbose = FALSE,
solver = NULL,
...
)
formula.list |
a list of formulas, each with a treatment variable on the left hand side and the covariates to be balanced on the right hand side. |
data |
an optional data set in the form of a data frame that contains the variables in |
tols.list |
a list of vectors of balance tolerance values for each covariate for each treatment. The resulting weighted balance statistics will be at least as small as these values. If only one value is supplied, it will be applied to all covariates. See Details. Default is 0 for all covariates. |
estimand |
the desired estimand, which determines the target population. Only "ATE" or |
targets |
an optional vector of target population mean values for each covariate. The resulting weights ensure the midpoint between group means are within |
target.tols.list |
a list of vectors of target balance tolerance values for each covariate for each treatment. For binary and multi-category treatments, the average of each pair of means will be at most as far from the target means as these values. Can also be the output of a call to |
s.weights |
a vector of sampling weights. For |
b.weights |
a vector of base weights. If supplied, the desired norm of the distance between the estimated weights and the base weights is minimized. For |
norm |
|
min.w |
|
verbose |
|
... |
for |
covs.list |
a list containing one numeric matrix of covariates to be balanced for each treatment. |
treat.list |
a list containing one vector of treatment statuses for each treatment. |
std.binary, std.cont |
|
solver |
string; the name of the optimization solver to use. Allowable options depend on |
optweightMV() is the primary user-facing function for estimating stable balancing weights for multivariate treatments. The optimization is performed by the lower-level function optweightMV.fit(), which transforms the inputs into the required inputs for the optimization functions and then supplies the outputs (the weights, dual variables, and convergence information) back to optweightMV(). Little processing of inputs is performed by optweightMV.fit(), as this is normally handled by optweightMV().
See optweight() for more information about balance tolerances (i.e., those specified in tols.list), targets, norm, solver, and convergence failure.
For optweightMV(), an optweightMV object with the following elements:
weights |
The estimated weights, one for each unit. |
treat.list |
A list of the values of the treatment variables. |
covs.list |
A list of the covariates for each treatment used in the fitting. Only includes the raw covariates, which may have been altered in the fitting process. |
s.weights |
The provided sampling weights. |
b.weights |
The provided base weights. |
call |
The function call. |
tols |
A list of tolerance values for each covariate for each treatment. |
duals |
A list of data.frames containing the dual variables for each covariate for each treatment. See |
info |
A list containing information about the performance of the optimization at termination. |
norm |
The |
solver |
The |
For optweightMV.fit(), an optweightMV.fit object with the following elements:
w |
The estimated weights, one for each unit. |
duals |
A data.frame containing the dual variables for each covariate. |
info |
A list containing information about the performance of the optimization at termination. |
norm |
The |
solver |
The |
Chattopadhyay, A., Cohn, E. R., & Zubizarreta, J. R. (2024). One-Step Weighting to Generalize and Transport Treatment Effect Estimates to a Target Population. The American Statistician, 78(3), 280–289. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00031305.2023.2267598")}
Källberg, D., & Waernbaum, I. (2023). Large Sample Properties of Entropy Balancing Estimators of Average Causal Effects. Econometrics and Statistics. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.ecosta.2023.11.004")}
Wang, Y., & Zubizarreta, J. R. (2020). Minimal dispersion approximately balancing weights: Asymptotic properties and practical considerations. Biometrika, 107(1), 93–105. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biomet/asz050")}
Zubizarreta, J. R. (2015). Stable Weights that Balance Covariates for Estimation With Incomplete Outcome Data. Journal of the American Statistical Association, 110(511), 910–922. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.2015.1023805")}
optweight() for more information on the optimization, specifications, and options.
library("cobalt")
data("lalonde", package = "cobalt")
# Balancing two treatments
(ow1 <- optweightMV(list(treat ~ age + educ + race + re74,
re75 ~ age + educ + race + re74),
data = lalonde))
summary(ow1)
bal.tab(ow1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.