/* -------------------------- */ /* EXAMPLE 5 */ /* -------------------------- */ /* pp. 3-6 */ data constr; input date:monyy5. contrcts intrate hstarts @@; format date monyy5.; title 'Construction Data'; datalines; JAN83 11358 13.00 91.3 FEB83 11355 12.62 96.3 MAR83 16100 12.97 134.6 APR83 16315 12.02 135.8 MAY83 19205 12.21 174.9 JUN83 20263 11.90 173.2 JUL83 16885 12.02 161.6 AUG83 19441 12.01 176.8 SEP83 17379 12.08 154.9 OCT83 16028 11.80 159.3 NOV83 15401 11.82 136.0 DEC83 13518 11.94 108.3 JAN84 14023 11.80 109.1 FEB84 14442 11.78 130.0 MAR84 17916 11.56 137.5 APR84 17655 11.55 172.7 MAY84 21990 11.68 180.7 JUN84 20036 11.61 184.0 JUL84 19224 11.91 162.1 AUG84 19367 11.89 147.4 SEP84 16923 12.03 148.5 OCT84 18413 12.27 152.3 NOV84 16616 12.27 126.2 DEC84 14220 12.05 98.9 JAN85 15154 11.77 105.4 FEB85 13652 11.74 95.8 MAR85 20004 11.42 145.2 APR85 20692 11.55 176.0 MAY85 22532 11.55 170.5 JUN85 20043 11.31 163.4 JUL85 22047 10.94 160.7 AUG85 21055 10.78 160.7 SEP85 20541 10.69 147.7 OCT85 21715 10.64 173.0 NOV85 17691 10.55 124.1 DEC85 16276 10.47 120.5 JAN86 15417 10.40 115.6 FEB86 16152 10.21 107.2 MAR86 19617 10.04 151.0 APR86 23754 9.87 188.2 MAY86 23050 9.84 186.6 JUN86 23740 9.74 183.6 JUL86 23621 9.89 172.0 AUG86 21884 9.84 163.8 SEP86 21763 9.74 154.0 OCT86 21862 9.57 154.8 NOV86 17998 9.45 115.6 DEC86 17982 9.28 113.0 JAN87 16694 9.14 105.1 FEB87 15729 8.87 102.8 MAR87 22622 8.77 141.2 APR87 23077 8.84 159.3 MAY87 22054 8.99 158.0 JUN87 25703 9.05 162.9 JUL87 24567 9.01 152.4 AUG87 23836 9.01 143.6 SEP87 22418 9.03 152.0 OCT87 23360 8.86 139.1 NOV87 18663 8.92 118.8 DEC87 19224 8.78 85.4 JAN88 15113 8.75 78.2 FEB88 17496 8.76 90.2 MAR88 22257 8.77 128.8 APR88 22344 8.76 153.2 MAY88 24138 8.59 140.2 JUN88 26940 8.90 150.2 JUL88 22309 8.80 137.0 AUG88 24826 8.68 136.8 SEP88 22670 8.90 131.1 OCT88 22223 8.77 135.1 NOV88 19767 9.05 113.0 DEC88 19125 9.04 94.2 JAN89 15776 9.20 100.1 FEB89 15086 9.46 85.8 MAR89 21080 9.63 117.8 APR89 21725 9.88 129.4 MAY89 23796 9.82 131.7 JUN89 24650 10.09 143.2 JUL89 22330 10.06 134.7 AUG89 24128 9.83 122.4 SEP89 23371 9.87 109.3 OCT89 22669 9.77 130.1 ; goptions cback=white colors=(black) border reset=(axis symbol); axis1 offset=(1 cm) label=('Year') minor=none order=('01jan83'd to '01jan90'd by year); axis2 label=(angle=90 'Construction Contracts') order=(10000 to 30000 by 5000); symbol1 i=join; proc gplot data=constr; format date year4.; plot contrcts*date / haxis=axis1 vaxis=axis2 vminor=1; title2 'Construction Contracts'; run; axis2 label=(angle=90 'Interest Rate') order=(8.0 to 14.0 by 1); proc gplot data=constr; format date year4.; plot intrate*date / haxis=axis1 vaxis=axis2 vminor=1; title2 'Interest Rates'; run; axis2 label=(angle=90 'Housing Starts') order=(75 to 200 by 25); proc gplot data=constr; format date year4.; plot hstarts*date / haxis=axis1 vaxis=axis2 vminor=0; title2 'Housing Starts'; run; /* The following program is found on pp. 86-96 of */ /* Forecasting Examples for Business and */ /* Economics Using the SAS System */ /* p. 86 */ proc arima data=constr; i var=hstarts nlag=15; i var=contrcts nlag=15; i var=intrate nlag=15; run; /* p. 88 */ i var=contrcts(12) /* Take a span-12 difference of the CONTRCTS variable */ noprint; /* Suppress printing the identification phase output */ e p=(2,3) /* Fit a subset AR(3) model with two parameters */ method=ml /* Use the maximum likelihood method */ noprint; /* Suppress printing the estimation phase output */ i var=intrate(1) /* Take first differences of the INTRATE variable */ noprint; e q=(2) /* Fit a subset MA(2) model with one parameter */ method=ml noprint; run; i var=hstarts(12) crosscor=(contrcts(12) intrate(1)) nlag=12; run; /* p. 92 */ e input=(/(1) contrcts) method=ml plot; run; /* p. 96 */ e p=2 input=(/(1) contrcts) method=ml; run; forecast lead=12; run;