I am trying to forecast a time series value for 2026. I have historical data from 1990 to 2016. I am using PROC AUTOREG. When I use the simple linear trend regression, I am able to get the forecast value, but when I use the logarithmic or polynomial model, the forecast values are missing.
* the linear regression is ok and I can see the 2026 value in the final table
PROC AUTOREG data=varfinal;
model Y = TIME / method=ml nlag=5 backstep;
output out=result1 predicted=Yhat pm=Ytrend lcl=Ylcl ucl=Yucl;
RUN;
The following 2, shows missing values after 2016 Yhat, Ytrendm, Ylcl and Yucl
/**** Logarithmic ****/
PROC AUTOREG data=varfinal;
model Y = TIMELOG / method=ml nlag=5 backstep;
output out=result2 predicted=Yhat pm=Ytrend lcl=Ylcl ucl=Yucl;
RUN;
/*Polynomial */
PROC AUTOREG data=varfinal;
model WIAWW = TIME TIMESQ / method=ml nlag=5 backstep;
output out=result3 predicted=Yhat pm=Ytrend lcl=Ylcl ucl=Yucl;
RUN;
Note; TIMELOG= LOG(TIME) and TIMESQ: TIME*TIME
Any help on why I can't see the forecast values in the logarithmic and polynomial case would we useful
Thanks
Final Note: I found the solution myself. Instead of using DATE: 1990 TO 2016, I used DATE: 1 TO 37
The code it works is the original code I shared. I did not change anything
What do your actual "time" values look like? You say that you have data from 1990 to 2016 but is each record a single year? Date within the year? Datetime value from the year?
Also do you have any interesting notes in log?
I should delete the question because it is working now. Only thing I did is to change my variable Time: 1990 to 2026 to time=1 to 37 and I can see forecast values for 3 models.
@pilicasalv wrote:
I should delete the question because it is working now. Only thing I did is to change my variable Time: 1990 to 2026 to time=1 to 37 and I can see forecast values for 3 models.
Actually the appropriate approach is to show the code that worked, any change made to the data if any and mark that post as a solution. That way the solution is available to others and marking the question as solved helps others.
The code it works is the original code I shared. I did not change anything
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.