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

RE: st: new: collapse2


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: new: collapse2
Date   Wed, 4 Aug 2004 17:24:22 +0100

I'd second Roger's warning but I'd usually 
want to check before the -collapse-. 
-duplicates- offers one way to approach this. 

Nick 
n.j.cox@durham.ac.uk 

Roger Newson
> 
> "Cheating" is probably the way to go, rather than adding a 
> superfluous id() 
> option. However, I would have typed:
> 
> . collapse (sum) grams kcal fat, by(personid age gender 
> samput stratum psu)
> . by personid: assert _N==1
> 
> That way, I would know that age, gender, samput, stratum and 
> psu really are 
> id variables for personid (because otherwise Stata would 
> complain and stop).

*
*   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