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

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

1 ACCEPTED SOLUTION

Accepted Solutions
pilicasalv
Fluorite | Level 6

The code it works is the original code I shared. I did not change anything

View solution in original post

4 REPLIES 4
ballardw
Super User

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?

pilicasalv
Fluorite | Level 6

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.

ballardw
Super User

@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.

pilicasalv
Fluorite | Level 6

The code it works is the original code I shared. I did not change anything

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1590 views
  • 0 likes
  • 2 in conversation