*! version 1.0.0 06Jan2017

Title

drmmws -- Doubly-robust marginal mean weighting through stratification

Syntax

drmmws
outcome
treatvar
[indepvars]
[if] [in]
[, ovars(varlist)
pvars(varlist)
nstrata(integer)
family(familyname)
link(linkname)
att
median
common
seed(integer)
reps(integer) ]

treatvar must be binary and coded 0 for the control group and 1 for the treatment group.

ovars(varlist) specifies the covariates in the outcome model

pvars(varlist) specifies the covariates in the treatment assignment model (propensity score)

nstrata(integer) specifies the number of quantiles of the propensity score to generate; default is 5

family(glm##familyname:familyname) distribution of the outcome variable; default is family(gaussian)

link(glm##linkname:linkname) link function; default is link(identity)

att estimates average treatment effect on the treated; default is the average treatment effect in the population

median estimates median treatment effects. Can be combined with att to estimate the median treatment effect on the treated

common restricts the analysis to only those units within the region of common support

seed(integer) sets the random-number seed for the bootstrap procedure

reps(integer) specifies the number of replications to be performed in the bootstrap procedure; default is 200

ovars and pvars may contain factor variables; see fvvarlists.

Description

drmmws estimates doubly-robust effects of a binary treatment on an outcome, controlling for observed confounding variables (See Linden [2017a] for details of the method).
drmmws use weighted regression coefficients to compute averages (or medians) of each treatment group's predicted outcome distribution, with weights computed for each observation
based on their actual treatment assignment and stratum (See Hong [2010, 2012], and Linden [2014]). The contrast of these averages (or medians) estimates the treatment effects.
drmmws estimates the potential-outcome means (or medians) for each treatment group, and the average (or median) treatment effect (ATE, MTE), or the average (or median)
treatment effect on the treated (ATT, MTE). Standard errors, p values, and confidence intervals are computed using a bootstrap procedure which incorporates estimation of both
the propensity score and outcome models.

drmmws requires the user-written program mmws to be installed.

Remarks

By default drmmws generates 5 quantiles of the propensity score (Rosenbaum & Rubin [1984] have shown that stratifying the propensity score into 5 quantiles
can remove over 90% of the initial bias due to the covariates used to generate the propensity score). However, the user should consider identifying the optimal
stratification solution for the specific data at hand. This can be accomplished by first running the user-written program pstrata to determine how many quantiles
are necessary to achieve balance on the propensity score (Linden [2017b] found that pstrata consistently achieved better covariate balance and reduced bias when compared
to 5 quantiles). Once the optimal number of quantiles has been determined, this value can be passed on to drmmws in the nstrata() option.

Options

ovars(varlist) specifies the covariates to be used in the outcome model. If no ovars are set, all the variables in indepvars are used.

pvars(varlist) specifies the covariates to be used in the propensity score model. If no pvars are set, all the variables in indepvars are used.

nstrata(#) specifies the number of quantiles of the propensity score to generate. The default is 5, however, the user should consider running pstrata
to determine the optimal number of quantiles for the given dataset.

family(familyname) uses the probability distribution of the generalized linear outcome model. See familyname for all available options.

link(linkname)is the link function of the generalized linear outcome model. See linkname for all available options.

att specifies that drmmws should estimate the average treatment effect on the treated (ATT). The default is to estimate the average treatment effect in the population (ATE).

median specifies that drmmws should estimate the median treatment effect (estimated using quantile regression). median can be combined with the att option to
estimate the median treatment effect on the treated (MTT).

common restricts the analysis to only those units within the region of common support. drmmws generates weights for those observations within the region of common
support, and gives a weight of zero to observations not on common support. An indicator or dummy variable named _support is added to the dataset to identify the observations
on common support.

seed(#) sets the random-number seed for the bootstrap procedure.

reps(#) specifies the number of bootstrap replications to be performed. The default is 200. A total of 50-200 replications are generally adequate for estimates of standard error
and thus are adequate for normal-approximation confidence intervals; see Mooney and Duval [1993, 11]. Estimates of confidence intervals using the percentile or bias-corrected
methods typically require 1,000 or more replications.

Variables added to the dataset

drmmws generates several variables for the convenience of the user. These variables will be replaced automatically after each run, so rename them if you'd like to retain them:

_strata will be the result of the chosen option in nstrata()

_support is an indicator or dummy variable indicating whether an observation is on common support

_mmws is the weight generated by drmmws. The variable label will provide a brief description

Examples

Setup

. webuse cattaneo2, clear

Estimate the average treatment effect of smoking on birthweight, using 5 stata

. drmmws bweight mbsmoke, ovars(prenatal1 mmarried mage fbaby) pvars(mmarried c.mage##c.mage fbaby medu) nstrata(5)

Assess the ATE as a percentage of the mean birthweight that would occur if no mothers smoke.

. nlcom _b[teffect] / _b[poms0]

Estimate the median treatment effect of smoking on birthweight, using 5 stata

. drmmws bweight mbsmoke, ovars(prenatal1 mmarried mage fbaby) pvars(mmarried c.mage##c.mage fbaby medu) nstrata(5) median

Refit the above model, but estimate median treatment effects on the treated

. drmmws bweight mbsmoke, ovars(prenatal1 mmarried mage fbaby) pvars(mmarried c.mage##c.mage fbaby medu) nstrata(5) att median

Refit the above model, but limit the analysis to individuals on common support, and set the number of bootstrap reps to 1,000

. drmmws bweight mbsmoke, ovars(prenatal1 mmarried mage fbaby) pvars(mmarried c.mage##c.mage fbaby medu) nstrata(5) att median common reps(1000)

Get produce a table of additional boostrap confidence intervals

. estat bootstrap, all

Saved results

drmmws returns the following bootstrap results in e():

Scalars

e(level) confidence level for bootstrap CIs

e(N_reps) number of complete replications

e(N_misreps) number of incomplete replications

e(bs_version) version for bootstrap results

e(rank) rank of e(V)

e(k_eq) number of equations in e(b)

e(k_exp) number of standard expressions

e(k_eexp) number of extended expressions (i.e., _b)

e(k_extra) number of extra equations beyond the original ones from e(b)

e(N) sample size

Macros

e(cmdline) command as typed

e(cmd) same as e(cmdname) or bootstrap

e(cmdname) command name from command

e(prefix) bootstrap

e(title) title in estimation output

e(rngstate) random-number state used

e(exp#) expression for the #th statistic

e(command) command

e(vcetype) title used to label Std. Err.

e(vce) bootstrap

e(properties) b V

Matrices

e(b) observed statistics

e(V) bootstrap variance-covariance matrix

e(b_bs) bootstrap estimates

e(reps) number of nonmissing results

e(bias) estimated biases

e(z0) median biases

e(se) estimated standard errors

e(ci_normal) normal-approximation CIs

e(ci_percentile) percentile CIs

e(ci_bc) bias-corrected CIs

References

Hong, G. 2010. Marginal mean weighting through stratification: adjustment for selection bias in multilevel data.
Journal of Educational and Behavioral Statistics 35: 499-531.

Hong, G. 2012. Marginal mean weighting through stratification: a generalized method for evaluating multi-valued
and multiple treatments with non-experimental data. Psychological Methods 17: 44-60.

Linden, A. 2014. Combining propensity score-based stratification and weighting to improve
causal inference in the evaluation of health care interventions. Journal of Evaluation in Clinical Practice 20: 1065-1071.

Linden, A. 2017a. Improving casual inference with a doubly robust estimator that combines propensity score stratification and weighting.
Journal of Evaluation in Clinical Practice DOI:10.1111/jep.12714

Linden, A. 2017b. A comparison of approaches for stratifying on the propensity score to reduce bias.
Journal of Evaluation in Clinical Practice DOI:10.1111/jep.12701

Mooney, C. Z., and R. D. Duval. 1993. Bootstrapping: A Nonparametric Approach to Statistical Inference.
Newbury Park, CA: Sage.

Rosenbaum P.R, and D. B. Rubin. 1984. Reducing bias in observational studies using subclassification on the propensity score.
Journal of the American Statistical Association 79: 516-524.

Citation of drmmws

drmmws is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden, Ariel. 2017.
drmmws: Stata module for implementing doubly-robust marginal mean weighting through stratification.

Author

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

http://www.lindenconsulting.org

Acknowledgments

I wish to thank Chuck Huber for trouble-shooting an error in the bootstrap procedure, and to John Moran for beta-testing the program.

Also see

Online: xtile, glm, teffects, bootstrap, mmws (if installed),
pstrata (if installed), covbal (if installed)