[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Calculating a (changing) accumulative sum
I have 20 "period"s (i.e., 20 rows) of data for each "subject" i. For
each subject i, I would like stata to calculate the accumulative sum of
the variable "con" in a new variable "accumcon" in the following way:
In period 1: accumcon = con[1]. In period 2: accumcon = con[1]+con[2]
In period 3: accumcon = con[1]+con[2]+con[3] and so on, for each
subject, from period 1 until period 20.
Thank you for your help.
--
Dr. Özgür Gürerk
Lehrstuhl für Mikroökonomie & Laboratorium für experimentelle Wirtschaftsforschung
(Microeconomics & Laboratory for Experimental Economics)
Universität Erfurt, Nordhäuser Str. 63, D-99089 Erfurt
Tel: +49 361 7374561
Fax: +49 361 7374569
www.uni-erfurt.de/elab
--
*
* 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/