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
Using loops to generate dummy for placebo regressionsHi In my dataset I have yearly variable, from 1995 to 2006 and a treatment happening in year 2003. I…
What are the results of the Kolmogorov-Smirnov test in Stata?The following figure is the Kolmogorov-Smirnov test (KS test) I conducted in Stata using ksmirnov co…
What are the results of reldist in Stata?When relative distribution method is used to compare the distribution similarity of two samples, rel…
BSWEIGHTS without stratum in the dataI am wanting to use bsweights to resample the weights before a bootstrap a weighted regression. I do…
Help needed for using data frames to extract dataHi, I am using Stata 16 and would need help in the extraction of data. I intend to use data frames …
Subscribe to:
Post Comments (Atom)
0 Response to Idiosyncratic Volatility - Rolling Window
Post a Comment