* * AR1.PRG * Manual Example 5.1 * * This is example 12.7 in Gujarati, Basic Econometrics, 3rd Edition * cal 1962 1 4 all 1967:4 data(format=free,org=obs,unit=input) / hwi u 104.66 5.63 103.53 5.46 97.30 5.63 95.96 5.60 98.83 5.83 97.23 5.76 99.06 5.56 113.66 5.63 117.00 5.46 119.66 5.26 124.33 5.06 133.00 5.06 143.33 4.83 144.66 4.73 152.33 4.46 178.33 4.20 192.00 3.83 186.00 3.90 188.00 3.86 193.33 3.70 187.66 3.66 175.33 3.83 178.00 3.93 187.66 3.96 * set loghwi = log(hwi) set logu = log(u) * linreg loghwi / resids # constant logu * * Check for higher order serial correlation * correlate resids * * Redo regression with Newey-West covariances with six lags * linreg(robusterrors,lags=6,damp=1.0) loghwi # constant logu * * AR1 regression with rho computed from Durbin-Watson * ar1(rho=(1-%durbin*.5)) loghwi # constant logu * * AR1 regression using Cochrane-Orcutt * ar1(method=corc) loghwi # constant logu * * AR1 regression using Hildreth-Lu * ar1(method=hilu) loghwi # constant logu * * AR1 regression using maximum likelihood search * ar1(method=search) loghwi # constant logu