*deriving 'father' and 'mother' variables: *note: the following also includes commands to remove parental identities that are unknown and any lone parents **sweep 1, 'father' variable: gen father1=0 replace father1=1 if admres00 ==2 label define father1 1 "Father (main resp)" 0 "not" label values father1 father1 label var father1 "Fathers who are 'main' respondents in s1" gen father2=0 replace father2=1 if adpres00 ==2 replace father2=1 if adpres00 ==4 replace father2=1 if adpres00 ==6 replace father2=1 if adpres00 ==8 replace father2=1 if adpres00 ==13 replace father2=1 if adpres00 ==14 replace father2=1 if adpres00 ==15 replace father2=1 if adpres00 ==17 replace father2=1 if adpres00 ==19 replace father2=1 if adpres00 ==20 label define father2 1 "Father (partner resp)" 0 "not", modify label values father2 father2 label var father2 "Fathers who are 'partner' respondents in s1" gen father3=0 replace father3 = 1 if father1 ==1 replace father3 = 1 if father2 ==1 label define father3 1 "Father" 0 "not" label values father3 father3 label var father3 "All fathers in s1 (main + parts)" **sweep 2, 'father' variable: gen s2father1=0 replace s2father1 = 1 if bmdres00 ==2 replace s2father1 = 1 if bmdres00 ==4 replace s2father1 = 1 if bmdres00 ==6 replace s2father1 = 1 if bmdres00 ==8 replace s2father1 = 1 if bmdres00 ==12 replace s2father1 = 1 if bmdres00 ==14 replace s2father1 = 1 if bmdres00 ==16 replace s2father1 = 1 if bmdres00 ==18 replace s2father1 = 1 if bmdres00 ==20 replace s2father1 = 1 if bmdres00 ==22 replace s2father1 = 1 if bmdres00 ==24 replace s2father1 = 1 if bmdres00 ==30 label define s2father1 1 "Father (main resp)" 0 "not", modify label values s2father1 s2father1 label var s2father1 "Fathers who are 'main' respondents in s2" gen s2father2=0 replace s2father2 = 1 if bpdres00 ==2 replace s2father2 = 1 if bpdres00 ==4 replace s2father2 = 1 if bpdres00 ==6 replace s2father2 = 1 if bpdres00 ==8 replace s2father2 = 1 if bpdres00 ==12 replace s2father2 = 1 if bpdres00 ==14 replace s2father2 = 1 if bpdres00 ==16 replace s2father2 = 1 if bpdres00 ==18 replace s2father2 = 1 if bpdres00 ==20 replace s2father2 = 1 if bpdres00 ==22 replace s2father2 = 1 if bpdres00 ==24 replace s2father2 = 1 if bpdres00 ==30 label define s2father2 1 "Father (partner resp)" 0 "not", modify label values s2father2 s2father2 label var s2father2 "Fathers who are 'partner' respondents in s2" replace s2father2 = 1 if bpdres00 ==34 & fsample5X==1 gen s2father3=0 replace s2father3 = 1 if s2father1 ==1 replace s2father3 = 1 if s2father2 ==1 label define s2father3 1 "Father" 0 "not" label values s2father3 s2father3 label var s3father3 "All fathers in s2 (main + parts)" **sweep 2, 'mother' variable: gen s2mother1=0 replace s2mother1 = 1 if bmdres00 == 1 replace s2mother1 = 1 if bmdres00 == 3 replace s2mother1 = 1 if bmdres00 == 5 replace s2mother1 = 1 if bmdres00 == 7 replace s2mother1 = 1 if bmdres00 == 11 replace s2mother1 = 1 if bmdres00 == 13 replace s2mother1 = 1 if bmdres00 == 15 replace s2mother1 = 1 if bmdres00 == 17 replace s2mother1 = 1 if bmdres00 == 19 replace s2mother1 = 1 if bmdres00 == 21 replace s2mother1 = 1 if bmdres00 == 23 replace s2mother1 = 1 if bmdres00 == 29 label define s2mother1 1 "Mother (main resp)" 0 "not" label values s2mother1 s2mother1 label var s2mother1 "Mothers who are 'main' respondents in s2" gen s2mother2=0 replace s2mother2 = 1 if bpdres00 == 1 replace s2mother2 = 1 if bpdres00 == 3 replace s2mother2 = 1 if bpdres00 == 5 replace s2mother2 = 1 if bpdres00 == 7 replace s2mother2 = 1 if bpdres00 == 11 replace s2mother2 = 1 if bpdres00 == 13 replace s2mother2 = 1 if bpdres00 == 15 replace s2mother2 = 1 if bpdres00 == 17 replace s2mother2 = 1 if bpdres00 == 19 replace s2mother2 = 1 if bpdres00 == 21 replace s2mother2 = 1 if bpdres00 == 23 replace s2mother2 = 1 if bpdres00 == 29 label define s2mother2 1 "Mother (partner resp)" 0 "not" label values s2mother2 s2mother2 label var s2mother2 "Mothers who are 'partner' respondents in s2" replace s2mother1 =0 if bdmres00 ==2 & s2mother1==1 gen s2mother3=0 replace s2mother3 = 1 if s2mother1 ==1 replace s2mother3 = 1 if s2mother2 ==1 label define s2mother3 1 "Mother" 0 "not" label values s2mother3 s2mother3 label var s2mother3 "All mothers in s2 (main + parts)" **sweep 3, 'father' variable: gen s3father1=0 replace s3father1 = 1 if cmdres00 ==2 replace s3father1 = 1 if cmdres00 ==4 replace s3father1 = 1 if cmdres00 ==6 replace s3father1 = 1 if cmdres00 ==8 replace s3father1 = 1 if cmdres00 ==12 replace s3father1 = 1 if cmdres00 ==14 replace s3father1 = 1 if cmdres00 ==16 replace s3father1 = 1 if cmdres00 ==18 replace s3father1 = 1 if cmdres00 ==20 replace s3father1 = 1 if cmdres00 ==22 replace s3father1 = 1 if cmdres00 ==24 replace s3father1 = 1 if cmdres00 ==30 replace s3father1 = 1 if cmdres00 ==51 label define s3father1 1 "Father (main resp)" 0 "not", modify label values s3father1 s3father1 label var s3father1 "Fathers who are 'main' respondents in s3" gen s3father2=0 replace s3father2 = 1 if cpdres00 ==2 replace s3father2 = 1 if cpdres00 ==4 replace s3father2 = 1 if cpdres00 ==6 replace s3father2 = 1 if cpdres00 ==8 replace s3father2 = 1 if cpdres00 ==12 replace s3father2 = 1 if cpdres00 ==14 replace s3father2 = 1 if cpdres00 ==16 replace s3father2 = 1 if cpdres00 ==18 replace s3father2 = 1 if cpdres00 ==20 replace s3father2 = 1 if cpdres00 ==22 replace s3father2 = 1 if cpdres00 ==24 replace s3father2 = 1 if cpdres00 ==30 replace s3father2 = 1 if cpdres00 ==51 label define s3father2 1 "Father (main resp)" 0 "not", modify label values s3father2 s3father2 label var s3father2 "Fathers who are 'partner' respondent in s3" replace s3father2=1 if cpdres00==32 & s3father1==0 & s3father2==0 & fsample3X==1 gen s3father3=0 replace s3father3 = 1 if s3father1 ==1 replace s3father3 = 1 if s3father2 ==1 label define s3father3 1 "Father" 0 "not" label values s3father3 s3father3 label var s3father3 "All fathers in s3 (main + parts)" **sweep 3, 'mother' variable: gen s3mother1 =0 replace s3mother1 = 1 if cmdres00 == 1 replace s3mother1 = 1 if cmdres00 == 3 replace s3mother1 = 1 if cmdres00 == 5 replace s3mother1 = 1 if cmdres00 == 7 replace s3mother1 = 1 if cmdres00 == 11 replace s3mother1 = 1 if cmdres00 == 13 replace s3mother1 = 1 if cmdres00 == 15 replace s3mother1 = 1 if cmdres00 == 17 replace s3mother1 = 1 if cmdres00 == 19 replace s3mother1 = 1 if cmdres00 == 21 replace s3mother1 = 1 if cmdres00 == 23 replace s3mother1 = 1 if cmdres00 == 29 label define s3mother1 1 "Mother (main resp)" 0 "not" label values s3mother1 s3mother1 label var s3mother1 "s3 mothers (main respondents)" gen s3mother2 =0 replace s3mother2 = 1 if cpdres00 == 1 replace s3mother2 = 1 if cpdres00 == 3 replace s3mother2 = 1 if cpdres00 == 5 replace s3mother2 = 1 if cpdres00 == 7 replace s3mother2 = 1 if cpdres00 == 11 replace s3mother2 = 1 if cpdres00 == 13 replace s3mother2 = 1 if cpdres00 == 15 replace s3mother2 = 1 if cpdres00 == 17 replace s3mother2 = 1 if cpdres00 == 19 replace s3mother2 = 1 if cpdres00 == 21 replace s3mother2 = 1 if cpdres00 == 23 replace s3mother2 = 1 if cpdres00 == 29 label define s3mother2 1 "Mother (part resp)" 0 "not" label values s3mother2 s3mother2 label var s3mother2 "s3 mothers (partner respondents)" **sweep 4, 'father' variable: gen s4father1=0 replace s4father1 = 1 if dmdres00 ==2 replace s4father1 = 1 if dmdres00 ==4 replace s4father1 = 1 if dmdres00 ==6 replace s4father1 = 1 if dmdres00 ==8 replace s4father1 = 1 if dmdres00 ==12 replace s4father1 = 1 if dmdres00 ==14 replace s4father1 = 1 if dmdres00 ==16 replace s4father1 = 1 if dmdres00 ==18 replace s4father1 = 1 if dmdres00 ==20 replace s4father1 = 1 if dmdres00 ==22 replace s4father1 = 1 if dmdres00 ==24 replace s4father1 = 1 if dmdres00 ==30 replace s4father1 = 1 if dmdres00 ==51 replace s4father1 = 1 if dmdres00 ==58 label define s4father1 1 "Father (main resp)" 0 "not", modify label values s4father1 s4father1 label var s4father1 "Fathers who are 'main' respondents in s4" gen s4father2=0 replace s4father2 = 1 if dpdres00 ==2 replace s4father2 = 1 if dpdres00 ==4 replace s4father2 = 1 if dpdres00 ==6 replace s4father2 = 1 if dpdres00 ==8 replace s4father2 = 1 if dpdres00 ==12 replace s4father2 = 1 if dpdres00 ==14 replace s4father2 = 1 if dpdres00 ==16 replace s4father2 = 1 if dpdres00 ==18 replace s4father2 = 1 if dpdres00 ==20 replace s4father2 = 1 if dpdres00 ==22 replace s4father2 = 1 if dpdres00 ==24 replace s4father2 = 1 if dpdres00 ==30 replace s4father2 = 1 if dpdres00 ==51 replace s4father2 = 1 if dpdres00 ==58 label define s4father2 1 "Father (partner resp)" 0 "not", modify label values s4father2 s4father2 label var s4father2 "Fathers who are 'partner' respondents in s4" gen s4father3=0 replace s4father3 = 1 if s4father1 ==1 replace s4father3 = 1 if s4father2 ==1 label define s4father3 1 "Father" 0 "not" label values s4father3 s4father3 label var s4father3 "All fathers in s4 (main + parts)" **sweep 4, 'mother' variable: gen s4mother1 =0 replace s4mother1 = 1 if dmdres00 == 1 replace s4mother1 = 1 if dmdres00 == 3 replace s4mother1 = 1 if dmdres00 == 5 replace s4mother1 = 1 if dmdres00 == 7 replace s4mother1 = 1 if dmdres00 == 11 replace s4mother1 = 1 if dmdres00 == 13 replace s4mother1 = 1 if dmdres00 == 15 replace s4mother1 = 1 if dmdres00 == 17 replace s4mother1 = 1 if dmdres00 == 19 replace s4mother1 = 1 if dmdres00 == 21 replace s4mother1 = 1 if dmdres00 == 23 replace s4mother1 = 1 if dmdres00 == 29 label define s4mother1 1 "Mother (main resp)" 0 "not" label values s4mother1 s4mother1 label var s4mother1 "s4 mothers (main respondents)" gen s4mother2 =0 replace s4mother2 = 1 if dpdres00 == 1 replace s4mother2 = 1 if dpdres00 == 3 replace s4mother2 = 1 if dpdres00 == 5 replace s4mother2 = 1 if dpdres00 == 7 replace s4mother2 = 1 if dpdres00 == 11 replace s4mother2 = 1 if dpdres00 == 13 replace s4mother2 = 1 if dpdres00 == 15 replace s4mother2 = 1 if dpdres00 == 17 replace s4mother2 = 1 if dpdres00 == 19 replace s4mother2 = 1 if dpdres00 == 21 replace s4mother2 = 1 if dpdres00 == 23 replace s4mother2 = 1 if dpdres00 == 29 label define s4mother2 1 "Mother (part resp)" 0 "not" label values s4mother2 s4mother2 label var s4mother2 "s4 mothers (partner respondents)" *To generate s5 father variables, the variables 'emdres00' and 'epdres00' have to be *derived as these are not available in the sweep 5 dataset *To generate emdres00 - identity of main resp, s5 gen emdres00 =0 replace emdres00 = 1 if EPCREL001 ==7 & EPPSEX001 ==2 replace emdres00 = 2 if EPCREL001 ==7 & EPPSEX001 ==1 replace emdres00 = 3 if EPCREL001 ==8 & EPPSEX001 ==2 replace emdres00 = 4 if EPCREL001 ==8 & EPPSEX001 ==1 replace emdres00 = 5 if EPCREL001 ==9 & EPPSEX001 ==2 replace emdres00 = 6 if EPCREL001 ==9 & EPPSEX001 ==1 replace emdres00 = 7 if EPCREL001 ==10 & EPPSEX001 ==2 replace emdres00 = 8 if EPCREL001 ==10 & EPPSEX001 ==1 replace emdres00 = 9 if EPCREL001 ==11 & EPPSEX001 ==2 replace emdres00 = 10 if EPCREL001 ==11 & EPPSEX001 ==1 replace emdres00 = 11 if EPCREL001 ==12 & EPPSEX001 ==2 replace emdres00 = 12 if EPCREL001 ==12 & EPPSEX001 ==1 replace emdres00 = 13 if EPCREL001 ==17 & EPPSEX001 ==2 replace emdres00 = 14 if EPCREL001 ==17 & EPPSEX001 ==1 replace emdres00 = 15 if EPCREL001 ==19 & EPPSEX001 ==2 replace emdres00 = 16 if EPCREL001 ==19 & EPPSEX001 ==1 replace emdres00 = 17 if EPCREL001 ==20 & EPPSEX001 ==2 replace emdres00 = 18 if EPCREL001 ==20 & EPPSEX001 ==1 label define emdres00 1 "natural mum" 2 "natural dad" 3 "adoptive mum" 4 "adoptive dad" 5 "foster mum " 6 "foster dad" 7 "step mum/partner" 8 "step dad/partner" 9 "natural sister" 10 "natural brother" 11 "half sister" 12 "half brother" 13 "grandmother" 14 "grandfather" 15 "other relative, female" 16 "other relative, male" 17 "other non relative, female" 18 "other non relative, male" label values emdres00 emdres00 label var emdres00 "Main respondent identity in s5" recode emdres00 0=. *edpres00 - partner identity in s5 gen epdres00 = 0 replace epdres00 = 1 if EPCREL002 == 7 & EPPSEX002 ==2 replace epdres00 = 2 if EPCREL002 == 7 & EPPSEX002 ==1 replace epdres00 = 3 if EPCREL002 == 8 & EPPSEX002 ==2 replace epdres00 = 4 if EPCREL002 == 8 & EPPSEX002 ==1 replace epdres00 = 5 if EPCREL002 == 9 & EPPSEX002 ==2 replace epdres00 = 6 if EPCREL002 == 9 & EPPSEX002 ==1 replace epdres00 = 7 if EPCREL002 == 10 & EPPSEX002 ==2 replace epdres00 = 8 if EPCREL002 == 10 & EPPSEX002 ==1 replace epdres00 = 9 if EPCREL002 == 17 & EPPSEX002 ==2 replace epdres00 = 10 if EPCREL002 == 17 & EPPSEX002 ==1 replace epdres00 = 11 if EPCREL002 == 19 & EPPSEX002 ==2 replace epdres00 = 12 if EPCREL002 == 19 & EPPSEX002 ==1 replace epdres00 = 13 if EPCREL002 == 20 & EPPSEX002 ==2 replace epdres00 = 14 if EPCREL002 == 20 & EPPSEX002 ==1 label define epdres00 1 "Natural mum" 2 "Natural dad" 3 "Adoptive mum" 4 "Adoptive dad" 5 "Foster mum" 6 "Foster dad" 7 "Step mum/partner" 8 "Step dad/partner" 9 "Grandmother" 10 "Grandfather" 11 "Other relative, female" 12 "Other relative, male" 13 "Other non-rel, female" 14 "Other non-rel, male" label values epdres00 epdres00 label var epdres00 "Partner identity status in s5" recode epdres00 0=. **sweep 5, 'father' variable: gen s5father1=0 replace s5father1 = 1 if emdres00 ==2 replace s5father1 = 1 if emdres00 ==4 replace s5father1 = 1 if emdres00 ==6 replace s5father1 = 1 if emdres00 ==8 label define s5father1 1 "Father (main resp)" 0 "not", modify label values s5father1 s5father1 label var s5father1 "Fathers who are 'main' respondents in s5" gen s5father2 = 0 replace s5father2 = 1 if epdres00 ==2 replace s5father2 = 1 if epdres00 ==4 replace s5father2 = 1 if epdres00 ==6 replace s5father2 = 1 if epdres00 ==8 label define s5father2 1 "Father (partner resp)" 0 "not", modify label values s5father2 s5father2 label var s5father2 "Fathers who are 'partner' respondents in s5" gen s5father3=0 replace s5father3 = 1 if s5father1 ==1 replace s5father3 = 1 if s5father2 ==1 label define s5father3 1 "Father" 0 "not" label values s5father3 s5father3 label var s5father3 "All fathers in s5 (main + parts)" **sweep 5, 'mother' variable: gen s5mother1 = 0 replace s5mother1 = 1 if emdres00 ==1 replace s5mother1 = 1 if emdres00 ==3 replace s5mother1 = 1 if emdres00 ==5 replace s5mother1 = 1 if emdres00 ==7 label define s5mother1 1 "Mother (main resp)" 0 "not" label values s5mother1 s5mother1 label var s5mother1 "Mothers who are 'main' resps in s5" gen s5mother2 = 0 replace s5mother2 = 1 if epdres00 ==1 replace s5mother2 = 1 if epdres00 ==3 replace s5mother2 = 1 if epdres00 ==7 label define s5mother2 1 "Mother (partner resp)" 0 "not" label values s5mother2 s5mother2 label var s5mother2 "Mothers who are 'partner' resps in s5" *********************************** *Deriving the sample for analysis 1 (same father-mother households s1-5) ****fsample1x - sample of sweep 1 (s1) fathers: All responded, all partnered with the child's mother, all cohabiting or married gen fsample1X = 0 replace fsample1X = 1 if adresp00 == 2 replace fsample1X = 1 if adresp00 == 3 replace fsample1X = 1 if adresp00 == 5 replace fsample1X = 0 if fsample1X==1 & admres00 ==9 replace fsample1X = 0 if fsample1X==1 & admres00 ==1 & adpres00 ==7 replace fsample1X = 0 if fsample1X==1 & adpres00 == 11 replace fsample1X= 0 if ADRELP00 == 3 label var fsample1X "Sample of father-mother households in s1 (n=13,411)" ****fsample2X = longitudinal sweep1-2 sample which includes the same father-mother households **matched on pnumbers: gen fsample2X = 0 *Capturing the same 'main' to 'main' respondent fathers: replace fsample2X = 1 if fsample1X==1 & s2father1 ==1 & father1==1 & ampnum00==2 & bmpnum00==2 *Capturing the same 'partner' to 'main' respondent fathers: replace fsample2X = 1 if fsample1X==1 & s2father1 ==1 & father2==1 & appnum00==1 & bmpnum00==1 replace fsample2X = 1 if fsample1X==1 & s2father1 ==1 & father2==1 & appnum00==2 & bmpnum00==2 replace fsample2X = 1 if fsample1X==1 & s2father1 ==1 & father2==1 & appnum00==3 & bmpnum00==3 *Capturing the same 'main' to 'partner' respondent fathers: replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father1==1 & ampnum00==2 & bppnum00==2 *Capturing the same 'partner' to 'partner' respondent fathers: replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father2==1 & appnum00==1 & bppnum00==1 replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father2==1 & appnum00==2 & bppnum00==2 replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father2==1 & appnum00==3 & bppnum00==3 replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father2==1 & appnum00==4 & bppnum00==4 replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father2==1 & appnum00==5 & bppnum00==5 replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father2==1 & appnum00==6 & bppnum00==6 replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father2==1 & appnum00==7 & bppnum00==7 replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father2==1 & appnum00==8 & bppnum00==8 replace fsample2X = 1 if fsample1X==1 & s2father2 ==1 & father2==1 & appnum00==9 & bppnum00==9 *Checks tab bmpnum00 ampnum00 if s2father1==1 & father1==1 & fsample2X==1, miss tab bmpnum00 appnum00 if s2father1==1 & father2==1 & fsample2X==1, miss tab bppnum00 ampnum00 if s2father2==1 & father1==1 & fsample2X==1, miss tab bppnum00 appnum00 if s2father2==1 & father2==1 & fsample2X==1, miss *Capturing same main to main mothers: replace fsample2X = 0 if bmpnum00 ==3 & ampnum00==1 & s2mother1==1 & mother1==1 & fsample2X==1 replace fsample2X = 0 if bmpnum00 ==4 & ampnum00==1 & s2mother1==1 & mother1==1 & fsample2X==1 replace fsample2X = 0 if bmpnum00 ==9 & ampnum00==1 & s2mother1==1 & mother1==1 & fsample2X==1 replace fsample2X = 0 if bmpnum00 ==5 & ampnum00==2 & s2mother1==1 & mother1==1 & fsample2X==1 *Capturing same partner to main mothers: replace fsample2X = 0 if bppnum00 ==3 & ampnum00==1 & s2mother2==1 & mother1==1 & fsample2X==1 replace fsample2X = 0 if bppnum00 ==4 & ampnum00==1 & s2mother2==1 & mother1==1 & fsample2X==1 **checks tab bpdres00 bmdres00 if fsample2X==1 replace fsample2X=0 if bdresp00 ==1 & fsample2X ==1 tab bppnum00 appnum00 if bpdres00 == 34 & fsample2X==1 & bmdres00 ==41 tab BDRELP00 if fsample2X==1 label var fsample2X "Sample of intact father-mother households s1-2 (n=10,318)" ****fsample3X = longitudinal sweep 1-3 (s1-3) sample which includes the same father-mother households gen fsample3X = 0 *Capturing same main to main fathers: replace fsample3X = 1 if fsample2X==1 & s2father1 ==1 & s3father1==1 & cmpnum00==1 & bmpnum00==1 replace fsample3X = 1 if fsample2X==1 & s2father1 ==1 & s3father1==1 & cmpnum00==2 & bmpnum00==2 *Capturing same main to partner fathers: replace fsample3X = 1 if fsample2X==1 & s3father1 ==1 & s2father2==1 & cmpnum00==1 & bppnum00==1 replace fsample3X = 1 if fsample2X==1 & s3father1 ==1 & s2father2==1 & cmpnum00==2 & bppnum00==2 replace fsample3X = 1 if fsample2X==1 & s3father1 ==1 & s2father2==1 & cmpnum00==3 & bppnum00==3 replace fsample3X = 1 if fsample2X==1 & s3father1 ==1 & s2father2==1 & cmpnum00==4 & bppnum00==4 *Capturing same partner to main fathers: replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father1==1 & cppnum00==1 & bmpnum00==1 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father1==1 & cppnum00==2 & bmpnum00==2 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father1==1 & cppnum00==3 & bmpnum00==3 *Capturing same partner to partner fathers: replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father2==1 & cppnum00==1 & bppnum00==1 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father2==1 & cppnum00==2 & bppnum00==2 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father2==1 & cppnum00==3 & bppnum00==3 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father2==1 & cppnum00==4 & bppnum00==4 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father2==1 & cppnum00==5 & bppnum00==5 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father2==1 & cppnum00==6 & bppnum00==6 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father2==1 & cppnum00==7 & bppnum00==7 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father2==1 & cppnum00==8 & bppnum00==8 replace fsample3X = 1 if fsample2X==1 & s3father2 ==1 & s2father2==1 & cppnum00==9 & bppnum00==9 *Capturing same main to main mothers: replace fsample3X = 0 if cmpnum00 ==3 & bmpnum00==1 & s3mother1==1 & s2mother1==1 & fsample3X==1 *Capturing same partner to main mothers: replace fsample3X = 0 if cppnum00 ==3 & bmpnum00==1 & s3mother2==1 & s2mother1==1 & fsample3X==1 replace fsample3X = 0 if cppnum00 ==4 & bmpnum00==1 & s3mother2==1 & s2mother1==1 & fsample3X==1 replace fsample3X = 0 if cppnum00 ==5 & bmpnum00==1 & s3mother2==1 & s2mother1==1 & fsample3X==1 *Check: identities of couples tab cpdres00 cmdres00 if fsample3X==1 replace fsample3X=0 if cdresp00 ==1 & fsample3X ==1 label var fsample3X "Sample of intact father-mother households s1-3 (n=8,834)" ****fsample4X = longitudinal sweep 1-4 (s1-4) sample which includes the same father-mother households gen fsample4X =0 *Capturing the same main to main fathers: replace fsample4X = 1 if fsample3X==1 & s4father1 ==1 & s3father1==1 & dmpnum00==1 & cmpnum00==1 replace fsample4X = 1 if fsample3X==1 & s4father1 ==1 & s3father1==1 & dmpnum00==2 & cmpnum00==2 *Capturing the same main to partner fathers: replace fsample4X = 1 if fsample3X==1 & s4father1 ==1 & s3father2==1 & dmpnum00==1 & cppnum00==1 replace fsample4X = 1 if fsample3X==1 & s4father1 ==1 & s3father2==1 & dmpnum00==2 & cppnum00==2 replace fsample4X = 1 if fsample3X==1 & s4father1 ==1 & s3father2==1 & dmpnum00==3 & cppnum00==3 *Capturing the same partner to main fathers: replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father1==1 & dppnum00==1 & cmpnum00==1 replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father1==1 & dppnum00==2 & cmpnum00==2 replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father1==1 & dppnum00==3 & cmpnum00==3 replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father1==1 & dppnum00==4 & cmpnum00==4 *Capturing the same partner to partner fathers: replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father2==1 & dppnum00==1 & cppnum00==1 replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father2==1 & dppnum00==2 & cppnum00==2 replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father2==1 & dppnum00==3 & cppnum00==3 replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father2==1 & dppnum00==4 & cppnum00==4 replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father2==1 & dppnum00==5 & cppnum00==5 replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father2==1 & dppnum00==6 & cppnum00==6 replace fsample4X = 1 if fsample3X==1 & s4father2 ==1 & s3father2==1 & dppnum00==7 & cppnum00==7 *Capturing same main to partner mothers: replace fsample4X=0 if cmpnum00==1 & dppnum00==4 & s3mother1==1 & s4mother2==1 & fsample4X==1 replace fsample4X=0 if cmpnum00==1 & dppnum00==5 & s3mother1==1 & s4mother2==1 & fsample4X==1 replace fsample4X=0 if cmpnum00==1 & dppnum00==6 & s3mother1==1 & s4mother2==1 & fsample4X==1 replace fsample4X=0 if cmpnum00==1 & dppnum00==7 & s3mother1==1 & s4mother2==1 & fsample4X==1 replace fsample4X=0 if dpdres00 ==-1 & dmdres00 ==2 & fsample4X==1 replace fsample4X=0 if dpdres00 ==25 & dmdres00 ==2 & fsample4X==1 label var fsample4X "Sample of intact father-mother households s1-4 (n=7,617)" ****fsample5X = longitudinal sweep 1-5 (s1-5) sample which includes the same father-mother households gen fsample5X =0 *Capturing the same partner to main fathers replace fsample5X = 1 if fsample4X==1 & s5father1 ==1 & s4father1==1 & EPPNUM001==1 & dmpnum00==1 replace fsample5X = 1 if fsample4X==1 & s5father1 ==1 & s4father1==1 & EPPNUM001==2 & dmpnum00==2 *Capturing the same partner to partner fathers replace fsample5X = 1 if fsample4X==1 & s5father1 ==1 & s4father2==1 & EPPNUM001==1 & dppnum00==1 replace fsample5X = 1 if fsample4X==1 & s5father1 ==1 & s4father2==1 & EPPNUM001==2 & dppnum00==2 replace fsample5X = 1 if fsample4X==1 & s5father1 ==1 & s4father2==1 & EPPNUM001==3 & dppnum00==3 *Capturing the same partner to main fathers replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father1==1 & EPPNUM002==1 & dmpnum00==1 replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father1==1 & EPPNUM002==2 & dmpnum00==2 replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father1==1 & EPPNUM002==3 & dmpnum00==3 *Capturing the same partner to partner fathers replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father2==1 & EPPNUM002==1 & dppnum00==1 replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father2==1 & EPPNUM002==2 & dppnum00==2 replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father2==1 & EPPNUM002==3 & dppnum00==3 replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father2==1 & EPPNUM002==4 & dppnum00==4 replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father2==1 & EPPNUM002==5 & dppnum00==5 replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father2==1 & EPPNUM002==6 & dppnum00==6 replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father2==1 & EPPNUM002==7 & dppnum00==7 replace fsample5X = 1 if fsample4X==1 & s5father2 ==1 & s4father2==1 & EPPNUM002==8 & dppnum00==8 *Capturing the same main to partner mothers replace fsample5X=0 if s4mother1==1 & s5mother2==1 & fsample5X==1 & dmpnum00 ==1 & EPPNUM002 ==5 replace fsample5X=0 if s4mother1==1 & s5mother2==1 & fsample5X==1 & dmpnum00 ==1 & EPPNUM002 ==6 *checks tab epdres00 emdres00 if fsample5X==1, miss replace fsample5X = 0 if emdres00 ==2 & epdres00 == . & fsample5X==1 replace fsample5X = 0 if epdres00 ==13 & emdres00 == 2 & fsample5X==1 label var fsample5X "Sample of intact father-mother households s1-5 (n=5,882)"