I have a dataset with entries for multiple people in a household. I need to remove all but one of the persons in each household. I generated the iddup variable and produced the following table:
tabulate iddup
iddup | Freq. Percent Cum.
------------+-----------------------------------
0 | 1,624 11.15 11.15
1 | 4,548 31.21 42.36
2 | 5,259 36.09 78.45
3 | 2,368 16.25 94.70
4 | 700 4.80 99.51
5 | 72 0.49 100.00
------------+-----------------------------------
Total | 14,571 100.00
I read the section on removing duplicates in Mitchell's Data Management Using Stata: A Practical Handbook, 2nd Ed., but Mitchell does not tell how to remove the duplicates but retain one of the observations. Are there any commands in Stata to do this?
tabulate iddup
iddup | Freq. Percent Cum.
------------+-----------------------------------
0 | 1,624 11.15 11.15
1 | 4,548 31.21 42.36
2 | 5,259 36.09 78.45
3 | 2,368 16.25 94.70
4 | 700 4.80 99.51
5 | 72 0.49 100.00
------------+-----------------------------------
Total | 14,571 100.00
I read the section on removing duplicates in Mitchell's Data Management Using Stata: A Practical Handbook, 2nd Ed., but Mitchell does not tell how to remove the duplicates but retain one of the observations. Are there any commands in Stata to do this?

Comment