Hi,
I would like to create a 5 period (years in the example) rolling average of each of the coefficients "_b_mvalue _b_kstock". In the real dataset, I have ~100 variables instead of 2. Here is what I have so far, the last line is not correct:
How can I implement that?
I would like to create a 5 period (years in the example) rolling average of each of the coefficients "_b_mvalue _b_kstock". In the real dataset, I have ~100 variables instead of 2. Here is what I have so far, the last line is not correct:
Code:
webuse grunfeld, clear xtset company year statsby _b, by(year) saving(test_RPS, replace): regress invest mvalue kstock use test_RPS.dta, clear egen avg_mvalue = mean(_b_mvalue)
Comment