Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65601

How to generate parents variables matched to their children

$
0
0
Hello everyone,

I've been trying to create a dummy variable indicating if at least one of the two parents (living with the children) is black. I read many of the previous entries regarding similar topics, but my dataset is quite different, so I did not come up with any ideas. My data looks like this:
id sector quest p_num relation_hh famnumb condfam father mother numfath numbmoth race
123 1001 1 1 head 1 head 0 0 1
124 1001 1 2 son/daughter 1 son/daughter 0 1 1 1 1
125 1001 2 1 head 1 head 0 0 2
126 1002 1 1 head 1 head 0 0 2
127 1002 1 2 spouse 1 spouse 0 0 1
128 1002 1 3 son/daughter 1 son/daughter 1 1 1 2
129 1002 2 1 head 1 head 0 1 3 1
130 1002 2 2 son/daughter 1 son/daughter 1 1 1 1
131 1002 2 3 mother/father 1 mother/father 0 0 2
132 1003 1 1 son/daughter 1 son/daughter 1 1 2 3 2
133 1003 1 2 head 1 head 0 0 1
134 1003 1 3 spouse 1 spouse 0 0 2
135 1003 1 4 grandchild 1 grandchild 1 0 1 2
136 1003 1 5 brother/sister 2 head 0 0 1
137 1003 1 6 nephew/niece 2 son 0 1 6 1

ID is the unique person ID number, sector is the sector within the research, quest is the questionnaire number, p_numb is the respondent's number within the household, relation_hh is the relationship to the head of household, famnumb is the family number within the household, condfam is the condition within the family, father/mother is whether the father/mother lives in the same household, numbfath/numbmoth is the p_numb of father/mother, race is the self declared race (1-black, no-black).

Thank you so much in advance.

Regards,

Rebeca

Viewing all articles
Browse latest Browse all 65601


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>