As a further comment, even though Richard Williams
solved your problem: there are other answers to
your general question.
-duplicates- identifies observations that have
identical values for one or more variables.
There isn't a -duplicates keep- subcommand, but
you could -duplicates tag- and then -drop- if
the tagged variable was 0.
This is not a better answer for your specific
problem, which as said earlier can be solved
directly, but it is a general tool in this area.
Nick
[email protected]
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of
> Judet Roqueta
> Sent: 17 March 2004 02:00
> To: [email protected]
> Subject: st: repeated values of a variable
>
>
> Is there a way to have Stata identify observations that have
> equivalent
> values for a given variable? Speficically, I want to trim my
> dataset to
> individuals that live in the same household using a household id
> variable. I want to get rid of those that live alone. I tried using
> the egen tag and egen group commands, but that did not help.
>
*
* 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/