- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 11-20-2019 04:18 AM
(1698 views)
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you will try