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

st: Question about cummulative summatories


From   Sirenia Vazquez <sirenia.vazquez@cide.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Question about cummulative summatories
Date   Tue, 29 Jul 2003 12:54:58 -0600

I have a variable x with 10 observations x =(x1, x2,...,x10), and I want to 
create a new variable y = (y1, y1,....y10) in which y1=x1, but that y2= x1+x2; 
y3=x1+x2+x3; and so on, until y10= x1+x2+...+x10. 
Is there any command in Stata that does that?

>===== Original Message From statalist@hsphsun2.harvard.edu =====
>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:sirenia.vazquez@cide.edu]
>Sent: Tuesday, July 29, 2003 2:26 PM
>To: statalist@hsphsun2.harvard.edu
>Subject: st: Question about cummulative summatories
>
>
>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
>
>*
>*   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/
>*
>*   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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index