Statalist


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

st: AW: generating count and sum variable over two different categorical variables


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: generating count and sum variable over two different categorical variables
Date   Mon, 11 Jan 2010 17:06:02 +0100

<> 



As always: Show an excerpt of your data!



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von moleps
Gesendet: Montag, 11. Januar 2010 16:58
An: [email protected]
Betreff: st: generating count and sum variable over two different
categorical variables

Dear listers,
I´m doing a survival analysis, but also need to present some graphs on a
regional level. In other words my data is setup on an individual level with
categorical variables for year and region. What I need to do is generate a
count variable for the cases counted over year AND region. Using the - egen
total- command I´m only able to sum over either year or region. Not both as
far as I understand. Also is there a way to sum over two categories, not
just one.

ie my data is setup according to 

case year region 

and i´d like it setup acording to 

case year region #cases/year/region


Regards,
M


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