Hi everyone! I'm fairly new to Stata & Statalist, so I apologize in advance if this question has already been asked. I did not find anything that could help me. Also, I feel like my problem has a pretty simple answer but it just won't come to me.

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Ʃ