BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ali_hash
Calcite | Level 5

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.


Screen Shot 2015-03-05 at 11.51.56 PM.png

1 ACCEPTED SOLUTION

Accepted Solutions
udo_sas
SAS Employee

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

View solution in original post

1 REPLY 1
udo_sas
SAS Employee

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

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
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
  • 1 reply
  • 2344 views
  • 0 likes
  • 2 in conversation