Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: st: addition of variables in Stata 11


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: st: addition of variables in Stata 11
Date   Sun, 25 Oct 2009 19:54:24 +0100

<> 


Also note that -rsum()- was renamed -rowtotal()- from Stata 8 to 9, although -rsum()- does still work in Stata 11... See -help whatsnew8to9 -



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von John Ataguba
Gesendet: Sonntag, 25. Oktober 2009 19:49
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: addition of variables in Stata 11

Hi Ekaterina,

I suppose these are variables created in rows.  You can try:

egen newvar = rsum(citotal*)

Note that you can also combine this with the by option if you want to restrict to a certain group or so...

I hope it helps.

 Jon 

________________________________
From: Ekaterina Hertog <ekaterina.hertog@sociology.ox.ac.uk>
To: "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Sent: Sunday, 25 October, 2009 20:29:23
Subject: st: addition of variables in Stata 11

Dear all,

I have a set of variables which denote population by age group in a
location a given individual lives in my dataset and I want to add them
up to total population in a location where each individual lives.
The names of the variables I have look as follows:
citotal1519 (meaning total population of 15 to 19 year olds in the city)
citotal2024 (meaning total population of 20 to 24 year olds in the city)
citotal2529 (meaning total population of 25 to 29 year olds in the city)
…
citotal7074 (meaning total population of 70 to 74 year olds in the city)

I was wondering if it might be possible to somehow ask Stata to add all
the variables which start with citotal?
I will be very grateful for any advice,
Warm regards,
Ekaterina

*
*   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/



      

*
*   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/


*
*   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/



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