Hi
I am not sure how to calculate weighted average means in a rolling fashion.
I can only calculate equally weighted means in a rolling fashion (for 12 weeks within the quarter) using -asrol- as follows:
I think -rangestat- can also do the same thing as follows
However, both of them do not seem to be able to calculate weighted average means, say using weights= assets (which is total assets).
Can anyone help with this, please?
Thanks
I am not sure how to calculate weighted average means in a rolling fashion.
I can only calculate equally weighted means in a rolling fashion (for 12 weeks within the quarter) using -asrol- as follows:
Code:
bys quarter_date : asrol var1, window(weeks 12) stat(mean)
Code:
rangestat (mean) var1, interval(week . 0) by(quarter_date ) casewise
Can anyone help with this, please?
Thanks
Comment