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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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