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, **statalist.org** is already up and running.

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

From |
Kit Baum <Baum@bc.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: re: AW: re: Method for first stage, in xtivreg |

Date |
Wed, 24 Feb 2010 10:59:27 -0500 |

<> Martin offered the challenge So Kit, can you provide the code to replicate the first stage here? ************* webuse nlswork, clear xtivreg ln_w age c.age#c.age not_smsa /* */ 2.race (tenure = union birth south), /* */ re first ************* Yes, I could, but it would take more time than I have to devote to it at this moment. I can demonstrate an example of how it can be done for a balanced panel: webuse grunfeld,clear xtivreg invest (mvalue = kstock time), re first scalar theta = e(theta) foreach v of varlist mvalue kstock time { egen `v'mu = mean(`v'), by(company) g double `v'star = `v' - theta*`v'mu loc rl "`rl' `v'star" } reg `rl' The reason why doing the first stage 'by hand' does not work if you merely do xtreg mvalue kstock time, re is that you are not imposing the constraint that the \theta used in the RE-IV model is the one to be used in the first stage. We all know that IV is not really run as two stages, but as a single computation. To pick apart that single computation and get the FSR, you just need to impose the right theta. That would be a bit of a pain in Martin's example because in the case of unbalanced panels, \theta is not constant over panels, and Stata does not report what the individual \thetas are -- only the median, min, max etc. \thetas. It could be done, of course, but as both -xtivreg- and user-written -xtivreg2- (SSC) will give you the FSRs (and -xtivreg2- will allow you to save those estimates), why would you need to 'roll your own'?? Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**re: st: RE: regression r(103): too many variables** - Next by Date:
**RE: st: RE: regression r(103): too many variables** - Previous by thread:
**re: st: RE: regression r(103): too many variables** - Next by thread:
**st: create a dataset or vector of variable names** - Index(es):