The FORECAST Procedure

PROC FORECAST Statement

  • PROC FORECAST options;

The following options can be specified in the PROC FORECAST statement:

ALIGN=option

controls the alignment of SAS dates used to identify output observations. The ALIGN= option allows the following values: BEGINNING | BEG | B, MIDDLE | MID | M, and ENDING | END | E. BEGINNING is the default.

ALPHA=value

specifies the significance level to use in computing the confidence limits of the forecast. The value of the ALPHA= option must be between 0.01 and 0.99. You should use only two digits for the ALPHA= option because PROC FORECAST rounds the value to the nearest percent (ALPHA=0.101 is the same as ALPHA=0.10). The default is ALPHA=0.05, which produces 95% confidence limits.

AR=n

NLAGS=n

specifies the maximum order of the autoregressive model. The AR= option is valid only for METHOD=STEPAR. The default value of n depends on the INTERVAL= option and on the number of observations in the DATA= data set. See the section STEPAR Method for details.

ASTART=value

ASTART=( value …)

specifies starting values for the constant term for the exponential smoothing, Winters, and additive Winters methods. This option is ignored if METHOD=STEPAR. The values specified are associated with the variables in the VAR statement in the order in which the variables are listed. See the section Starting Values for EXPO, WINTERS, and ADDWINTERS Methods for details.

BSTART=value

BSTART=( value …)

specifies starting values for the linear trend for the exponential smoothing, Winters, and additive Winters methods. The values specified are associated with the variables in the VAR statement in the order in which the variables are listed. This option is ignored if METHOD=STEPAR or TREND=1. See the section Starting Values for EXPO, WINTERS, and ADDWINTERS Methods for details.

CSTART=value

CSTART=( value …)

specifies starting values for the quadratic trend for the exponential smoothing, Winters, and additive Winters methods. The values specified are associated with the variables in the VAR statement in the order in which the variables are listed. This option is ignored if METHOD=STEPAR or TREND=1 or 2. See the section Starting Values for EXPO, WINTERS, and ADDWINTERS Methods for details.

DATA=SAS-data-set

names the SAS data set that contains the input time series for the procedure to forecast. If the DATA= option is not specified, the most recently created SAS data set is used.

INTERVAL=interval

specifies the frequency of the input time series. For example, if the input data set consists of quarterly observations, then INTERVAL=QTR should be used. See Chapter 4: Date Intervals, Formats, and Functions, for more details about the intervals available.

INTPER=n

when the INTERVAL= option is not used, specifies an increment (other than 1) to use in generating the values of the ID variable for the forecast observations in the output data set.

LEAD=n

specifies the number of periods ahead to forecast. The default is LEAD=12.

The LEAD= value is relative to the last observation in the input data set and not to the end of a particular series. Thus, if a series has missing values at the end, the actual number of forecasts computed for that series will be greater than the LEAD= value.

MAXERRORS=n

limits the number of warning and error messages produced during the execution of the procedure to the specified value. The default is MAXERRORS=50.

This option is particularly useful in BY-group processing where it can be used to suppress the recurring messages.

METHOD=method-name

specifies the method to use to model the series and generate the forecasts.

METHOD=STEPAR

specifies the stepwise autoregressive method.

METHOD=EXPO

specifies the exponential smoothing method.

METHOD=WINTERS

specifies the Holt-Winters exponentially smoothed trend-seasonal method.

METHOD=ADDWINTERS

specifies the additive seasonal factors variant of the Winters method.

For more information, see the section Forecasting Methods. The default is METHOD=STEPAR.

NSTART=n

NSTART=MAX

specifies the number of beginning values of the series to use in calculating starting values for the trend parameters in the exponential smoothing, Winters, and additive Winters methods. This option is ignored if METHOD=STEPAR.

For METHOD=EXPO, n beginning values of the series are used in forming the exponentially smoothed values S1, S2, and S3, where n is the value of the NSTART= option. The parameters are initialized by fitting a time trend regression to the first n nonmissing values of the series.

For METHOD=WINTERS or METHOD=ADDWINTERS, n beginning complete seasonal cycles are used to compute starting values for the trend parameters. For example, for monthly data the seasonal cycle is one year, and NSTART=2 specifies that the first 24 observations at the beginning of each series are used for the time trend regression used to calculate starting values.

When NSTART=MAX is specified, all the observations are used. The default for METHOD=EXPO is NSTART=8; the default for METHOD=WINTERS or METHOD=ADDWINTERS is NSTART=2. See the section Starting Values for EXPO, WINTERS, and ADDWINTERS Methods for details.

NSSTART=n

NSSTART=MAX

specifies the number of beginning values of the series to use in calculating starting values for seasonal parameters for METHOD=WINTERS or METHOD=ADDWINTERS. The seasonal parameters are initialized by averaging over the first n values of the series for each season, where n is the value of the NSSTART= option. When NSSTART=MAX is specified, all the observations are used.

If NSTART= is specified, but NSSTART= is not, NSSTART= defaults to the value specified for NSTART=. If neither NSTART= nor NSSTART= is specified, then the default is NSSTART=2. This option is ignored if METHOD=STEPAR or METHOD=EXPO. See the section Starting Values for EXPO, WINTERS, and ADDWINTERS Methods for details.

OUT=SAS-data-set

names the output data set to contain the forecasts. If the OUT= option is not specified, the data set is named by using the DATAn convention. See the section OUTEST= Data Set for details.

OUTACTUAL

writes the actual values to the OUT= data set.

OUTALL

provides all the output control options (OUTLIMIT, OUT1STEP, OUTACTUAL, OUTRESID, and OUTSTD).

OUTEST=SAS-data-set

names an output data set to contain the parameter estimates and goodness-of-fit statistics. When the OUTEST= option is not specified, the parameters and goodness-of-fit statistics are not stored. See the section OUTEST= Data Set for details.

OUTESTALL

writes additional statistics to the OUTEST= data set. This option is the same as specifying both OUTESTTHEIL and OUTFITSTATS.

OUTESTTHEIL

writes Theil forecast accuracy statistics to the OUTEST= data set.

OUTFITSTATS

writes various R-square-type forecast accuracy statistics to the OUTEST= data set.

OUTFULL

provides OUTACTUAL, OUT1STEP, and OUTLIMIT output control options in addition to the forecast values.

OUTLIMIT

writes the forecast confidence limits to the OUT= data set.

OUTRESID

writes the residuals (when available) to the OUT= data set.

OUTSTD

writes the standard errors of the forecasts to the OUT= data set.

OUT1STEP

writes the one-step-ahead predicted values to the OUT= data set.

SEASONS=interval

SEASONS= ( interval1 [ interval2 [ interval3 ] ] )
SEASONS=n
SEASONS= ( n1 [ n2 [ n3 ] ] )

specifies the seasonality for seasonal models. The interval can be QTR, MONTH, DAY, or HOUR, or multiples of these (for example, QTR2, MONTH2, MONTH3, MONTH4, MONTH6, HOUR2, HOUR3, HOUR4, HOUR6, HOUR8, and HOUR12).

Alternatively, seasonality can be specified by giving the length of the seasonal cycles. For example, SEASONS=3 means that every group of three observations forms a seasonal cycle. The SEASONS= option is valid only for METHOD=WINTERS or METHOD=ADDWINTERS. See the section Specifying Seasonality for details.

SINGULAR=value

gives the criterion for judging singularity. The default depends on the precision of the computer that you run SAS programs on.

SINTPER=m

SINTPER= ( m1 [ m2 [ m3 ] ] )

specifies the number of periods to combine in forming a season. For example, SEASONS=3 SINTPER=2 specifies that each group of two observations forms a season and that the seasonal cycle repeats every six observations. The SINTPER= option is valid only when the SEASONS= option is used. See the section Specifying Seasonality for details.

SLENTRY=value

controls the significance levels for entry of autoregressive parameters in the STEPAR method. The value of the SLENTRY= option must be between 0 and 1. The default is SLENTRY=0.2. See the section STEPAR Method for details.

SLSTAY=value

controls the significance levels for removal of autoregressive parameters in the STEPAR method. The value of the SLSTAY= option must be between 0 and 1. The default is SLSTAY=0.05. See the section STEPAR Method for details.

START=n

uses the first n observations to fit the model and begins forecasting with the n +1 observation.

TREND=n

specifies the degree of the time trend model. The value of the TREND= option must be 1, 2, or 3. TREND=1 selects the constant trend model; TREND=2 selects the linear trend model; and TREND=3 selects the quadratic trend model. The default is TREND=2, except for METHOD=EXPO, for which the default is TREND=3.

WEIGHT=w

WEIGHT= ( w1 [ w2 [ w3 ] ] )

specifies the smoothing weights for the EXPO, WINTERS, and ADDWINTERS methods. For the EXPO method, only one weight can be specified. For the WINTERS or ADDWINTERS method, w1 gives the weight for updating the constant component, w2 gives the weight for updating the linear and quadratic trend components, and w3 gives the weight for updating the seasonal component. The w2 and w3 values are optional. Each value in the WEIGHT= option must be between 0 and 1. For default values, see the section EXPO Method and the section WINTERS Method.

ZEROMISS

treats zeros at the beginning of a series as missing values. For example, a product can be introduced at a date after the date of the first observation in the data set, and the sales variable for the product can be recorded as zero for the observations prior to the introduction date. The ZEROMISS option says to treat these initial zeros as missing values.