Hello everyone!
I am trying to compute idiosyncratic volatility on a rolling basis of 24 months with monthly data. I have created a month/year variable called ymdate.
This has been my code so far:
bys perm : asreg Excess_USD_w MKT SMB HML, wind(ymdate 24)
gen residuals = Excess_USD_w - _b_cons - _b_MKT*MKT - _b_SMB*SMB - _b_HML*HML
bys perm: egen IVOL=sd (residuals)
In the end, I want to look at each year. However, my min and max values are the same for multiple years, not just for two years as specified by my rolling window. In addition, my mean value just keep on increasing.
Would anyone know what I have done wrong? Thank you very much in advance!
Related Posts with Idiosyncratic Volatility - Rolling Window
Does anyone know how to convert different time zones by state into one time zone? City (Origin) State (Origin) City (Destination) State (Destination) Departure Time Arrival time …
Calculate annual changes via loopsGood morning I would like to report a series of annual variations using a loop. This is my initial s…
How to interpret Difference-in-Differences and Difference-in-Difference-in-Differences estimation based on indicator variables?Hi all, I am doing an empirical analysis with difference-in-differences (DD) together with differen…
Angle Distribution of Loading Subspaces in PCAAngle Distribution of Loading Subspaces in PCA Hi, Are there any codes in Stata to do Angle Distrib…
A doubt regarding duplicate identifier in a panel data setDear Members I have some doubts which I will illustrate with a sample dataset Code: * Example g…
Subscribe to:
Post Comments (Atom)
0 Response to Idiosyncratic Volatility - Rolling Window
Post a Comment