{smcl}
{hline}
help for {hi:dr}
{hline}

{title:Doubly Robust Estimation}

{title:Syntax}

{p 8 17 2}
{cmd:dr}
{it: outcome}
{it: exposure}
[{indepvars}]
{ifin}
[, options ]

{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}
{synopt:{opt ovars(varlist)}} Variables in outcome model (if different
from {indepvars}) {p_end}
{synopt:{opt pvars(varlist)}} Variables in weight model (if different
from {indepvars}) {p_end}
{synopt:{opt family(string)}} Distribution of {it:outcome} in outcome
model{p_end}
{synopt:{opt link(string)}}   Link function used in outcome model{p_end}
{synopt:{opt vce(vce_type[, vce_options])}}    Method used to calculate variance-covariance matrix {p_end}
{synopt:{opt seed(#)}}        Seed for random number generator{p_end}
{synopt:{opt genvars}}        Adds variables used in the construction
of the estimator to the dataset.{p_end}
{synopt:{opt suffix}}         Sets suffix for the variables added to the dataset.{p_end}
{synoptline}

{title:Description}

{phang}
This program computes a doubly-robust effect estimate for the effect
of a treatment on an outcome given a set of confounders. The
confounding effect is adjusted for in two ways: by modelling the
effect of both treatment and confounders on the outcome (outcome
model), and by weighting observations according to the inverse of
their probability of receiving the treatment they actually received
(propensity model). If either the outcome model or the propensity
model is correct, the doubly-robust estimate is unbiased. 

{title:Options}

{phang}
{opt ovars(varlist)} List of variables used in the outcome model part
of the doubly-robust estimator. If it is not set, all of the
variables in {indepvars} are used. 

{phang}
{opt pvars(varlist)} List of variables used in the propensity model
part of the doubly-robust estimator. If it is not set, all of the
variables in {indepvars} are used. 

{phang}
{opt family(string)} Probability distribution of the generalized
linear outcome model. See {help glm##family:family} for the options
available. 

{phang}
{opt link(string)} Link function of the generalized linear outcome
model (see {help glm##link:link} for the options available). It should
be noted that this only affects the outcome model: the doubly robust
estimator measure the difference between the mean outcome in the
treated and the mean outcome in the untreated. So if you have a
dichotomous outcome, you may wish to specify {opt logit} for the link,
but the the doubly-robust estimate given will still be a risk
difference, not an odds ratio.

{phang}
{opt vce(vce_type[, vce_options])} Method used for calculating the the
standard error of the estimator. This can be either "robust" or
"bootstrap", with the default being "robust". The {opt vce(bootstrap)}
option has a number of suboptions to control how the bootstrapping is
performed: see {help bootstrap:bootstrap_options} for details. Note that
the options  {opt oim} and {opt opg}, described in {help vce_option}
are not implemented.  

{phang}
{opt seed(#)} If this option is given, the random number seed is set
to this value. This enables an analysis to be reproduced if the
"bootstrap" option is chosen for {opt vce}.

{phang}
{opt genvars} This option will add the following variables to the
dataset:
{p_end}
{p2colset 8 18 22 4}{...}
{p2col :ptreat}Probability of receiving treatment, given {indepvars} or {opt pvars}, if {opt pvars} is defined.{p_end}
{p2col : iptwt}Inverse probability of treatment weight{p_end}
{p2col : mu0}Predicted value of {it:outcome} in the untreated, given
{indepvars} or {opt ovars} if {opt ovars} is defined.{p_end}
{p2col : mu1}Predicted value of {it:outcome} in the treated, given
{indepvars} or {opt ovars} if {opt ovars} is defined.{p_end}
{p2col : mudiff}Difference between mu1 and mu0 in this observation{p_end}
{p2colreset}{...}

{phang}
{opt suffix(string)} This option adds the suffix {it:string} to each of the variables generated by {opt genvars}, so that name clashes can be avoided.

{phang}
There is also a {opt debug} option, which creates variables containing
a number of the expressions from Lunceford and Davdian (2004): refer
to the source code for details. The option {opt suffix(string)} also
affects these variables. 

{title:Remarks}

Doubly robust estimation methods were introduced by Robins {it:et al} (1995) 
and compared to other methods for observational studies by Lunceford
and Davidian (2004). 

{title:Saved Results}
This is an e-class command and the results are saved as follows:

scalars:    e(dr_est)     : Doubly robust estimate
            e(dr_var)     : Variance of doubly robust estimate
            e(dr0)        : Expected average outcome if no subjects treated
            e(dr1)        : Expected average outcome if all subjects treated
macros:     e(properties) : "b V"
matrices:   e(b) :  1 x 1 : Doubly robust estimate
            e(V) :  1 x 1 : Variance of doubly robust estimate
functions:  e(sample)     : Estimation sample
{phang}

{title:References}
Robins, J. M., Rotnitzky, A., & Zhao, L. P. 1995, {it}"Analysis of
Semiparametric Regression-Models for Repeated Outcomes in the Presence
of Missing Data"{sf}, Journal of the American Statistical Association,
vol. 90, no. 429, pp. 106-121. 

Lunceford, J. K. & Davidian, M. 2004, {it}"Stratification and
weighting via the propensity score in estimation of causal treatment
effects: a comparative study"{sf}, Statistics in Medicine, vol. 23,
no. 19, pp. 2937-2960. 
{phang}

{title:Author}

Mark Lunt, Arthritis Research UK Epidemiology Unit
Richard Emsley, Biostatistics Group
The University of Manchester

{pstd}
Please email {browse "mailto:mark.lunt@manchester.ac.uk":Mark Lunt} if
you encounter problems with this program.

