Hi guys. Doing some proc forecast work but running into some trouble. Here is my code. A snapshot of what my data looks like is also below. I would greatly appreciate the help!
PROC FORECAST data=sasuser.nader_excel method=exp interval=year lead=12
out=foreexsm outactual out1step;
VAR aus;
ID date;
RUN;
But I have spent hours trying to get around this error and nothing. I ran into one forum post on this issue and it not get resolved.
errERROR: Duplicate time interval found at observation number 2 according to the INTERVAL=YEAR
option and the ID variable values. The current ID is DATE=02AUG1926 and the previous is
DATE=31JUL1926, which are within the same YEAR interval.
Hello -
Your data is on daily frequency, but you are asking PROC FORECAST to generate a forecast on yearly frequency. This is why the procedure is complaining.
To address the situation you will need to accumulate your data first.
Alternatively you may want to consider PROC ESM, which allows you to deal with this challenge in one step.
Example (going from monthly to yearly by adding up values - syntax for going from daily to yearly does not change):
proc esm data=sashelp.air out=_null_ outfor=outfor plot=forecasts lead=3;
id date interval=year accumulate=total;
forecast air /method=linear;
run;
Note that you will need to decide which ESM technique to use - in the example above method=linear seems to make sense.
Thanks,
Udo
Hello -
Your data is on daily frequency, but you are asking PROC FORECAST to generate a forecast on yearly frequency. This is why the procedure is complaining.
To address the situation you will need to accumulate your data first.
Alternatively you may want to consider PROC ESM, which allows you to deal with this challenge in one step.
Example (going from monthly to yearly by adding up values - syntax for going from daily to yearly does not change):
proc esm data=sashelp.air out=_null_ outfor=outfor plot=forecasts lead=3;
id date interval=year accumulate=total;
forecast air /method=linear;
run;
Note that you will need to decide which ESM technique to use - in the example above method=linear seems to make sense.
Thanks,
Udo
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.