BookmarkSubscribeRSS Feed
Anil_K
Calcite | Level 5
Hi,
If i an forecasting in SAS HPF,for the following form of data
monyy demand
jan01 12
mar01 17
jun02 19

then is it necessary to make it contninous ie jan01,feb01,........,and replace missing values with zero or we put as it is and forecast.
3 REPLIES 3
udo_sas
SAS Employee
Hello -
You might want to consider to either pre-process your data using PROC TIMESERIES or to use the "accumulate" and "setmissing" options in the HPF procedures.

Example:
data test;
input date date7. demand;
format date date7.;
cards;
01JAN09 10
01FEB09 12
01APR09 12
01MAY09 10
;
run;
proc timeseries data=test out=series;
id date interval=month accumulate=total setmissing=0;
var demand;
run;

or when using PROC HPF for example:
proc hpf data=test ...;
id date interval=month accumulate=total setmissing=0;
...
run;

Regards,
Udo
Anil_K
Calcite | Level 5
Hi,
thanks for ur reply but my question is little bit different.

Suppose when using PROC HPF :
proc hpf data=test ...;
id date interval=month accumulate=total setmissing= ;
...
run;
then it also provide the result.So my question is:
1. is it necessary to set missing zero?
2.if we set missing as blank then it provide the different answer as compared to set missing as zero.
udo_sas
SAS Employee
Hello,
Please excuse for missing the point. You will find lots of information about how missing values are treated in Online Help. I'm copying some relevant sections for your convenience.
Thanks,
Udo

> 1. is it necessary to set missing zero?
From Online Help: "Sometimes missing values should be interpreted as unknown values. The forecasting models used by the HPF procedure can effectively handle missing values. But sometimes missing values are known (such as when missing values are created from accumulation), and no observations should be interpreted as no (zero) value. In the former case, the SETMISSING= option can be used to interpret how missing values are treated. The SETMISSING=0 option should be used when missing observations are to be treated as no (zero) values. In other cases, missing values should be interpreted as global values, such as minimum or maximum values of the accumulated series. The accumulated and interpreted time series is used in subsequent analyses."

> 2.if we set missing as blank then it provide the different answer as compared to
> set missing as zero.
From Online Help: The treatment of missing values varies with the forecasting model. For the smoothing models, missing values after the start of the series are replaced with one-step-ahead predicted values, and the predicted values are applied to the smoothing equations.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1133 views
  • 0 likes
  • 2 in conversation