Dear Statalisters,
I have a panel dataset that looks as follows:
firm year y x
1 1980 20 23
1 1981 22 34
1 1982 20 19
1 198320 23
1 1984 22 34
1 1985 20 19
...........
2 1980 15 23
2 1981 55 34
2 1982 29 19
2 1983 15 23
2 1984 55 34
2 198529 19
.............
etc.
I need to run the following 3 5-year window rolling regressions: 1) y
= intercept +b*trend + erroy;
2) x = intercept + c*trend + errorx; 3) errory = d*errorx+error.
I can easily run the first two regressions using "rolling" or
"rollreg", except that I don't know how to set the trend variable
to range from 1 to 5 for each regression. I have no idea however on
how to save the residuals after each run of 1) and 2) to run
regression 3).
I would truly appreciate any suggestions on how I could resolve this issue.
Best regards,
Erasmo
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/