Statalist


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

RE: st: outreg2 with xtivreg


From   Roy Wada <[email protected]>
To   <[email protected]>
Subject   RE: st: outreg2 with xtivreg
Date   Sun, 12 Apr 2009 15:02:13 -0700

> ****
> webuse nlswork, clear
> generate age2 = age^2
> generate byte black = (race==2)
> xtivreg ln_w age* not_smsa black (tenure = union birth south), re first
> reg tenure union birth south age* not_smsa black if e(sample)
> ****
>
> Seems that -e(sample)- is not enough here to replicate the frist stage?
>

I didn't see this example since I was working with Stata 9 (I don't like
the do-file editor for Stata 10, it wastes real estate by inserting file
name at the top, enough to make me downgrade to version 9).
 
-xtivreg, re- adjusts the demeaned data using theta/residuals or whatever.
This means the first stage cannot be replicated using -reg- or -xtreg, re-.
 
This will do it:
 
findfile xtivreg.ado
filefilter `"`r(fn)'"' xtivregT.ado, from("e xtivreg") to("e xtivregFirst") replace
filefilter xtivregT.ado xtivregFirst.ado, from("est di,") to("outreg2 using myfile: version 7: est di,") replace
cap erase xtivregT.ado
 
Then use the new command exactly the same as before:
 
prog drop _all
cap erase myfile.txt
xtivregFirst ln_w age* not_smsa black (tenure = union birth south), re first
outreg2 using myfile, see excel
 
This solution should work with whatever.
 
Roy
 
 
_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009
*
*   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/



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