This page explains the details of estimating weights from generalized boosted model-based propensity scores by setting method = "gbm"
in the call to weightit
or weightitMSM
. This method can be used with binary, multinomial, and continuous treatments.
In general, this method relies on estimating propensity scores using generalized boosted modeling and then converting those propensity scores into weights using a formula that depends on the desired estimand. The algorithm involves choosing a balance criterion to optimize so that balance, rather than prediction, is prioritized.
For binary treatments, this method estimates the propensity scores using gbm.fit
and then optimizes balance using col_w_smd
for standardized mean differences and col_w_ks
for Kolmogorov-Smirnoff statistics, both from cobalt. The following estimands are allowed: ATE, ATT, ATC, ATO, and ATM. The weights are computed from the estimated propensity scores using get_w_from_ps
, which implements the standard formulas. When include.obj = TRUE
, the returned object is the gbm
fit.
For multinomial treatments, this method estimates the propensity scores using gbm.fit
with distribution = "multinomial"
and then optimizes balance using col_w_smd
for standardized mean differences and col_w_ks
for Kolmogorov-Smirnoff statistics, both from cobalt. The following estimands are allowed: ATE, ATT, ATC, ATO, and ATM. The weights are computed from the estimated propensity scores using get_w_from_ps
, which implements the standard formulas. The balance that is optimized is that between each non-focal treatment and the focal treatment for the ATT and ATC and between each treatment and the overall unweighted sample for other estimands. When include.obj = TRUE
, the returned object is the gbm
fit.
For continuous treatments, the generalized propensity score is estimated using gbm.fit
. When include.obj = TRUE
, the returned object is the gbm
fit.
For longitudinal treatments, the weights are the product of the weights estimated at each time point.
Sampling weights are supported through s.weights
in all scenarios.
Missing data is compatible with generalized boosted modeling. NA
values are simply considered their own plausible value for the covariate. When balance statistics are computed to choose the optimal tree, they are computed using only the non-missing values for the variable in question.
The following additional arguments can be specified:
stop.method
A string describing the criterion used to select the best weights. This has two parts: a statistics and a summarizing function, which should be combined as "{stat},{summary}". For binary and multinomial treatments, the available stats are "es"
for absolute standardized mean differences and "ks"
for Kolmogorov-Smirnoff statistics; for continuous treatments, the available stats are "p"
for Pearson correlations between each covariate and the treatment and "s"
for Spearman correlations. For all treatment types, the available summaries are "mean"
for the mean of the statistics, "max"
for the maximum of the statistics, and "rms"
for the root mean square of the statistics (i.e., the L2 norm). The default for binary and multinomial treatments is "es.mean"
and the default for continuous treatments is "p.mean"
.
trim.at
A number supplied to at
in trim
which trims the weights from all the trees before choosing the best tree. This can be valuable when some weights are extreme, which occur especially with continuous treatment. The default is 0 (i.e., no trimming).
distribution
A string with the distribution used in the loss function of the boosted model. This is supplied to the distribution
argument in gbm.fit
. For binary treatments, "bernoulli"
and "adaboost"
are available, with "bernoulli"
the default. For multinomial treatments, only "multinomial"
is allowed. For continuous treatments "gaussian"
, "laplace"
, and "tdist"
are available, with "gaussian"
the default.
n.trees
The maximum number of trees used. This is passed onto the n.trees
argument in gbm.fit
. The default is 10000 for binary and multinomial treatments and 20000 for continuous treatments.
interaction.depth
The depth of the trees. This is passed onto the interaction.depth
argument in gbm.fit
. Higher values indicate better ability to capture nonlinear and nonadditive relationships. The default is 3 for binary and multinomial treatments and 4 for continuous treatments.
shrinkage
The shrinkage parameter applied to the trees. This is passed onto the shrinkage
argument in gbm.fit
. The default is .01 for binary and multinomial treatments and .0005 for continuous treatments.
bag.fraction
The fraction of the units randomly selected to propose the next tree in the expansion. This is passed onto the bag.fraction
argument in gbm.fit
. The default is 1, but smaller values should be tried.
All other arguments take on the defaults of those in gbm.fit
, and some are not used at all.
The w
argument in gbm.fit
is ignored because sampling weights are passed using s.weights
.
Binary treatments
McCaffrey, D. F., Ridgeway, G., & Morral, A. R. (2004). Propensity Score Estimation With Boosted Regression for Evaluating Causal Effects in Observational Studies. Psychological Methods, 9(4), 403<U+2013>425. 10.1037/1082-989X.9.4.403
Multinomial Treatments
McCaffrey, D. F., Griffin, B. A., Almirall, D., Slaughter, M. E., Ramchand, R., & Burgette, L. F. (2013). A Tutorial on Propensity Score Estimation for Multiple Treatments Using Generalized Boosted Models. Statistics in Medicine, 32(19), 3388<U+2013>3414. 10.1002/sim.5753
Continuous treatments
Zhu, Y., Coffman, D. L., & Ghosh, D. (2015). A Boosting Algorithm for Estimating Generalized Propensity Scores with Continuous Treatments. Journal of Causal Inference, 3(1).
# NOT RUN {
# Examples take a long time to run
# }
# NOT RUN {
library("cobalt")
data("lalonde", package = "cobalt")
#Balancing covariates between treatment groups (binary)
(W1 <- weightit(treat ~ age + educ + married +
nodegree + re74, data = lalonde,
method = "gbm", estimand = "ATE",
stop.method = "es.max"))
summary(W1)
bal.tab(W1)
#Balancing covariates with respect to race (multinomial)
(W2 <- weightit(race ~ age + educ + married +
nodegree + re74, data = lalonde,
method = "gbm", estimand = "ATT",
focal = "hispan", stop.method = "ks.mean"))
summary(W2)
bal.tab(W2)
#Balancing covariates with respect to re75 (continuous)
(W3 <- weightit(re75 ~ age + educ + married +
nodegree + re74, data = lalonde,
method = "gbm", use.kernel = TRUE,
stop.method = "p.rms", trim.at = .97))
summary(W3)
bal.tab(W3)
# }
Run the code above in your browser using DataLab