Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Taking products in loops


From   "Sandy Y. Zhu" <[email protected]>
To   [email protected]
Subject   st: Taking products in loops
Date   Mon, 26 Mar 2012 18:44:34 -0400

Hi everyone:

I was just wondering if you would know how to take products in Stata.

Here's how my data looks like:

Event            Return
1                    1.1
1                    1.01
1                    0.99
1                    1.23
1                    1.1
1                    1.34
1                    0.88
2                    0.99
2                    0.87
2                    1.1
2                    1.004
3                    1.02
3                    1.09
3                    0.98
3                    0.98
3                    1.09
3                    1.09
.....                    ............

For each event, I would like to multiply all the numbers under the
column "return" for that event together. At the end of the program, I
would like to output a column with all the "cumulative returns" for
each event. Since each of my events containa  different number of
observations (or returns), I'm wondering if there's a command that can
do that in Stata?

Thank you so much!



-- 
Yours sincerely,

Sandy Y. Zhu
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index