Nick Cox
> Another even more homespun way is illustrated by this
> example:
>
> . u auto
> . bysort foreign : egen freq = sum(1)
> . egen tag = tag(foreign)
> . list foreign freq if tag
You might wonder why I didn't
have that last example as
. u auto
. bysort foreign : gen freq = _N
. egen tag = tag(foreign)
. list foreign freq if tag
which would have made more use
of zeroth principles. One
answer would be that using -egen, sum()-
extends nicely to handling weights.
Nick
[email protected]
*
* 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/