Hello everyone:
I am calculating the estimate of stock volatility, which use annualized standard deviation of stock returns estimated over the 60 months prior to the beginning of the fiscal period.
So I download the monthly data from CRSP.
And I run the code below:
rangestat (sd) ret, interval(date -60 0) by(cusip) But however the results I got is not what I want, I want at least 60 months to run the standard deviation, but however this code run sd even when you only have two month data. So is there anyway to strict the command that the loop have to be 60 months? Thank you very much. Lucas
Related Posts with Obtaining 5 year rolling standard deviation of RET
combining several observationsHi I have done a quantitative content analysis on a number of articles and have coded them binary o…
Creating new outcome variable - invalid syntax r(198) problemI have twelve disease variables in my dataset. I want to to create an outcome variable "multimorbidi…
stata levelsofGood afternoon, I'm working on my master thesis in Statistics at University of Bologna and I have a …
Loop for moving rangeGoodafternoon, I have a file which includes a significant amount of cusips (S&P1500) and dates …
Confusing behavior by ustrregexs()I'm trying to use ustrregexs to extract substrings from a string. With the data below: Code: clear…
Subscribe to:
Post Comments (Atom)
0 Response to Obtaining 5 year rolling standard deviation of RET
Post a Comment