Dear Stata users,
How can I generate Var2 (see below), i.e. the cumulative sequence based
on Var1? It seems an egen function can do the job, but which one? Or
there's another solution? Thanks in advance.
Var1 Var2
-----------------------
1 1
5 1+5 = 6
6 1+5+6 = 12
8 1+5+6+8 = 20
12 1+5+6+8+12 = 32
--
Ivica Rubil
Ekonomski institut || The Institute of Economics, Zagreb
Trg J. F. Kennedyja 7, 10 000 Zagreb, Croatia
tel. +385-1-2362-269 || fax. +385-1-2335-165
irubil@eizg.hr || www.eizg.hr
*
* 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/