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
Stata - reproducible research (in 2021)Stata's update to 17 is impressive and tempting (not least because of increased speed and improved i…
Percentile Calculation Panel DataHi I have a panel data set from 1987Q1 to 2016Q4. I want to assign each observation using deciles. B…
Finite Population specification for multi-level cross-classified models with repeated measuresHi all, I'm working with a three-level cross-classified model with repeated measures (i.e. multiple…
Error r(3900) while running Latent Class AnalysisHello STATALIST group Can anyone tell me why I am getting the following error while running Latent…
xtdcce2 and xtmg commandsDear all I want to test the relationship between my 3 dependent variables and 8 independent variabl…
Subscribe to:
Post Comments (Atom)
0 Response to Idiosyncratic Volatility - Rolling Window
Post a Comment