* * AR1.RPF * RATS Version 8, User's Guide, Example 2.2 * cal(a) 1959 open data ar1.prn data(format=prn,org=columns) 1959:1 1998:1 * * OLS regression * linreg y # constant x * * First difference regression. This may be the best choice if the * autocorrelation coefficient is close to 1. * set dx = x-x{1} set dy = y-y{1} linreg dy # dx * * AR1 regression using several methods. HILU and CORC should give almost * identical answers unless there are multiple roots. * ar1(method=hilu) y # constant x ar1(method=corc) y # constant x ar1(method=maxl) y # constant x * * OLS with Newey-West standard errors. This allows for autocorrelation * of up to four lags. * linreg(robust,lwindow=neweywest,lags=4) y # constant x