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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.