Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: Stata's two-step treatreg command

 From Bob Reed To "statalist@hsphsun2.harvard.edu" Subject st: Stata's two-step treatreg command Date Sat, 18 May 2013 00:44:37 +0000

```Hi, I'm trying to do some simulations where I reproduce the results from Stata's treatreg command (two-step).  I get very close, but I can't reproduce the results exactly.

Can somebody tell me if this is just rounding error, or is the code below doing something wrong?

Thanks!

Bob Reed

PS.  The code below does not induce any correlation between the error terms in the primary and selection equations.  I will get to that after I can figure out exactly how treatreg calculates its estimates.

------------------------------------
clear
set obs 1000
set seed 50
generate e1 = rnormal()
generate e2 = rnormal()
generate x1 = rnormal()
generate x2 = rnormal()
generate y2star = x1 + x2 + e2
generate y2 = 0
replace y2 = 1 if y2star>=0
/* y2 is the treatment indicator */
generate y1 = x1 + y2 + e1
probit y2 x1 x2
predict y2hat
/* This command generates the results I want to reproduce */
treatreg y1 x1, twostep treat(y2 = x1 x2)
/* According to my understanding of treatreg, this OLS equation should   */
/* reproduce treatreg's twostep estimates of the treatment effect        */
regress y1 x1 y2hat

--------------------------------------------------------------------
W. Robert Reed
Professor
Replications Co-Editor, Public Finance Review
Editor, ISRN Economics
Department of Economics and Finance
University of Canterbury
Private Bag 4800
Christchurch
New Zealand
Phone: +64-3-3642846
Fax: +64-3-3642635
Email: bobreednz@yahoo.com
Homepage: http://www.econ.canterbury.ac.nz/personal_pages/bob_reed/

--------------------------------------------------------------------
The curious task of economics is to demonstrate to men how little they really know about what they imagine they can design. - F.A. Hayek

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```