Subgroup Balancing Propensity Score
Implements the subgroup balancing propensity score (SBPS), which is an algorithm that attempts to achieve balance in subgroups by sharing information from the overall sample and subgroups. (Dong, Zhang, Zeng, & Li, 2020; DZZL). Each subgroup can use either weights estimated using the whole sample, weights estimated using just that subgroup, or a combination of the two. The optimal combination is chosen as that which minimizes an imbalance criterion that includes subgroup as well as overall balance.
sbps(obj, obj2 = NULL, moderator = NULL, formula = NULL, data = NULL, smooth = FALSE, full.search) ## S3 method for class 'weightit.sbps' print(x, ...) ## S3 method for class 'weightit.sbps' summary(object, top = 5, ignore.s.weights = FALSE, ...) ## S3 method for class 'summary.weightit.sbps' print(x, ...)
obj |
a |
obj2 |
a |
moderator |
optional; a string containing the name of the variable in |
formula |
an optional formula with the covariates for which balance is to be optimized. If not specified, the formula in |
data |
an optional data set in the form of a data frame that contains the variables in |
smooth |
|
full.search |
|
x |
a |
object |
a |
top |
how many of the largest and smallest weights to display. Default is 5. |
ignore.s.weights |
whether or not to ignore sampling weights when computing the weight summary. If |
... |
for |
The SBPS relies on two sets of weights: one estimated in the overall sample and one estimated within each subgroup. The algorithm decides whether each subgroup should use the weights estimated in the overall sample or those estimated in the subgroup. There are 2^R permutations of overall and subgroup weights, where R is the number of subgroups. The optimal permutation is chosen as that which minimizes a balance criterion as described in DZZL. The balance criterion used here is, for binary and multinomial treatments, the sum of the squared standardized mean differences within subgroups and overall, which are computed using col_w_smd()
in cobalt, and for continuous treatments, the sum of the squared correlations between each covariate and treatment within subgroups and overall, which are computed using col_w_corr()
in cobalt.
The smooth version estimates weights that determine the relative contribution of the overall and subgroup propensity scores to a weighted average propensity score for each subgroup. If P_O are the propensity scores estimated in the overall sample and P_S are the propensity scores estimated in each subgroup, the smooth SBPS finds R coefficients C so that for each subgroup, the ultimate propensity score is C*P_S + (1-C)*P_O, and weights are computed from this propensity score. The coefficients are estimated using optim()
with method = "L-BFGS-B"
. When C is estimated to be 1 or 0 for each subgroup, the smooth SBPS coincides with the standard SBPS.
If obj2
is not specified and moderator
is, sbps()
will attempt to refit the model specified in obj
with the moderator
in the by
argument. This relies on the environment in which obj
was created to be intact and can take some time if obj
was hard to fit. It's safer to estimate obj
and obj2
(the latter simply by including the moderator in the by
argument) and supply these to sbps()
.
A weightit.sbps
object, which inherits from weightit
. This contains all the information in obj
with the weights, propensity scores, call, and possibly covariates updated from sbps()
. In addition, the prop.subgroup
component contains the values of the coefficients C for the subgroups (which are either 0 or 1 for the standard SBPS), and the moderator
component contains a data.frame with the moderator.
This object has its own summary methods and is compatible with cobalt functions. The cluster
argument should be used with cobalt functions to accurately reflect the performance of the weights in balancing the subgroups.
Noah Greifer
Dong, J., Zhang, J. L., Zeng, S., & Li, F. (2020). Subgroup balancing propensity score. Statistical Methods in Medical Research, 29(3), 659–676. doi: 10.1177/0962280219870836
library("cobalt") data("lalonde", package = "cobalt") #Balancing covariates between treatment groups within races (W1 <- weightit(treat ~ age + educ + married + nodegree + race + re74, data = lalonde, method = "ps", estimand = "ATT")) (W2 <- weightit(treat ~ age + educ + married + nodegree + race + re74, data = lalonde, method = "ps", estimand = "ATT", by = "race")) S <- sbps(W1, W2) print(S) summary(S) bal.tab(S, cluster = "race") #Could also have run # sbps(W1, moderator = "race") S_ <- sbps(W1, W2, smooth = TRUE) print(S_) summary(S_) bal.tab(S_, cluster = "race")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.