Resources

Illustration of ODS Graphics

/*--------------------------------------------------------------

                    SAS Sample Library

        Name: autex08.sas
 Description: Example program from SAS/ETS User's Guide,
              The AUTOREG Procedure
       Title: Illustration of ODS Graphics
     Product: SAS/ETS Software
        Keys: autoregression
        PROC: AUTOREG
       Notes:

--------------------------------------------------------------*/

ods graphics on;

data a;
   ul = 0; ull = 0;
   do time = -10 to 36;
      u = + 1.3 * ul - .5 * ull + 2*rannor(12346);
      y = 10 + .5 * time + u;
      if time > 0 then output;
      ull = ul; ul = u;
   end;
run;

data b;
   y = .;
   do time = 37 to 46; output; end;
run;

data b;
   merge a b;
   by time;
run;

proc autoreg data=b all plots(unpack);
   model y = time / nlag=2 method=ml;
   output out=p p=yhat  pm=ytrend
                lcl=lcl ucl=ucl;
run;