* * Example 12.4 from page 405 * cal(m) 1978:2 open data barium.raw data(org=columns) 1978:2 1988:12 chnimp bchlimp befile6 affile6 afdec6 befile12 affile12 afdec12 $ chempi gas rtwex spr sum fall lchnimp lgas lrtwex lchempi trend feb mar apr may jun $ jul aug sep oct nov dec percchn * * Least squares * linreg lchnimp # constant lchempi lgas lrtwex befile6 affile6 afdec6 * * AR1 (Cochrane-Orcutt). The default method for AR1 in RATS is called * Hildreth-Lu, which is a grid search, rather than an iterative process. This * should produce the same results as Cochrane-Orcutt. If it doesn't, * Cochrane-Orcutt hit a local minimum of the sum of squares. * * The results are very slightly different from those in the text probably because * of slight differences in the estimate of rho due to different convergence * criteria. * * You'll notice that the RATS R**2 is higher in the AR1 case, while it's listed * as lower in the text. RATS is using the original dependent variable in * computing the R**2, not the transformed one, so the R**2's are comparable * between the AR1 and LINREG. * ar1(method=corc) lchnimp # constant lchempi lgas lrtwex befile6 affile6 afdec6 * * Using REPORT to generate most of the table on page 406 * report(action=define,hlabels=||"Coefficient","OLS","Cochrane-Orcutt"||) linreg lchnimp # constant lchempi lgas lrtwex befile6 affile6 afdec6 report(regressors) ar1(method=corc) lchnimp # constant lchempi lgas lrtwex befile6 affile6 afdec6 report(regressors) report(row=new,col=current) %rho * * This formats all the numbers with three digits right of the decimal With a * series of REPORT(ACTION=FORMAT) instructions using the ATROW and TOROW options, * it would be possible to get the formatting to match the pattern given in the * text. * report(action=format,picture="*.###") report(action=show)