{smcl}
{* 9oct2002}{...}
{hline}
help for {hi:attnd}{right:(SJ2-4: st0026)}
{hline}

{title:Calculate the average treatment effect on the treated using nearest neighbor matching}

{p 12 18 2}
{cmd:attnd}
{it:outcome treatment}
[{it:varlist}]
[{it:weight}]
[{cmd:if} {it:exp}]
[{cmd:in} {it:range}]
[ {cmd:,}
{cmd:pscore}{cmd:(}{it:scorevar}{cmd:)}
{cmdab:logit }
{cmdab:index }
{cmdab:comsup}
{cmdab:det:ail}
{cmdab:boot:strap }
{cmdab:r:eps(}{it:#}{cmdab:) }
{cmdab:noi:sily}
{cmdab:d:ots }
]

{p 8 8 2}{cmd:fweight}s, {cmd:iweight}s, and {cmd:pweight}s are allowed;
see help {help weights}.


{title:Description}

{p 4 4 2} {cmd:attnd} estimates the average treatment effect on the treated
(ATT) using nearest neighbor matching. {cmd:attnd} should be run after the
correct  propensity score specification; i.e., the one satisfying the balancing
property has been found using, for example, {cmd:pscore}. If users do not
provide a variable name for the propensity score, the propensity score is
estimated based on the specification in {it:varlist}. Note that in this case
the balancing property is not tested.

{p 4 4 2} It is left under the responsibility of the user to select the
{cmdab:comsup} option if the user provided propensity score has been
estimated on a common support for treated and controls.  Otherwise,
the ATT is estimated using also the observations outside the common
support for which the propensity score may not be balanced.

{p 4 4 2} To save on computing time, nearest neighbors are not determined by
comparing treated observations to every single control, but by first
sorting all records by the estimated propensity score and then
searching forward and backward for the closest control unit(s). If 
a treated unit forward and backward matches happen to be equally good,
this program randomly draws (hence the letters "nd" for {it:N}earest
neighbor and random {it:D}raw) either the forward or backward matches.
This approach is one of two computationally feasible options to obtain
analytical standard errors while at the same time exploiting the very
fast forward and backward search strategy. The second possibility is
based on giving equal weight to the groups of forward and backward
matches in case of equally good forward and backward matches and is
performed by {cmd:attnw}. In practice, the case of multiple nearest
neighbors should be very rare. In particular, if the set of X's
contains continuous variables, in which case, both {cmd:attnd} and
{cmd:attnw} should give equal results (except for bootstrapped standard
errors). The likelihood of multiple nearest neighbors is further reduced 
if the propensity score is estimated and saved in double precision, which
is what {cmd:pscore} does by default.

{p 4 4 2} The ATT is computed by averaging over the unit-level treatment
effects of the treated where the control(s) matched to a treated observation
is/are those observations in the control group that have the closest
propensity score. If there are multiple nearest neighbors, the average outcome
of those controls is used.


{title:Options}

{p 4 8 2}  
{cmd:pscore(}{it:scorevar}{cmd:)} specifies the name of the user-provided
variable name for the estimated propensity score. If no name is provided
the propensity score is estimated based on the specification in {it:varlist}.

{p 4 8 2}                                                      
{cmd:logit} uses a logit model to estimate the propensity score instead of the
default {cmd:probit} model when the option {cmd:pscore(}{it:scorevar}{cmd:)} is
not specified by the user.  Otherwise, no effect is produced.

{p 4 8 2}                                                      
{cmd:index} requires the use of the linear index as the propensity score when
the option {cmd:pscore(}{it:scorevar}{cmd:)} is not specified by the user.
Otherwise, no effect is produced.

{p 4 8 2} 
{cmd:comsup} restricts the computation of the ATT to the region of common
support.

{p 4 8 2} 
{cmd:detail} displays more detailed output documenting the steps performed to
obtain the final results.

{p 4 8 2}                                                      
{cmd:bootstrap} bootstraps the standard error of the treatment effect.

{p 4 8 2}{cmd:reps(}{it:#}{cmd:)} specifies the number of bootstrap
replications to be performed.  The default is 50.  This option produces an
effect only if the {cmd:bootstrap} option is specified.

{p 4 8 2}{cmd:noisily} requests that any output from the replications be
displayed.  This option produces an effect only if the {cmd:bootstrap}
option is specified.

{p 4 8 2}{cmd:dots} requests that a dot be placed on the screen at the
beginning of each replication.  This option produces an effect only if the
{cmd:bootstrap} option is specified.


{title:Remarks}

{p 4 4 2} Please remember to use the {cmd:update query} command before running
this program to make sure you have an up-to-date version of Stata installed.
Otherwise, this program may not run properly.

{p 4 4 2} The treatment has to be binary.

{p 4 4 2} When users do not specify their own previously estimated propensity
score, the bootstrap encompasses the estimation of the propensity score based
on the specification given by {it:varlist}. This procedure is actually
recommended to account for the uncertainty associated with the estimation of
the propensity score.  Even more so when the {cmd:comsup} option is specified
because in this case the region of common support changes with every bootstrap
sample, and bootstrapped standard errors pick up this uncertainty as well. So,
typically users would first identify a specification satisfying the balancing
property -- using {cmd:pscore} -- and then provide exactly this
specification in {it:varlist} and use bootstrapped standard errors.


{title:Saved results}

{p 4 4 2} The program stores the estimated treatment effect, its standard
error, and the t statistic respectively in the scalars {cmd:r(attnd)},
{cmd:r(seattnd)}, and {cmd:r(tsattnd)}.

{p 4 4 2} The number of treated and the number of controls are stored 
respectively in the scalars {cmd:r(ntnd)} and {cmd:r(ncnd)}.

{p 4 4 2} The bootstrapped standard error and t statistic are stored 
respectively in the scalars  {cmd:r(bseattnd)} and {cmd:r(btsattnd)}.


{title:Examples}

{p 4 8 2}{cmd:. attnd wage training age age2 exp exp2}

{p 4 8 2}{cmd:. attnd wage training age age2 exp exp2, boot reps(100) dots}

{p 4 8 2}{cmd:. attnd wage training age age2 exp exp2, logit boot reps(100)}

{p 4 8 2}{cmd:. attnd wage training age age2 exp exp2, comsup boot reps(100)}


{title:Authors}

	{browse "http://www.sobecker.de":Sascha O. Becker}
	Center for Economic Studies, University of Munich
 
	{browse "http://www.iue.it/Personal/Ichino":Andrea Ichino}
	Department of Economics, European University Institute, Florence

{p 4 4 2}Email {browse "mailto:so.b@gmx.net":so.b@gmx.net} or {browse "mailto:andrea.ichino@iue.it":andrea.ichino@iue.it} if you observe any problems.	

	
{title:Acknowledgments}

{p 4 4 2}
The way to implement the propensity score estimation in the bootstrap procedure 
has been adapted from the {cmd:psmatch} program written by  Barbara Sianesi 
(University College London and Institute for Fiscal Studies) 
Email: barbara_s@ifs.org.uk.


{title:Also see}

{p 4 14 2}Online:  help for {help pscore}, {help atts}, {help attr}, 
{help attk}, {help attnw} (if installed), and {help bs}. 

{p 14 14 2}Further details on the analytical formulas and on the algorithms 
used in these programs  can be found under  
{browse "http://www.sobecker.de":http://www.sobecker.de} 
or 
{browse "http://www.iue.it/Personal/Ichino":http://www.iue.it/Personal/Ichino}.
