Resources

Forecasting Petroleum Sales

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

                    SAS Sample Library

        Name: forex03.sas
 Description: Example program from SAS/ETS User's Guide,
              The FORECAST Procedure
       Title: Forecasting Petroleum Sales
     Product: SAS/ETS Software
        Keys: time series forecasting
        PROC: FORECAST
       Notes:

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

title1 "Sales of Petroleum and Related Products";
proc sgplot data=sashelp.usecon;
   series x=date y=petrol / markers;
   xaxis values=('1jan80'd to '1jan92'd by year);
   yaxis values=(8000 to 20000 by 1000);
   format date year4.;
run;

proc forecast data=sashelp.usecon interval=month
              method=expo trend=2 lead=12
              out=out outfull outest=est;
   id date;
   var petrol;
   where date >= '1jan80'd;
run;

title2 'OUTEST= Data Set: EXPO Method';
proc print data=est;
run;

title1 "Sales of Petroleum and Related Products";
title2 'Plot of Forecast: EXPO Method';
proc sgplot data=out;
   series x=date y=petrol / group=_type_;
   xaxis values=('1jan89'd to '1jan93'd by qtr);
   yaxis values=(10000 to 20000 by 1000);
   refline '15dec91'd / axis=x;
run;