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
Using MarginsPlot to visualize Quadratics in Panel DataDear Statalist community, I need help with two things: One, I want to use the margins and marginsp…
Reshaping a both long and wide dataset into only long formHi. I have medical prescription data ranging from 2007-2012 in the format below. The two identifying…
search if a value is present in tableHello all, How can I search if a particular value is present in a table. if the value is present in…
Did I set up my panel data (with restrictions) correctly?Hi all, I would like to seek your advice regarding my analysis sample. Specifically, I have a three…
State by Year Fixed Effects and Annual State ControlsIn my econometric model the identifying variation is at the state, year, and factory level. When I i…
Subscribe to:
Post Comments (Atom)
0 Response to Obtaining 5 year rolling standard deviation of RET
Post a Comment