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