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 2025: Call for Content

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!

Submit your idea!

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