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

Hi,

 

I am fairly new to SAS and trying to perform an hourly forecast using proc esm.

 

below is the code that I am using for this.

 

proc esm data=test111
out=forecasting  
lead=24
print=forecasts;
id Hours interval= hour;
forecast Sun / model=ADDWINTERS;
run;

 

However it give me the below error:

 

ERROR: Duplicate time interval found at observation number 2 in the data set WORK.TEST111, according to the INTERVAL=HOUR option
and the ID variable values. The current ID is Hours=1 and the previous is Hours=0, which are within the same HOUR interval.
Check that INTERVAL=HOUR is correct for this data set, and that the ID variable Hours contains SAS date or datetime values
that correctly identify the observations.
 
Please help.
 
Raw Data:
HoursSunMonTueWedThuFriSat
01914168195528
121141521191133
21013131417258
3261614182366
4816394328301
571362013157
692351718206
7722232516193
81626161018187
9933172621142
10843121522308
11101730148113
12132221243195
131320191020158
14282917112488
1524183640292510
16133628172077
178251223291214
18424132819129
19919182421523
20912141216165
217119812164
22111378143
233724816102
 
1 ACCEPTED SOLUTION

Accepted Solutions
alexchien
Pyrite | Level 9

the Hours column is not in the datetime format, and thus PROC ESM doesnt handle the ID variable properly. you can try the following to trick PROC ESM to do hourly forecast:

 

PROC ESM SEASONALITY = 24 data = ....;

   ID HOURS INTERVAL = DAY;

  ...

 

View solution in original post

2 REPLIES 2
alexchien
Pyrite | Level 9

the Hours column is not in the datetime format, and thus PROC ESM doesnt handle the ID variable properly. you can try the following to trick PROC ESM to do hourly forecast:

 

PROC ESM SEASONALITY = 24 data = ....;

   ID HOURS INTERVAL = DAY;

  ...

 

badriprath
Calcite | Level 5
Thank you for the prompt response. It works perfectly. 🙂

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
  • 2 replies
  • 1264 views
  • 1 like
  • 2 in conversation