Hi, I am working on my thesis and I want to calculate the idiosyncratic volatility which is de standard deviation of the abnormal return. My data looks as follows. I have panel data with 600 companies and their daily abnormal stock return over a ten year period. I want to compute the standard deviation per company per day and used the following code:
However, I only get missing values for the IVOL (see picture) How can I solve this?
Code:
bysort id Date: egen IVOL = sd(Abnormalreturn) if !missing(Abnormalreturn)
Comment