grouping - Create unique personal id -
i have stata data set this:
householdid personid othervariables 1 1 1 2 2 1 2 2 3 1 3 2
here householdid
unique identifier each household , personid
unique identifier each person in household. if want create unique personal id each person within sample, period. how this?
i have tried egen per_id = group(personid householdid)
doesn't seem work.
i take want unique identifier each person within entire dataset.
sort householdid personid gen long obs id = _n
as follows accessible discussion in stata faq. have been found typing in stata
search identifier
or
search id
(meta-answer: can , should within stata information on basic notions this.)
i add strong recommendation word unique still carries original meaning of appearing once only. word distinct is, suggest, better word when mean. more on on p.558 of this paper.
Comments
Post a Comment