/* Building an ARX model with Almon lag. Here we pay proper attention to stochastic trend (i.e. differencing) and thus to the possiblity that spurious regressions may arise when running levels regressions. */ size=60 linesizoptions pagese=74 nodate; goptions device=win gsfname=plot rotate=landscape gsfmode=replace target=hpljs3; *border; data almon; input ce ca @@; qtr = mod( _n_-1, 4 ) + 1; q1 = qtr=1; q2 = qtr=2; q3 = qtr=3; obs = _n_; datalines; 2072 1660 2077 1926 2078 2181 2043 1897 2062 1695 2067 1705 1964 1731 1981 2151 1914 2556 1991 3152 2129 3763 2309 3903 2614 3912 2896 3571 3058 3199 3309 3262 3446 3476 3466 2993 3435 2262 3183 2011 2697 1511 2338 1631 2140 1990 2012 1993 2071 2520 2192 2804 2240 2919 2421 3024 2639 2725 2733 2321 2721 2131 2640 2552 2513 2234 2448 2282 2429 2533 2516 2517 2534 2772 2494 2380 2596 2568 2572 2944 2601 2629 2648 3133 2840 3449 2937 3764 3136 3983 3299 4381 3514 4786 3815 4094 4093 4870 4262 5344 4531 5433 4825 5911 5160 6109 5319 6542 5574 5785 5749 5707 5715 5412 5637 5465 5383 5550 5467 5465 ; proc gplot data=almon; symbol1 c=black v=e i=join h=.8; symbol2 c=black v=a i=join h=.8; title1 'Capital Expenditures vs. Capital Appropriations'; title2 'A= Capital Appropriations E = Capital Expenditures'; axis1 order=(0 to 60 by 10) label=(f=duplex 'Obs'); axis2 order=(1000 to 6000 by 1000) label=(f=duplex 'Approps and Expends'); plot ce*obs = 1 ca*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data almon; set almon; lce = log(ce); lca = log(ca); pce = lce - lag1(lce); pce1 = lag1(pce); pce2 = lag2(pce); pce3 = lag3(pce); pce4 = lag4(pce); pca = lca - lag1(lca); pca1 = lag1(pca); pca2 = lag2(pca); pca3 = lag3(pca); pca4 = lag4(pca); pca5 = lag5(pca); proc gplot data=almon; symbol1 c=black v=e i=join h=.8; symbol2 c=black v=a i=join h=.8; title1 '% Change CE vs. % Change CA'; title2 'PCE = % Change, CE PCA = % Change CA'; axis1 order=(0 to 60 by 10) label=(f=duplex 'Obs'); axis2 order=(-1 to 1 by .25) label=(f=duplex 'PCE and PCA'); plot pce*obs = 1 pca*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; proc arima data = almon; identify var = ce; identify var = lce; identify var = pce; identify var = lce(1,4); run; proc arima data = almon; identify var = ca; identify var = lca; identify var = pca; identify var = lca(1,4); run; title 'National Industrial Conference Board Data'; title2 'Quarterly Series - 1952Q1 to 1967Q4'; proc pdlreg data=almon; model pce = pce1 pce2 pce3 pce4 q1 q2 q3 / lagdv lagdep = pce1 nlag=2; model pce = pce1 pce2 pce3 pce4 / lagdv lagdep = pce1 nlag=2; model pce = pce1 pce4 / lagdv lagdep = pce1 nlag=2; model pce = pce1 pce4 pca(5,5) / lagdv lagdep=pce1 nlag=2; model pce = pce1 pca(5,5) / lagdv lagdep=pce1 nlag=2; model pce = pce1 pca(5,5) / lagdv lagdep=pce1 nlag=1; model pce = pce1 pca(5,2) / lagdv lagdep=pce1 nlag=1; run; /* Here is the F-statistic for the test of the lag length = 5 with quadratic polynomial (the null hypothesis) against and unrestricted lag length = 5 specification (the alternative hypothesis). See the last two model statements and in particular the autocorrelated errors corrected SSE's of the competing models. F = [(.03560387 - .03288043)/3]/[.03288043/(60 - 8)] = 1.4357108. F(3,60,.05) = 3.15. So we accept the null hypothesis that, conditional on the lag length = 5, the quadratic lag is acceptable given the data we observe. */ /* "Traditional" Analysis of Almon Lag relationship (1965 - 1985). No concern about stocastic trends in data and the possibility of spurious regression. See SAS manuals and programs pdlreg1.sas, pdlreg2.sas, pdlreg3.sas, almon1.sas, and almon2.sas. */ /* proc pdlreg data=almon; model ce = q1 q2 q3 ca(5,2)/ nlag=2; run; */