So I am working with individual-level data. I have information on each household member, including children. I want to know if free childcare increases maternal labor supply. So I generated a variable for being a mother and a variable if the child goes to childcare. Now I need to generate a new variable that is equal to one for the mom if her child is in childcare.
hhid | mother | child | nr_children | childcare | child_in_care |
1 | 1 | 0 | 1 | 0 | 1 |
1 | 0 | 1 | 0 | 1 | 0 |
2 | 1 | 0 | 2 | 0 | 1 |
2 | 0 | 1 | 0 | 1 | 0 |
2 | 0 | 1 | 0 | 0 | 0 |
The first 5 variables are existing in my data, but not the last one. Child_in_care would need to be a dummy that equals 1 for the mother if she has a child in childcare. Hence, I would have to generate that variable from observations from her children. Maybe this can be solved with loops or collapsing, but I did not find out the answer.
I am grateful for any suggestions.
Best wishes,
Chloé
0 Response to Generate new variable for one household member from observations from different household members
Post a Comment