Re: [R] Creating unique code

2020-10-28 Thread Jim Lemon
Hi Hannah, Yes, that does give me more insight. The polygyny only doesn't matter, for even if there was polyandry it could be coded in the same way. If I understand this correctly you have one variable (SPRULE) that must contain information about the household of the individual and the identities o

Re: [R] Creating unique code

2020-10-27 Thread Jim Lemon
Hi Hannah, Without knowing how the data are organized and what each numeric code means, it is a bit difficult. If it is assumed that each row in the data frame(?) ipumsi_8_dta is a case (individual) and an individual may have zero or more spouses, there would have to be more than one field for

[R] Creating unique code

2020-10-27 Thread Hannah Van Impe
Hello, I need some help in creating a new variable. I need to create a 'couple identifier', which gives a unique code for every couple/triple/... in a household. So, I can identify couples. To do this, I should use 4 variables: * SERIAL = a unique numeric code for each household * PERNU