Hello. I have data from 1999q1 to 2019q2 for 6 different regions (string variable). Each observation is a share (between 0, 1). I would like to generate an other variable with the moving averages of the sare for each region using the two previous observations, the current observation and the next two.
This is an example of my data:
Thank you for helping!!!!!
This is an example of my data:
region | date | share |
europe | 1999q1 | 0.243124324 |
us | 1999q1 | 0.3565476546 |
asia | 1999q1 | 0.9435435 |
australia | 1999q1 | 0.234234324 |
africa | 1999q1 | 0.567567657 |
Comment