I want to multiply observations within a variable in stata. Here's how my data looks like: ID Return 1 1.1 1 1.01 1 0.99 2 0.99 2 0.87 2 1.1 2 1.004 2 1.202 3 1.02 3 1.09 3 0.98 3 0.98 ..... ............ For each ID, I would like to multiply all the numbers under the column "return" for that ID together. At the end of the program, I would like to output a column with the product for each ID. Since each of my IDs contain a different number of observations (or returns), I'mwondering if there's a command that can do that in Stata? Kind regards, Lan
-
Login or Register
- Log in with
Comment