<>
Sorry, that was for the coefficients of course. For the residuals you will
have to condition on the year via -if-
*************
// Setup
webuse nlswork, clear
gen age2 = age*age
gen ttl_exp2 = ttl_exp*ttl_exp
gen tenure2 = tenure*tenure
gen byte black = race==2
xtset idcode
levelsof year, local(yrs)
qui foreach year of local yrs{
reg ln_w grade age* ttl_exp* /*
*/ tenure* black not_smsa south/*
*/ if year==`year'
predict res`year', res
}
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Martin Weiss
Gesendet: Montag, 8. Juni 2009 16:13
An: [email protected]
Betreff: st: AW: Automating regressions
<>
Employ -statsby- then...
*************
// Setup
webuse nlswork, clear
gen age2 = age*age
gen ttl_exp2 = ttl_exp*ttl_exp
gen tenure2 = tenure*tenure
gen byte black = race==2
xtset idcode
statsby, by(year) clear : /*
*/ reg ln_w grade age* ttl_exp* /*
*/ tenure* black not_smsa south
list, noobs
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von max r
Gesendet: Montag, 8. Juni 2009 16:10
An: [email protected]
Betreff: st: Automating regressions
Hi All:
I have a panel dataset, with 1500 panels each with 100 time periods. I
want to run a simple cross-sectional regression for each of the 100
time periods and store the residuals as a separate variable each time.
I can do this one by one using "if time_var== " at the end of each
regression, wondering if there is easier way to perform this ?
Thanks,
Max R
*
* 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/
*
* 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/
*
* 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/