Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: Stata's two-step treatreg command

From   Steve Samuels <>
Subject   Re: st: Stata's two-step treatreg command
Date   Mon, 20 May 2013 08:27:17 -0400


You are getting "two-step" mixed up with two-stage least squares. Adding y2hat to the
regression does not produce the two-step estimator. For the correct
terms to add, see pp. 2267 and 2268 of the Stata 12 Manual entry for


On May 17, 2013, at 8:44 PM, Bob Reed wrote:

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:

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index