Goodafternoon,
I have a file which includes a significant amount of cusips (S&P1500) and dates (2010-2020).
For those cusips I determined the market cap per month. Based on that I was able to determine the delta of market cap.
However, I am not able to find a solution to do a loop for the variance of the change in market cap. The variance of the change (delta) in market cap is calculated based on the preceding 60 months.
So for instance, when I want to determine the variance of change in market cap in januari 2016, I use the variance over the period jan 2011 - dec 2015. For februari 2016 I would like to use the variance of change in market cap over the period feb 2011- jan 2016 etc (so the range is always 60). Hope that my question is clear.
Thank you in advance.
Brgds,
James
Related Posts with Loop for moving range
Cleaning dataHello everyone, I am currently working on cleaning the data that I will be using for my master's th…
Multi-Wave Regression QuestionHi everyone! I want to ask a question about modeling a multi-wave data structure. Suppose that you …
Calculating Systematic Coronary Risk Evaluation in stataHello, I am calculating the Systematic Coronary Risk Evaluation in Stata, described in this article…
Numbers as strings in local macroHow to store in local macro a list of fractions. For example: Code: local ratios ""1487/1141" "791/…
Trouble shooting for-- Foreach macro with bysort command: help!Hello I'm using stata 15. I have a list of categorical variables for which I'd like to obtain info …
Subscribe to:
Post Comments (Atom)
0 Response to Loop for moving range
Post a Comment