Good day all,
I have a dataset consisting of monthly prices per id. I need to calculate the standard deviation of prices over 60 months prior to the end of year t-1.
I tried the below but it is not working for me.
Does anyone know how I can best do this in Stata?
I have a dataset consisting of monthly prices per id. I need to calculate the standard deviation of prices over 60 months prior to the end of year t-1.
I tried the below but it is not working for me.
Does anyone know how I can best do this in Stata?
Code:
by id egen sdprice=sd(L72.price+L71.price+... ...+L13.price+L12.price)
Comment