* * Empirical example from pp 122-125 * open data consump.dat calendar(a) 1950 data(format=prn,org=columns) 1950:1 1993:1 year y c * linreg c # constant y prj fitted graph(footer="Figure 5.4 Residuals") # %resids * * %resids refers to the series of residuals from the most recent regression. * Since we'll be doing quite a few auxiliary regressions and still need the * original OLS residuals, we'll save them into a permanent series * set u = %resids * linreg u # u{1} * ar1(rho=.792) c # constant y * * Prais-Winsten is only available as an iterated procedure * ar1(method=pw) c # constant y ar1(method=maxl) c # constant y * * Durbin's method * linreg c # c{1} constant y{0 1} * * Breusch-Godfrey test * linreg u # constant y u{1} cdf(title="Breusch-Godfrey Serial Correlation Test") chisqr %trsquared 1 * * OLS estimates but with HAC standard errors allowing for up to three lags * linreg(lwindow=newey,lags=3,robust) c # constant y