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.
See the Note section at method_gbm
for a discussion of how this method differs from method = "gbm"
. In general, using method = "gbm"
is preferred because it is faster and more flexible. method = "twang"
will likely become defunct in future versions.
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.
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.
Continuous Treatments
For continuous treatments, the generalized propensity score is estimated using ps.cont
.
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
In the presence of missing data, the following value(s) for missing
are allowed:
"ind"
(default)First, for each variable with missingness, a new missingness indicator variable is created which takes the value 1 if the original covariate is NA
and 0 otherwise. The missingness indicators are added to the model formula as main effects. The weight estimation then proceeds with this new formula and set of covariates using surrogate splitting as described below. The covariates output in the resulting weightit
object will be the original covariates with the NA
s.
"surr"
Surrogate splitting is used to process NA
s. No missingness indicators are created. Nodes are split using only the non-missing values of each variable. To generate predicted values for each unit, a non-missing variable that operates similarly to the variable with missingness is used as a surrogate. Missing values are ignored when calculating balance statistics to choose the optimal tree.