Bookmark and Share

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Stata's two-step treatreg command

From   Bob Reed <>
To   "" <>
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?


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.

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
Replications Co-Editor, Public Finance Review
Editor, ISRN Economics
Department of Economics and Finance
University of Canterbury
Private Bag 4800
New Zealand
Phone: +64-3-3642846
Fax: +64-3-3642635

View my Google Scholar profile 

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:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index