I'd second Roger's warning but I'd usually
want to check before the -collapse-.
-duplicates- offers one way to approach this.
Nick
[email protected]
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/