Statalist


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

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


From   moleps <[email protected]>
To   [email protected]
Subject   st: generating count and sum variable over two different categorical variables
Date   Mon, 11 Jan 2010 16:58:09 +0100

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/



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