/* --------------------------*/ /* EXAMPLE 19 */ /* --------------------------*/ /* The following program is found on p. 237 of */ /* Forecasting Examples for Business and */ /* Economics Using the SAS System */ data almon; input y x @@; retain date '1oct52'd; date=intnx('qtr',date,1); format date yyq.; qtr = mod( _n_-1, 4 ) + 1; q1 = qtr=1; q2 = qtr=2; q3 = qtr=3; label y='Capital Expenditures' x='Appropriations'; title 'National Industrial Conference Board Data'; datalines; 2071 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 . 5412 . 5465 . 5550 . 5465 ; proc pdlreg data=almon; model y=q1 q2 q3 x(9,3,2) / dw=4 dwprob nlag=2; run; /* p. 244 */ proc pdlreg data=almon noprint; model y=x(8,2) / nlag=2; output out=pdl_out1 predicted=p residual=r lcl=l ucl=u; run; proc print data=pdl_out1 noobs; where date > '01dec65'd; var date u p y l r; title2 'PDL Model Forecasts'; run; /* p. 245 */ proc model data=almon; parms intercpt a1 a2 a3; %pdl (xpdl,9,2) /* Specify the Model to Estimate */ y = intercpt + a1*q1 + a2*q2 + a3*q3 + %pdl (xpdl,x); fit y; id date; solve y / forecast out=pdl_out2 outpredict; title2; run; quit; proc print data=pdl_out2 noobs; where date > '01dec65'd; run;