Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: egen question


From   Dalhia <[email protected]>
To   [email protected]
Subject   Re: st: egen question
Date   Fri, 19 Nov 2010 17:42:21 -0800 (PST)

I would suggest using 'bysort' command. Something like this should work:

bysort jurisdictions; egen tally = count(jurisdictions)

you can then just select those where tally>5

Hope this works.


--- On Sat, 11/20/10, john metcalfe <[email protected]> wrote:

> From: john metcalfe <[email protected]>
> Subject: st: egen question
> To: [email protected]
> Date: Saturday, November 20, 2010, 3:32 AM
> Dear Statalist,
> I have a cross-sectional database of 50,000 individuals
> (cases)
> diagnosed within one of 50 jurisdictions over a 16 year
> period.
> For each year, I would like to tally the number of
> jurisdictions
> diagnosing 5 or more cases.
> Does anyone know of a simple way to generate this variable
> using
> -egen- or some other method?
> Many thanks,
> John
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index