BookmarkSubscribeRSS Feed
Majid2023
Calcite | Level 5

Hi all,

I have a sample of 260 observations (52 weeks of sales for 5 items within two categories)

I would like to forecast weekly sales for each item for the next 4-6 week or forecast on weekly bases.

How can I perform this task. 

Any help will be greatly appreciated.

 

Majid2023_0-1690202822602.png

 

 

5 REPLIES 5
JosvanderVelden
SAS Super FREQ
What SAS software product do you have available to perform the task?
Majid2023
Calcite | Level 5

SAS EG

sbxkoenk
SAS Super FREQ

Hello @Majid2023 ,

 

SAS EG (SAS Enterprise Guide) is not a SAS module. It's just an interface that helps you performing tasks (and flows of tasks). You can probably launch the EG-app without having SAS installed, but that will be useless as nothing will work!

 

I am no longer working in SAS EG (working in SAS Viya now) , ... so cannot visualize anything myself right now ... , but I know SAS EG has a "Regression for Time Series Analysis" or "Time Series Regression" node. You need SAS/ETS (Econometrics and Time Series) module though, otherwise these "time series analysis" - nodes will not work.

 

Good luck,

Koen

sbxkoenk
SAS Super FREQ

Hello,

 

What SAS software do you have?

  • SAS 9.4 M(x) or SAS Viya 3.5 or SAS Viya 4?
  • Forecast Server / SAS HPF (High-Performance Forecasting) / SAS ETS / SAS Econometrics / SAS Visual Forecasting?

Best would be to do hierarchical forecasting as your items are nested within categories.
You can win some accuracy by doing proper hierarchical reconciliation.

 

You can also treat all item time series as independent from each other.

This is for sure not the best option, but it's simple!
You can start with Exponential Smoothing Methods (ESM).
Time Series Regression methods (or Machine Learning methods like Long Short-Term Memory (LSTM) networks or other Recurrent Neural Network (RNN) architectures) are certainly better, but it will take you more time. ESM cannot deal with regressors (influential time series that may help to forecast your target time series more accurately), but I cannot see these X-series in your example.

 

Hence, try something like this :

proc esm data=sales out=nextweeks;
   by category item;
   id date interval=week;
   forecast _numeric_;
run;

BR,

Koen

sbxkoenk
SAS Super FREQ

Hello @Majid2023 ,

 

I remember now you have posted in Programming board before (same question).

Regression on multiple items in different categories
(Home >> Programming >> Programming)
https://communities.sas.com/t5/SAS-Programming/Regression-on-multiple-items-in-different-categories/...

 

You wanted to solve this with classical regression, but that was rightfully advised against by @PaigeMiller .

 

If you want to stay close to PROC REG
, you might try PROC AUTOREG (regression that takes AUTO-CORRELATION into account):

proc autoreg data=sales;
    by category item;
    model y = t / nlag=2 method=ml;
run;

BR,

Koen

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Discussion stats
  • 5 replies
  • 2283 views
  • 3 likes
  • 3 in conversation