BookmarkSubscribeRSS Feed
Tzar
Fluorite | Level 6

Hi Everyone. I need your help please. I have a data set which was created using the stratified mean approach. it worked for a while but now, our data went south for 3 months. The suggestion was brought to rather calculate a rolling average for 3 months instead of using a month to month kind of approach but, I am not sure how to do this. I am happy to post the data set.

 

The data on its own is fine. The minute I calculate a growth year on year, things no longer make sense. It gets even worse when I calculate the average of the year on year growth rate.

 

 

I tried various approaches such as descriptive techniques but all failed.

 

 

Thanks in dvance

2 REPLIES 2
ed_sas_member
Meteorite | Level 14

 Hi @Tzar 

 

you can try this, using the lag function

 

data want;
   set have;
   roll_avg = mean(var1,lag(var1),lag2(var1); /*replace var1 by you variable name*/
run;
Tzar
Fluorite | Level 6
Thank you will try

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 2 replies
  • 1531 views
  • 0 likes
  • 2 in conversation