It is bad, not good, Statalist psychology to
claim a "simple question". I know that some
gurus have a habit of immediately deleting emails
with similar preambles.
First, the question may seem simple to you,
but the answer may not be, so you gain nothing
by an appeal to your expectation that an expert
should be able to give an instant answer.
Second, if you think it's that simple,
what's stopping you from solving it?
What code did you try?
That said, I have no idea of what "rolling returns" are,
but I guess that no program is needed here.
-rolling- should yield (I), while a standard
-foreach- loop around variables should yield
your second (II).
Nick
[email protected]
kelly johnson
> Suppose I have data liek the following:
>
> Date=date
> A, B, C are closing prices for stocks A,B, and C respectively.
>
> How can I write a simple program to do the following:
>
> (I) calculate the 10 day rolling returns
> (II) caclulate a ratio=10day rollign returns/std. dev.
> (II) loop so as to repeat this caclulation across other
> variables (B,C, etc.)
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/