Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: label (footnote)


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: label (footnote)
Date   Wed, 30 Oct 2002 17:22:33 -0000

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 
n.j.cox@durham.ac.uk 
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index