Chapter Contents Previous Next
 The FORECAST Procedure

## Example 12.2: Forecasting Retail Sales

This example uses the stepwise autoregressive method to forecast the monthly U.S. sales of durable goods (DURABLES) and nondurable goods (NONDUR) from the SASHELP.USECON data set. The data are from Business Statistics published by the U.S. Bureau of Economic Analysis. The following statements plot the series:

```
symbol1 i=spline v=dot;
proc gplot data=sashelp.usecon;
plot ( durables nondur ) * date = 1 /
haxis= '1jan80'd to '1jan92'd by year;
where date >= '1jan80'd;
format date year4.;
run;
```

The plots are shown in Output 12.2.1 and Output 12.2.2.

Output 12.2.1: Durable Goods Sales

Output 12.2.2: Nondurable Goods Sales

The following statements produce the forecast:

```
title1 "Forecasting Sales of Durable and Nondurable Goods";

proc forecast data=sashelp.usecon interval=month
out=out outfull outest=est;
id date;
var durables nondur;
where date >= '1jan80'd;
run;
```

The following statements print the OUTEST= data set.

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

The PROC PRINT listing of the OUTEST= data set is shown in Output 12.2.3.

Output 12.2.3: The OUTEST= Data Set Produced by PROC FORECAST

 Forecasting Sales of Durable and Nondurable Goods OUTEST= Data Set: STEPAR Method

 Obs _TYPE_ DATE DURABLES NONDUR 1 N DEC91 144 144 2 NRESID DEC91 144 144 3 DF DEC91 137 139 4 SIGMA DEC91 4519.451 2452.2642 5 CONSTANT DEC91 71884.597 73190.812 6 LINEAR DEC91 400.90106 308.5115 7 AR01 DEC91 0.5844515 0.8243265 8 AR02 DEC91 . . 9 AR03 DEC91 . . 10 AR04 DEC91 . . 11 AR05 DEC91 . . 12 AR06 DEC91 0.2097977 . 13 AR07 DEC91 . . 14 AR08 DEC91 . . 15 AR09 DEC91 . . 16 AR10 DEC91 -0.119425 . 17 AR11 DEC91 . . 18 AR12 DEC91 0.6138699 0.8050854 19 AR13 DEC91 -0.556707 -0.741854 20 SST DEC91 4.923E10 2.8331E10 21 SSE DEC91 1.88157E9 544657337 22 MSE DEC91 13734093 3918398.1 23 RMSE DEC91 3705.9538 1979.4944 24 MAPE DEC91 2.9252601 1.6555935 25 MPE DEC91 -0.253607 -0.085357 26 MAE DEC91 2866.675 1532.8453 27 ME DEC91 -67.87407 -29.63026 28 RSQUARE DEC91 0.9617803 0.9807752

The following statements plot the forecasts and confidence limits. The last two years of historical data are included in the plots to provide context for the forecast. A reference line is drawn at the start of the forecast period.

```
title1 'Plot of Forecasts from STEPAR Method';

symbol1 i=none   v=star h=2; /* for _type_=ACTUAL */
symbol2 i=spline v=circle h=2; /* for _type_=FORECAST */
symbol3 i=spline l=3;        /* for _type_=L95 */
symbol4 i=spline l=3;        /* for _type_=U95 */

proc gplot data=out;
plot ( durables nondur ) * date = _type_ /
HREF='15dec91'd
haxis= '1jan90'd to '1jan93'd by qtr;
where date >= '1jan90'd;
run;
```

The plots are shown in Output 12.2.4 and Output 12.2.5.

Output 12.2.4: Forecast of Durable Goods Sales

Output 12.2.5: Forecast of Nondurable Goods Sales

 Chapter Contents Previous Next Top