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

Hello,

In order for the SAS ETS procedures to work there should be a date variable in the data set. This variable must be equally spaced. If there are missing values we should place the ".". If there are non working days e.g. weekends then we should not include any dates that correspond to weekends. So, for example, if 4th of May is Saturday and the weeends are non working days then date variable should be like this:
May, 3
May, 6
.
May, 10
May, 13

What if we have a working day e.g. Wednsesday that was a public holiday. We must include this date, otherwise the date would not be equally spaced. What value should we put for our variable of interest corresponding to this date? Is it goint to be the regular missing value "." or something else to declare that this was a working day but exceptionally it is non working day because of the public holiday?


Thanks in advance,


Andreas

1 ACCEPTED SOLUTION

Accepted Solutions
udo_sas
SAS Employee

Hello Andreas -

In my opinion it depends on the business problem you have at hand. If there is no record in your time series data due to a public holiday the question becomes: was that to be expected?

For example, if in a retail context stores are closed due to a public holiday I would replace these missing values with 0 - as in "no sales". In an energy demand forecasting context a missing value on a public holiday seems to indicate that there was a problem capturing the true demand, so 0 might not be appropriate and maybe replacing the missing value with a mean, median, etc., is the better strategy. In general it might be worthwhile to flag these replacements with a dummy variable (or an event), as it might become useful for modeling purposes later on - for example if the same holiday occurs again in the future you might want to tell your model about it so it can react appropriately.

As you may know, SAS High-Performance Forecasting features a procedure called HPFEVENTS which makes it very convenient to deal with these kinds of events. This procedure can also be accessed via SAS Forecast Studio.

In additon, as you have pointed out already, if missing values are reoccurring regularly due to no sales on weekends for example, you can tell the SAS procedures about it by using the appropriate date format - such as WEEKDAY for example. In this case there is no need need to fill gaps in your time series at all.

Hope that helps,

Udo

View solution in original post

2 REPLIES 2
udo_sas
SAS Employee

Hello Andreas -

In my opinion it depends on the business problem you have at hand. If there is no record in your time series data due to a public holiday the question becomes: was that to be expected?

For example, if in a retail context stores are closed due to a public holiday I would replace these missing values with 0 - as in "no sales". In an energy demand forecasting context a missing value on a public holiday seems to indicate that there was a problem capturing the true demand, so 0 might not be appropriate and maybe replacing the missing value with a mean, median, etc., is the better strategy. In general it might be worthwhile to flag these replacements with a dummy variable (or an event), as it might become useful for modeling purposes later on - for example if the same holiday occurs again in the future you might want to tell your model about it so it can react appropriately.

As you may know, SAS High-Performance Forecasting features a procedure called HPFEVENTS which makes it very convenient to deal with these kinds of events. This procedure can also be accessed via SAS Forecast Studio.

In additon, as you have pointed out already, if missing values are reoccurring regularly due to no sales on weekends for example, you can tell the SAS procedures about it by using the appropriate date format - such as WEEKDAY for example. In this case there is no need need to fill gaps in your time series at all.

Hope that helps,

Udo

Howles
Quartz | Level 8

To take it a step further, one can create a custom interval to reflect the holiday pattern. See

http://www.sascommunity.org/wiki/Generating_Holiday_Lists#Custom_Intervals

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
  • 2 replies
  • 1352 views
  • 3 likes
  • 3 in conversation