Hello, I am working with a public survey database that gathers data at the household, family and individual level. Meaning, in each household there is sometimes more than one family and in each family more than one individual.
There is an id 'folio' for each household and I have created a family id code 'folio_nucleo' through:
I am trying to link children's variables with their parent's. For example, I want to see if the fact of having a teenage mother affects the child's enrolment in primary education (just an eg.). For this I would have to analyse the presence of a teenage mother and children's enrolment per household.
I have created variables for 'teenage mother'
and for 'children 0 to 6 years not enrolled'
The variable for family ID is
The total number of observations is 216439
I have tried a few methods but have not yet been successful. I am sorry I am not presenting the code I have tried but I don't think it would help as they were very poor attempts and I didn't really have much idea of what I was trying.
Thank you very much!
There is an id 'folio' for each household and I have created a family id code 'folio_nucleo' through:
Code:
gen folio_nucleo=folio*10+nucleo
I have created variables for 'teenage mother'
Code:
gen madreado1=. replace madreado1=1 if madre==1 & s5<20 & (edad-s4)<6
Code:
gen noasis=. replace noasis=1 if e3==2 & edad<7
Code:
folio_nucleo
I have tried a few methods but have not yet been successful. I am sorry I am not presenting the code I have tried but I don't think it would help as they were very poor attempts and I didn't really have much idea of what I was trying.
Thank you very much!
Comment