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 multi-category treatments, the
sum of the squared standardized mean differences within subgroups and
overall, which are computed using cobalt::col_w_smd()
, and for continuous
treatments, the sum of the squared correlations between each covariate and
treatment within subgroups and overall, which are computed using
cobalt::col_w_corr()
.
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()
.