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: generating cumulative sequence
From
"Ivica Rubil" <[email protected]>
To
<[email protected]>
Subject
st: generating cumulative sequence
Date
Wed, 21 Mar 2012 09:46:48 +0100
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
[email protected] || 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/