I have a Stata data set like this:
HouseholdId PersonId OtherVariables
1 1
1 2
2 1
2 2
3 1
3 2
Here HouseholdId is a unique identifier for each household and PersonId is a unique identifier for each person in a household. If I want to create a unique personal id for each person within the sample, period. How would I do this?
I have tried egen per_id = group(PersonID HouseholdID)
but that doesn't seem to work.