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

Hi Forum,

I have a variable named "ninety" in the attahced file. I need to forecast its values for maximum possible length ahead

as dictated by my 24 month's actual observations.

I have tried various methods such as moving average (3point, 12point), weighted moving average, exponential smoothing etc. but the Percent Absolue Deviation between predicted and actual values are way too high.

So, I tried ARIMA as the last resort.

 

Honestly I do not have any previous ARIMA expereince, so I have followed the SAS documentation mecahnically and followed the steps.

Question: I cannot run the last two steps to get the final forecasts. Could someone please help?

Thanks, Mirisage

/*taking the graph*/

ods graphics on;

proc sgplot data=test;

   scatter y=ninety x=current_date;

run;

/*Analyzing correlation properties*/

proc arima data=test ;

   identify var=ninety nlag=6;

run;

/*White Noise Test*/

proc arima data=test ;

   identify var=ninety nlag=6;

run;

proc arima data=test ;

   identify var=ninety nlag=5;

run;

proc arima data=test ;

   identify var=ninety nlag=4;

run;

proc arima data=test ;

   identify var=ninety nlag=3;

run;

/*Since the series is nonstationary, I transformed it to a stationary series by differencing.*/

/*Identification of the Differenced Series*/

proc arima data=test;

   identify var=ninety(1);

run;

/*The autocorrelations decrease rapidly in this plot, indicating that the

change in ninety is a stationary time series. */

/*not running*/

proc arima data=test;

estimate p=1;

   run;

/*Not running*/

   /*forecasting*/

proc arima data=test;

   forecast lead=12 interval=month id=date out=results;

   run;

1 ACCEPTED SOLUTION

Accepted Solutions
udo_sas
SAS Employee

Update: just noticed that my ARIMA code got truncated unfortunately - corrected it now.

Hello -

You might want to combine your last 3 PROC ARIMA calls into 1 call (and provide the correct name of your ID variable in the forecast statement):

proc arima data=test;

identify var=ninety(1);

estimate p=1;

forecast lead=12 interval=month id=current_date out=results;

run;

Since you have access to SAS/ETS it seems Smiley Happy you could also feed your series to the Time Series Forecasting System:

Start SAS on your machine and take advantage of the automatic model selection.

Screenshot.PNG

Documentation about TSFS can be found here:

http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#tfintro_toc.htm

BTW: your series seems to feature a level shift after Nov2010 - if you can explain why this might be good modeling information:

SeriesPlot1.png

CyclePlot1.png

To replicate the graphics above use the following code (you might want to experiment with the plot features of this ETS procedure as well):

proc timeseries data=test out=_null_ plot=(series cycles);

id current_date interval=month;

var ninety;

run;

Thanks,

Udo

View solution in original post

3 REPLIES 3
Mirisage
Obsidian | Level 7

Hi Udo,

If you have time, could you please have a look on this ARIMA query. I really apprecaite.

Thank you

Mirisage


udo_sas
SAS Employee

Update: just noticed that my ARIMA code got truncated unfortunately - corrected it now.

Hello -

You might want to combine your last 3 PROC ARIMA calls into 1 call (and provide the correct name of your ID variable in the forecast statement):

proc arima data=test;

identify var=ninety(1);

estimate p=1;

forecast lead=12 interval=month id=current_date out=results;

run;

Since you have access to SAS/ETS it seems Smiley Happy you could also feed your series to the Time Series Forecasting System:

Start SAS on your machine and take advantage of the automatic model selection.

Screenshot.PNG

Documentation about TSFS can be found here:

http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#tfintro_toc.htm

BTW: your series seems to feature a level shift after Nov2010 - if you can explain why this might be good modeling information:

SeriesPlot1.png

CyclePlot1.png

To replicate the graphics above use the following code (you might want to experiment with the plot features of this ETS procedure as well):

proc timeseries data=test out=_null_ plot=(series cycles);

id current_date interval=month;

var ninety;

run;

Thanks,

Udo

Mirisage
Obsidian | Level 7

Hi Udo,

Thank you very much for your great help.

Your help is very valuable for us.

Best regards

Mirisage


sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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