Home › Forums › ASROL : Rolling Window and by-Group Descriptive Statistics › rolling command panel data › Reply To: rolling command panel data
Guest
July 21, 2020 at 1:39 pm
Post count: 118
The code is the same as used in my earlier reply. That calculates the moving average of the last 4 years. If you want to exclude the current year, then the code would be:
bysort id : asrol ebitda, gen(sd_ebitda) stat(sd) window(year 5) min(4) xf(focal)