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
Merge (m:1) and data orderingHi all, please consider the following data example: Code: /*clear . input str6 id byte str4 loc …
Create a variable with an increasing value for different groupsDear all, I am using Stata version 14.2. I have a data set with groups of products and dates of we…
How to edit or delete a "signature" that is auto-added to one's post?Many years ago I created a signature (e.g., name & a quotation) that was automatically added to …
Use Stata program with same name in different directoriesHi, I have a user-written program saved twice in my computer: once inside my system directory's usua…
Interpreting Panel data coefficient estimates where the variable doesnt change across observationsHi, I am looking at the effect of different variables on the recycling rate in England. I have 311 …
Subscribe to:
Post Comments (Atom)
0 Response to Obtaining 5 year rolling standard deviation of RET
Post a Comment