Hello,
I have a sample consisting of daily stock returns from CRSP database ranging from 3 January 2007 to 31 december 2016.
I have calculated the daily stock returns per firm with these codes:
Code:
bysort permno ( date ): gen ret = prc - prc[_n-1]
Code:
bysort permno ( date ): gen Stock_returns = ret/ prc[_n-1]
I have a formula which calculates the volatility of stock returns per permno over the entire period:
Code:
bysort permno : egen sd_returns = sd( Stock_returns )
Does anybody have a suggestion how to manage this?
Thanks!
with regards,
Bart
Comment