Skip to content
Prev 386117 / 398513 Next

Creating unique code

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_00008_dta is a case (individual) and an individual may
have zero or more spouses, there would have to be more than one field for
"sploc" for those who had more than one "spouse". I would approach it by
creating a variable named "relcode" that was unique for each "union", so
that if more than one individual had the same non-zero "relcode" they would
all be in the same "relationship". That still leaves us with exclusive
relationships, so there would have to be multiple fields for "relcode" for
groups of people who were in different relationships in the same household.
I know that this is being pedantic, but it looks like a set intersection
problem of the Bob and Carol and Ted and Alice variety.

Jim

On Wed, Oct 28, 2020 at 6:39 AM Hannah Van Impe <hannahvanimpe at outlook.com>
wrote: