From | "Michael Blasnik" <[email protected]> |
To | <[email protected]> |
Subject | Re: st: a question about panel data |
Date | Thu, 28 Jul 2005 16:00:13 -0400 |
>
Until somebody else suggests a shorter way, one way to do it is the following:
gen count=.
levels id, local (levels)
foreach l of local levels{
count if id==`l'
replace count=r(N) if id==`l'
}
duplicates drop id count, force
tab count
I think that should work
Dev
* * 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–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |