New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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