FOCUS AREAS

SAS/ETS Examples

Forecasting a Seasonal ARMA Process


Contents | Back to Example

SAS Program

/* Forecasting a Seasonal ARMA Process */

data steel;
   input date:monyy5. steelshp @@;
   format date monyy5.;
   title 'U.S. Steel Shipments Data';
   title2 '(thousands of net tons)';
   datalines;
JAN84 5980 FEB84 6150 MAR84 7240 APR84 6472 MAY84 6948 JUN84 6686
JUL84 5820 AUG84 6033 SEP84 5454 OCT84 6087 NOV84 5317 DEC84 4867
JAN85 6017 FEB85 5598 MAR85 6344 APR85 6425 MAY85 6519 JUN85 6125
JUL85 5710 AUG85 6064 SEP85 5848 OCT85 6308 NOV85 5654 DEC85 5821
JAN86 6437 FEB86 5799 MAR86 6142 APR86 6283 MAY86 6212 JUN86 6007
JUL86 5815 AUG86 5364 SEP86 5608 OCT86 5923 NOV86 4899 DEC86 5199
JAN87 5664 FEB87 5527 MAR87 6234 APR87 6312 MAY87 6247 JUN87 6656
JUL87 6295 AUG87 6364 SEP87 6726 OCT87 7077 NOV87 6606 DEC87 6977
JAN88 6608 FEB88 6848 MAR88 7693 APR88 7082 MAY88 7187 JUN88 7422
JUL88 6325 AUG88 7035 SEP88 6922 OCT88 6912 NOV88 6712 DEC88 6738
JAN89 7278 FEB89 6832 MAR89 7824 APR89 7164 MAY89 7446 JUN89 7331
JUL89 6387 AUG89 7224 SEP89 6779 OCT89 7174 NOV89 6652 DEC89 6053
JAN90 6863 FEB90 6502 MAR90 7569 APR90 7023 MAY90 7523 JUN90 7493
JUL90 6890 AUG90 7366 SEP90 6893 OCT90 7366 NOV90 6907 DEC90 6187
JAN91 6786 FEB91 6039 MAR91 5966 APR91 6450 MAY91 6762 JUN91 6623
JUL91 6420 AUG91 6954 SEP91 6747 OCT91 7499 NOV91 6427 DEC91 6118
;

proc gplot data=steel;
   format date year4.;
   plot steelshp*date / haxis=axis1 vaxis=axis2
                        vminor=1 cframe=ligr;
   title 'U.S. Steel Shipments Data';
   title2 '(thousands of net tons)';
   symbol1 c=blue i=join v=star;
   axis1 offset=(1 cm)
         label=('Year') minor=none
         order=('01jan84'd to '01jan92'd by year);
   axis2 label=(angle=90 'Steel Shipments')
         order=(4500 to 8500 by 1000);
run;
quit;

proc arima data=steel;
   i var=steelshp;
run;

   e p=(2)(12) q=(1 3);
run;

   f lead=12
     out=steel2
     id=date
     interval=month
     noprint;
run;

data steel3;
   set steel2;
   if date lt '01jan92'd then do;
      forecast=.;
      l95=.;
      u95=.;
   end;
run;

proc gplot data=steel3;
   format date year4.;
   plot steelshp*date=1
        forecast*date=2
        l95*date=3
        u95*date=3 / overlay cframe=ligr
                     haxis=axis1 vaxis=axis2
                     vminor=1 href='01jan92'd;
   title 'U.S. Steel Shipments Data';
   title2 '(thousands of net tons)';
   axis1 offset=(1 cm)
         label=('Year') minor=none
         order=('01jan84'd to '01jan93'd by year);
   axis2 label=(angle=90 'Steel Shipments')
         order=(4500 to 8500 by 1000);
   symbol1 c=blue  i=join l=1 v=star;
   symbol2 c=red   i=join l=1 v=F;
   symbol3 c=green i=join l=20;
run;
quit;