BookmarkSubscribeRSS Feed
stealth4933
Calcite | Level 5

I am a very new user of SAS and am not comfortable with almost any aspect of it. I usually use Rstudio(and thus think in terms of that coding language), but have found myself in a situation where I have to use SAS. What I want to do is pretty straightforward, but I do not even know how to go about looking up how to do it(although I have spent awhile trying).

 

I have a string of dates and 300 numbers. What I want to do is run an ARIMA(12,0,0) model(AR(12) model) in sas for every 60 observations, and then spit out the predicted variable in a new column lining up with the 61st row. In other words, say that column 2 was log differences in CPI, and column 1 was the date. I want the first 60 observations in the new column 3 to be blank, and then the 61st observation to be the ARIMA(12,0,0) projection using observations 49 to 60, where the coefficients of the model are estimated using observations 1 to 60. 

 

The 62nd observation is analogous, it is the projection using observations 50 to 61, coefficients estimated using data 2 to 61. I have found the proc arima command online, but I cannot find a way to forecast in sample, only to forecast out of sample(uses the data in the entire dataset and then projects into the future). This is such a standard process(I think) that there must be some simple source I can look up online to tell me how to do this. I was wondering if anyone can provide a link?

1 REPLY 1
PaigeMiller
Diamond | Level 26

I think this would require a macro to loop through all of the dates and run PROC ARIMA on each group of 60 observations and do the predictions.

 

As I have never seen an ARIMA(12,0,0) model, I wonder if somehow you can get PROC EXPAND to do the calculations without using a macro to do all the looping, but that would require some math to be performed to see if the model is even possible to compute in PROC EXPAND.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 637 views
  • 0 likes
  • 2 in conversation