This page explains the details of estimating weights from generalized boosted model-based propensity scores by setting method = "twang"
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 and multinomial treatments, this method relies on ps
from the twang package. For continuous treatments, this method relies on ps.cont
from WeightIt.
Binary Treatments
For binary treatments, this method estimates the propensity scores using ps
. The following estimands are allowed: ATE, ATT, and ATC. The weights for the ATE, ATT, and ATC are computed from the estimated propensity scores using the standard formulas. When the estimand is the ATE, the return propensity score is the probability of being in the "second" treatment group, i.e., levels(factor(treat))[2]
; when the estimand is the ATC, the returned propensity score is the probability of being in the control (i.e., non-focal) group. When include.obj = TRUE
, the returned object is the ps
fit.
Multinomial Treatments
For multinomial treatments, this method estimates the propensity scores using multiple calls to ps
(which is the same thing that mnps
in twang does behind the scenes). The following estimands are allowed: ATE and ATT. The weights are computed from the estimated propensity scores using the standard formulas. When include.obj = TRUE
, the returned object is a list of the ps
fits.
Continuous Treatments
For continuous treatments, the generalized propensity score is estimated using ps.cont
. When include.obj = TRUE
, the returned object is the ps.cont
fit.
Longitudinal Treatments
For longitudinal treatments, the weights are the product of the weights estimated at each time point, which is what iptw
in twang does behind the scenes.
Sampling Weights
Sampling weights are supported through s.weights
in all scenarios.
Missing Data
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.