I am working on a forecasting project where I am calculating moving averages. I would like to calculate these monthly moving averages through July 2014 in SAS Enterprise Guide, however, the dates in my data set only go to July 2013 (because the historical data is only reported to the present date). I have done extensive manipulation of my data set and it is difficult for me to go back and add those dates to the end of the Excel file that I originally pulled the data from. Does anyone know of an easy way to add the dates to the end of my dataset and calculate the moving averages post-manipulation?
You can create the dates/data in a dataset and then append them, and then calculate your moving averages.
Does that make sense to you?
If so, provide a sample of what your data looks like, what you expect as output and someone can help with the coding or instructions on how to use EG to get it done.
If your dataset is ordered ... would the lag funtion be helpful?
See: SAS(R) 9.4 Functions and CALL Routines: Reference (lag samples - several: calculation moving average)
I don't think so. Basically I just want to tack on 12 months to the end of my time series. I know how to calculate the moving averages. The problem is just that when my dates end, so does my dataset and the moving averages stop calculating. I am looking for an easy way to extend my dates into 2014 so that I can get the moving averages for those months as well.
You can create the dates/data in a dataset and then append them, and then calculate your moving averages.
Does that make sense to you?
If so, provide a sample of what your data looks like, what you expect as output and someone can help with the coding or instructions on how to use EG to get it done.
The append is what I needed. Thank you, Reeza.
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.