Dear all,
I'm working with a large household survey (over a 40,000 observations) but I don't have an id number for each observation in my data set. What I have is an id for each household (idhh) and an number for each person (idmember) in the household.
I want to create an unique id for each observation.
I tried using the command "gen newid = idhh + idmember" (both idhh and idmember are in the string format).
However I have different decimal places for the observations.
I would like to know if there's a command to create this new variable (so that my new variable "newid" has the same decimal places for all observations) combining two other variables?
Thank you all!
I'm working with a large household survey (over a 40,000 observations) but I don't have an id number for each observation in my data set. What I have is an id for each household (idhh) and an number for each person (idmember) in the household.
I want to create an unique id for each observation.
I tried using the command "gen newid = idhh + idmember" (both idhh and idmember are in the string format).
However I have different decimal places for the observations.
I would like to know if there's a command to create this new variable (so that my new variable "newid" has the same decimal places for all observations) combining two other variables?
Thank you all!
Comment