Correcting for Autocorrelation in the residuals using the Cochran-Orcut Method
Using Stata to do it by hand
While it is easy to substitute the prais command and get Stata to automatically correct for serial correlation, it is quite instructive to actually work through an iterative process one by hand to get a feel for what the procedure is really doing.
The basic steps in the iterative method are :
For this example we will use the presidential approval data set: presapp.dta. Remember that the Stata data set needs to be made a Time Series data set.
Run the initial model with OLS
Regress Presidential approval on real GNP
reg approval realgnp
Examine for serial correlation
After running the regression, type the Durbin-Watson Statistic command.
dwstat
Create a set of corrected Xs and Ys