Kompal Sinha
> > I have household level data in following format:
> > HHID var1 var2
> > 1 5 6
> > 1 5 6
> > 1 5 6
> > 2 5 7
> > 2 5 7
> > 4 9 6
> >
> > I want it in the following format now:
> > HHID var1 var2
> > 1 5 6
> > 2 5 7
> > 4 9 6
> >
> > How can I retain observations with unique HHID????
Stephen Morris
> You might like to try the following:
>
> sort HHID
> by HHID: gen occur=_n
> tab occur
> drop if occur>1
This would be fine so long as the variables really
are duplicated on the other variables of interest.
But in any large and complicated data set what
appears to be true from a casual inspection
might not be true of all subsets. It is
safer to use the systematic approaches
mentioned in my previous posting in this thread.
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/