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

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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