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

st: re: instrumental variables estimation problems

From   Christopher Baum <>
Subject   st: re: instrumental variables estimation problems
Date   Tue, 8 Dec 2009 08:52:01 -0500

The 'by hand' Sargan statistic could be computed in a more bulletproof manner via

sysuse auto,clear
loc qual !foreign
ivregress 2sls price (mpg = weight length) if `qual'
// these are the proper 2SLS resids: y - orig X * 2SLS beta
predict double eps, res
estat overid

// Sargan stat by hand
reg eps weight length if `qual'
// compute the uncentered r^2 from this regression
predict double yhat, xb
gen double syhat2 = yhat^2 if `qual'
su syhat2, mean
loc syhat2 = `r(sum)'
gen double seps2 = eps^2 if `qual'
su seps2, mean
scalar ur2 = `syhat2'/r(sum)
// Sargan: N * uncentered r^2
di e(N)*ur2

which will take care of missing values or use of less than the full sample in estimation. Even if Tunga eschews the use of 'canned' routines such as estat overid or ivreg2 for pedagogical reasons, he should check his 'by hand' routine to see that it matches.

The 'artificial regression' terminology is, I believe, due to Davidson and MacKinnon's books. Jeff Wooldridge's books also use this terminology.

Kit Baum   |   Boston College Economics and DIW Berlin   |
An Introduction to Stata Programming   |
An Introduction to Modern Econometrics Using Stata   |

*   For searches and help try:

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