What is this Family ID in the table above? Is it part of the data, or is it
the value you are trying to compute (with the values shown as examples of
what your goal would be)?
I have a dataset where I am trying to match parents with their
children. The data is structured as follows:
Person Who is your parent? Family ID
1 Head of Household - 1
2 Spouse of household head - 1
3 Male adult child of head/spouse 1, 2 2
4 Female adult child of head/spouse 1, 2 3
5 Underage child of head/spouse 1, 2 1
6 Daughter-in-law of head/spouse - 2
7 Grandchild of head/spouse 3, 5 2
8 Grandchild of head/spouse -, 4 3
I want to generate unique family IDs, where family is defined as
parent-child, not grandparents, etc.
Family 1: 1, 2, 5
Family 2: 3, 6, 7
Family 3: 4, 8
But since I am concerned about children, I identify the families by
children who are younger than 21, hence the family ID of family 1 does not
include their adult children.
The only way it lists the parent-child relationship is by the line number
of the person. I am able to correctly match head and spouse with their
children, but in the above structure, how do I generate a unique ID for
family? The only way I seem to be able to do it confuses families 2 & 3.