Title

hte sd -- Heterogeneous Treatment Effect Analysis: Smoothing-Differencing Method

Syntax

hte sd depvar1 [depvar2 ... =]
treatvar [indepvars] [if] [in] [weight]
[,
options
]

options

Main
noci suppress confidence bands

level(#) set confidence level; default is level(95)

listwise use listwise deletion to handle missing values;
excludes observations with missing value on (at least one) dependent
variable

casewise synonym for listwise

Propensity score
logit use logit instead of probit to estimate
propensity score

estopts(options) options to be passed through to the
estimation command

noisily display model output

_pscore(varname) provide variable containing propensity score
and skip estimation

Local polynomial fit
kernel(lpoly##kernel:kernel) specify kernel function;
default is kernel(epanechnikov)

degree(#) degree of the polynomial smooth; default is degree(1)

bwidth(#|varname) specify kernel
bandwidth; for treatment group specific values type
bwidth(# #) or bwidth(varname1 varname2)

pwidth(#) specify pilot bandwidth for standard error
calculation; for treatment group specific values type
pwidth(# #)

var(#|varname) specify estimates of residual variance;
for treatment group specific values type
var(# #) or var(varname1 varname2)

ngrid(#) obtain the smooth at # points on a regular grid between 0 and 1; default is
min(N,50); note that only grid points within the support of the propensity score are used

at(varname) obtain the smooth at the values specified by
varname

atmat(matname) obtain the smooth at the values specified by vector
matname

comsup restrict the evaluation grid to the common support of the
propensity score in the treatment group and control group; comsup has no
effect if at() or atmat() is specified

Graph
nograph suppress graph

cline_options affect rendition of the treatment effect
smooth

ciopts(options) affect rendition of confidence bands;
options are cline_options or area_options,
depending on whether overlay is specified or not

overlay include results for all dependent variables in one plot;
the default is to use separate plots and combine them into one graph
using graph combine

combine(options) options passed through to
graph combine (unless overlay is specified)

twoway_options any options other than by() documented in
[G] twoway_options

Save results (for last depvar)
generate(fit [at]) store treatment effect smooth in
variable fit and corresponding propensity score values in variable
at

se(newvar) store standard errors in newvar

ci(lb ub) store lower and upper bounds of confidence interval in
variables lb and ub

pscore(newvar) save estimated propensity score in newvar

replace allow overwriting existing variables

post post results in e()

fweights are allowed; see help weight.

Description

hte sd performs heterogeneous treatment effect analysis using the
smoothing-differencing method as proposed by Xie, Brand, and Jann
(2012). It first estimates the propensity score using of a probit model of
treatvar on indepvars and then, separately for the treated and
the untreated, computes a nonparametric fit of depvar on the
propensity score using lpoly. The propensity score specific treatment
effects are then derived as the difference between the two nonparametric
fits and are plotted in a graph along with pointwise confidence intervals.
treatvar is a dichotomous variable identifying the treatment group
(typically coded as 1) and the control group (typically coded as 0).

Options

Main

noci suppresses the pointwise confidence intervals.

level(#) sets the confidence level, as a percentage, for
confidence intervals. The default is level(95) or as set by
set level.

listwise handles missing values through listwise deletion, meaning
that an observation is excluded from all computations if any of the
specified variables is missing for that observation. By default, hte sd uses all
available observations to compute the propensity strata without regard
to whether values for the outcome variables (the depvars) are missing.

casewise is a synonym for listwise.

Propensity score

logit uses logistic regression (see help logit) to estimate the
propensity score. The default is to use Probit regression (see help probit).

estopts(options) specifies options to be passed through to
the estimation command for the propensity score.

noisily causes the output from the propensity score estimation model to be
displayed.

_pscore(varname) provides a variable containing the propensity
score values. In this case, estimation of the propensity score is skipped.

Local polynomial fit

kernel(kernel) specifies the kernel function. The
default is kernel(epanechnikov). See help lpoly
for alternative kernel functions.

degree(#) specifies the degree of the local polynomial fit. The default
is degree(1) (local-linear smoothing).

bwidth(#|varname) sets the half-width of the kernel.
If bwidth() is not specified, a rule-of-thumb (ROT) bandwidth estimator
used; see [R] lpoly for details. A local variable bandwidth may be
specified in varname, in conjunction with an explicit smoothing grid
using the at() option. To use different bandwidths for the untreated and the
treated type bwidth(# #) or bwidth(varname varname),
where the first bandwidth applies to the control group and the second bandwidth
applies to the treatment group.

pwidth(#) specifies the pilot bandwidth to be used for standard-error
computations. The default is chosen to be 1.5 times the value of the
ROT bandwidth selector. To use different pilot bandwidths for the untreated and the
treated type pwidth(# #), where the first value applies to the control
group and the second bandwidth applies to the treatment group.

var(#|varname) specifies an estimate of a constant residual
variance or a variable containing estimates of the residual variances at
each grid point required for standard-error computation. See help lpoly
for more information. To use different variances for the untreated and the
treated type var(# #) or var(varname varname),
where the first variance applies to the control group and the second variance
applies to the treatment group.

ngrid(#) specifies the number of points at which the smooth is to be
calculated. The default is min(N,50), where N is the number of observations.
A regular grid between 0 and 1 is used; grid points
outside the support of the propensity score are discarded.

at(varname) specifies a variable that contains the values
at which the smooth should be calculated. By default, a regular grid between
0 and 1 of size ngrid() is used. Values outside the support of
the propensity score will be discarded.

atmat(matname) specifies a vector (see help matrix) that contains the values
at which the smooth should be calculated. By default, a regular grid between
0 and 1 of size ngrid() is used. Values outside the support of
the propensity score will be discarded.

comsup restricts the evaluation grid to the common support of the
propensity score in the treatment group and control group. comsup has no
effect if at() or atmat() is specified.

Graph

nograph suppresses drawing the graph.

connect_options affect the rendition of the smoothed line; see
[G-3] cline_options.

ciopts(options) affects the rendition of confidence bands.
options are cline_options or area_options,
depending on whether overlay is specified or not.

overlay causes the results for all dependent variables to be included
in a single plot. The default is to use separate plots and combine
them into one graph using graph combine.

combine(options) provides options to be passed through to
graph combine (not relevant if overlay is specified). options
are as described in help graph combine.

twoway_options are general twoway options, other than by(), as documented
in help twoway_options.

Save results

generate(fit [at]) stores the treatment effect smooth in
variable fit and, unless at() is specified, the corresponding
propensity score values (i.e. the evaluation points) in variable at. Results
for the rightmost dependent variable are stored if multiple dependent
variables are specified.

se(newvar) stores the standard errors in variable
newvar. Standard errors for the rightmost dependent variable are stored if multiple dependent
variables are specified.

ci(lb ub) stores the lower and upper bounds of the
confidence interval in variables lb and ub. Confidence interval
bounds for the rightmost dependent variable are stored if multiple dependent
variables are specified.

pscore(newvar) saves the estimated propensity scores in variable
newvar.

replace allows overwriting existing variables

post post the results in e(); see Saved Results below. Results
for the rightmost dependent variable are posted if multiple dependent
variables are specified.

Examples

Treatment effect of college on wages:

. sysuse nlsw88
. generate sq_exp = ttl_exp^2
. hte sd wage collgrad ttl_exp sq_exp tenure south smsa, comsup ngrid(100)

Saved results

If post is omitted, hte sd leaves behind in e() the results
from the propensity score estimation model and, for the rightmost dependent variable,
saves the following in r():

Scalars

r(ngrid) number of evaluation points

r(degree) degree of lpoly fit

r(N0) number of observations in control group

r(N1) number of observations in treatment group

r(bwidth0) bandwidth of lpoly fit in control group

r(bwidth1) bandwidth of lpoly fit in treatment group

r(pwidth0) pilot bandwidth of lpoly fit in control group

r(pwidth1) pilot bandwidth of lpoly fit in treatment group

Macros

r(depvar) name of dependent variable

r(indepvars) names of control variables

r(treatvar) name of treatment variable

r(treatgrp0) value of control group

r(treatgrp1) value of treatment group

If post is specified, hte sd saves the following in e() for
the rightmost dependent variable:

Scalars

e(N) number of observations

e(ngrid) number of evaluation points

e(degree) degree of lpoly fit

e(N0) number of observations in control group

e(N1) number of observations in treatment group

e(bwidth0) bandwidth of lpoly fit in control group

e(bwidth1) bandwidth of lpoly fit in treatment group

e(pwidth0) pilot bandwidth of lpoly fit in control group

e(pwidth1) pilot bandwidth of lpoly fit in treatment group

e(cilevel) confidence levels

Macros

e(cmd) hte sd

e(properties) b

e(depvar) name of dependent variable

e(indepvars) names of control variables

e(treatvar) name of treatment variable

e(treatgrp0) value of control group

e(treatgrp1) value of treatment group

Matrices

e(b) propensity score specific treatment effects

e(at) evaluation points

e(lb) lower bounds of confidence interval

e(ub) upper bounds of confidence interval

e(se) standard errors

Functions

e(sample) estimation sample

References

Xie, Yu, Jennie E. Brand, Ben Jann. 2012. Estimating Heterogeneous Treatment
Effects with Observational
Data. Sociological Methodology 42: 314-347.

Authors

Ben Jann (University of Bern, jann@soz.unibe.ch)

Jennie E. Brand (UCLA, brand@soc.ucla.edu)

Yu Xie (University of Michigan, yuxie@isr.umich.edu)

Thanks for citing this software as follows:

Jann, B., J. E. Brand, Y. Xie. 2010. hte: Stata module to perform
heterogeneous treatment effect analysis. Available from
http://ideas.repec.org/c/boc/bocode/s457129.html.

Also see

Online: help for
hte, hte sm, hte sd, lpoly