Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Question about cummulative summatories


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: RE: Question about cummulative summatories
Date   Tue, 29 Jul 2003 14:02:44 -0400

In response to Sirenia Vazquez's question about cumulative sum, and the reply that Gabi Huiber provided, I would like to add...

egen y=sum(x)

will give the overall sum (a constant), whereas,

gen y=sum(x)

will give the cumulative sum.

Either can be combined with -by- to partition the data into subsets.

--David

At 01:41 PM 7/29/2003 -0400, you wrote:

if you have a variable x, and want another variable y=sum(x), then Stata 7's

egen y=sum(x)

will do it.

Gabi

-----Original Message-----
From: Sirenia Vazquez [mailto:[email protected]]
Sent: Tuesday, July 29, 2003 2:26 PM
[...]
There is a command in the spss program in which you can generate a new
variable that is the cumulative summatory of the original variable (namely
csum). I would like to know if there is a similar command or funcion in
Stata,
or if there is any other way I could create that new variable.
Thank you.
Sirenia Vazquez
David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index