Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The FORECAST Procedure

Example 12.3: Forecasting Petroleum Sales

This example uses the double exponential smoothing method to forecast the monthly U.S. sales of petroleum and related products series (PETROL) from the data set SASHELP.USECON. These data are taken from Business Statistics, published by the U.S. Bureau of Economic Analysis.

The following statements plot the PETROL series:


   title1 "Sales of Petroleum and Related Products";
   
   symbol1 i=spline v=circle;
   axis2 label=( a=-90 r=90 "Petroleum and Coal Products");
   proc gplot data=sashelp.usecon;
      plot petrol * date = 1 /
           haxis= '1jan80'd to '1jan92'd by year
           vaxis=axis2;
      where date >= '1jan80'd;
      format date year4.;
   run;

The plot is shown in Output 12.3.1.

Output 12.3.1: Sales of Petroleum and Related Products
forex03a.gif (5843 bytes)

The following statements produce the forecast:


   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;

The following statements print the OUTEST= data set:


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

The PROC PRINT listing of the output data set is shown in Output 12.3.2.

Output 12.3.2: The OUTEST= Data Set Produced by PROC FORECAST
 
OUTEST= Data Set: EXPO Method

Obs _TYPE_ DATE PETROL
1 N DEC91 144
2 NRESID DEC91 144
3 DF DEC91 142
4 WEIGHT DEC91 0.1055728
5 S1 DEC91 14165.259
6 S2 DEC91 13933.435
7 SIGMA DEC91 1281.0945
8 CONSTANT DEC91 14397.084
9 LINEAR DEC91 27.363164
10 SST DEC91 1.17001E9
11 SSE DEC91 233050838
12 MSE DEC91 1641203.1
13 RMSE DEC91 1281.0945
14 MAPE DEC91 6.5514467
15 MPE DEC91 -0.147168
16 MAE DEC91 891.04243
17 ME DEC91 8.2148584
18 RSQUARE DEC91 0.8008122

The plot of the forecast is shown in Output 12.3.3.

Output 12.3.3: Forecast of Petroleum and Related Products
forex03c.gif (5762 bytes)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.