Family Data » Creating Parent Files with One Record Per Respondent »

Stata Code for:  [2000] [1998] [1996] [1994] [1992]


Respondent Record with Mother and Father Variables: 2000

Note: Modify variable list as needed; for a listing of parent (and equivalent parent-in-law) variables consult the 2000 Parent to Parent-in-Law Variables Cross-Reference Table .

*   STEP 1:  PARENT INFORMATION FOR FAMILY RESPONDENTS' PARENTS
use c:\temp\H00D_H

keep if GPN_FAM~=""

gen PN  =GPN_FAM
gen GPN_SP=GPN_NFAM

*   KEEP PARENT VARIABLES OF INTEREST
keep    HHID PN GPN_SP GSUBHH G2122 G2132
save FAMR, replace

*   STEP 2:  PARENT INFORMATION FOR NON-FAMILY RESPONDENTS' PARENTS
use c:\temp\H00D_H
keep if GPN_NFAM~=""

gen PN  =GPN_NFAM
gen GPN_SP=GPN_FAM

*   COPY PARENT-IN-LAW VARIABLES TO OUTPUT VARIABLES LOCATIONS
replace G2122=G2309
replace G2132=G2319

*   KEEP PARENT VARIABLES OF INTEREST
keep    HHID PN GPN_SP GSUBHH G2122 G2132
sort  HHID PN
save NFAMR, replace

*   Step 3:  Concatenate two parent files
use famr
sort HHID PN
merge HHID PN using nfamr
drop _merge
sort HHID PN
save parents2, replace

Top


Respondent Record with Mother and Father Variables: 1998

Note: Modify variable list as needed; for a listing of parent (and equivalent parent-in-law) variables consult the 1998 Parent to Parent-in-Law Variables Cross-Reference Table .

*   STEP 1:  PARENT INFORMATION FOR FAMILY RESPONDENTS' PARENTS
use c:\temp\H98D_H

keep if FPN_FAM~=""

gen PN  =FPN_FAM
gen FPN_SP=FPN_NFAM

*   KEEP PARENT VARIABLES OF INTEREST
keep    HHID PN FPN_SP FSUBHH F1906 F1916
save FAMR, replace

*   STEP 2:  PARENT INFORMATION FOR NON-FAMILY RESPONDENTS' PARENTS
use c:\temp\H98D_H
keep if FPN_NFAM~=""

gen PN  =FPN_NFAM
gen FPN_SP=FPN_FAM

*   COPY PARENT-IN-LAW VARIABLES TO OUTPUT VARIABLES LOCATIONS
replace F1906=F2068
replace F1916=F2078

*   KEEP PARENT VARIABLES OF INTEREST
keep    HHID PN FPN_SP FSUBHH F1906 F1916
sort  HHID PN
save NFAMR, replace

*   STEP 3:  CONCATENATE TWO PARENT FILES
use famr
sort HHID PN
merge HHID PN using nfamr
drop _merge
sort HHID PN
save parents2, replace

Top


Respondent Record with Mother and Father Variables: 1996

Note: Modify variable list as needed; for a listing of parent (and equivalent parent-in-law) variables consult the 1996 Parent to Parent-in-Law Variables Cross-Reference Table .

*   STEP 1:  PARENT INFORMATION FOR FAMILY RESPONDENTS' PARENTS
use c:\temp\H96D_H

keep if EPN_FAM~=""

gen PN  =EPN_FAM
gen EPN_SP=EPN_NFAM

*   KEEP PARENT VARIABLES OF INTEREST
keep    HHID PN EPN_SP ESUBHH E1557_1 E1566_1
save FAMR, replace

*   STEP 2:  PARENT INFORMATION FOR NON-FAMILY RESPONDENTS' PARENTS
use c:\temp\H96D_H
keep if EPN_NFAM~=""

gen PN  =EPN_NFAM
gen EPN_SP=EPN_FAM

*   COPY PARENT-IN-LAW VARIABLES TO OUTPUT VARIABLES LOCATIONS
replace E1557_1=E1557_2
replace E1566_1=E1566_2A

*   KEEP PARENT VARIABLES OF INTEREST
keep    HHID PN EPN_SP ESUBHH E1557_1 E1566_1
sort  HHID PN
save NFAMR, replace

*   STEP 3:  CONCATENATE TWO PARENT FILES
use famr
sort HHID PN
merge HHID PN using nfamr
drop _merge
sort HHID PN
save parents2, replace

Top


Respondent Record with Mother and Father Variables: 1994

*   REFORMAT PARENTS FILE TO ONE PER RESPONDENT
*   STEP 1: SORT W2PARS FILE
use c:\temp\w2pars, clear
sort HHID PN CSUBHH
save w2parst, replace

*   STEP 2: CREATE FILE WITH MOTHER RECORDS
use w2parst
keep if  CPARCODE == "1"

    rename  W8201  W8201M
    rename  W8202  W8202M
    rename  W8203  W8203M
    rename  W8204  W8204M
    rename  W8205  W8205M
    rename  W8206  W8206M
    rename  W8207  W8207M
    rename  W8208  W8208M
    rename  W8209  W8209M
    rename  W8210  W8210M
    rename  W8211  W8211M
    rename  W8213  W8213M
    rename  W8214  W8214M
    rename  W8215  W8215M
    rename  W8216  W8216M
    rename  W8217  W8217M
    rename  W8218  W8218M
    rename  W8219  W8219M

keep HHID PN CSUBHH ASUBHH CPN_SP COPN_CS CCSR CFAMR CFINR RPN FAMFLAG W8201M W8202M W8203M W8204M W8205 W8206M W8207M W8208M W8209M W8210M W8211M W8213M W8214M W8215 W8216M W8217M W8218M W8219M

save mom, replace

*   STEP 3: CREATE FILE WITH FATHER RECORDS
use w2parst
keep if CPARCODE == "2"

    rename W8201  W8201F
    rename W8202  W8202F
    rename W8203  W8203F
    rename W8204  W8204F
    rename W8205  W8205F
    rename W8206  W8206F
    rename W8207  W8207F
    rename W8208  W8208F
    rename W8209  W8209F
    rename W8210  W8210F
    rename W8211  W8211F
    rename W8213  W8213F
    rename W8214  W8214F
    rename W8215  W8215F
    rename W8216  W8216F
    rename W8217  W8217F
    rename W8218  W8218F
    rename W8219  W8219F

keep HHID PN CSUBHH ASUBHH CPN_SP COPN_CS CCSR CFAMR CFINR RPN FAMFLAG W8201F W8202F W8203F W8204F W8205 W8206F W8207F W8208F W8209F W8210F W8211F W8213F W8214F W8215 W8216F W8217F W8218F W8219F
save dad, replace

*   STEP 4: CREATE FILE WITH PARENT RECORDS
use w2parst
keep if  CPARCODE == "3"

    rename W8209 W8209P
    rename W8210 W8210P
    rename W8211 W8211P
    rename W8212 W8212P
    rename W8213 W8213P
    rename W8214 W8214P
    rename W8215 W8215P
    rename W8216 W8216P
    rename W8217 W8217P
    rename W8218 W8218P
    rename W8219 W8219P

keep HHID PN CSUBHH ASUBHH CPN_SP COPN_CS CCSR CFAMR CFINR RPN FAMFLAG W8209P W8210P W8211P W8212P W8213P W8214P W8215 W8216P W8217P W8218P W8219P
save parent, replace

*   STEP 5: MERGE MOTHER FATHER AND PARENT FILES
use parent
sort HHID PN CSUBHH
merge HHID PN CSUBHH using mom
drop _merge
sort HHID PN CSUBHH
merge HHID PN CSUBHH using dad
drop _merge
sort HHID PN CSUBHH
save parent2, replace

Top


Respondent Record with Mother and Father Variables: 1992

*   REFORMAT PARENTS FILE FROM ONE PER PARENT TO ONE PER RESPONDENT
*   STEP 1: SORT PARENTS FILE
use c:\temp\parents
sort  HHID PN
save parent1, replace

*   STEP 2: CREATE FILE WITH MOTHER RECORDS
use parent1
keep if ATYPEPAR == "1"

    rename V8201  V8201M
    rename V8202  V8202M
    rename V8203  V8203M
    rename V8204  V8204M
    rename V8205  V8205M
    rename V8206  V8206M
    rename V8207  V8207M
    rename V8208  V8208M
    rename V8209  V8209M
    rename V8210  V8210M
    rename V8211  V8211M
    rename V8212  V8212M
    rename V8213  V8213M
    rename V8214  V8214M
    rename V8215  V8215M
    rename V8216  V8216M
    rename V8217  V8217M
    rename V8218  V8218M
    rename V8219  V8219M
    rename V8220  V8220M
    rename V8221  V8221M
    rename V8222  V8222M
    rename V8223  V8223M
    rename V8224  V8224M

    rename V18205  V18205M
    rename V18206  V18206M
    rename V18207  V18207M
    rename V18208  V18208M
    rename V18209  V18209M
    rename V18210  V18210M
    rename V18211  V18211M
    rename V18213  V18213M
    rename V18214  V18214M
    rename V18215  V18215M
    rename V18216  V18216M
    rename V18217  V18217M
    rename V18218  V18218M
    rename V18219  V18219M
    rename V18220  V18220M
    rename V18221  V18221M
    rename V18222  V18222M
    rename V18223  V18223M
    rename V18224  V18224M

keep    HHID PN ASUBHH APN_SP AFAMR AFINR V1 V2 V3 V8201M V8202M V8203M V8204M V8205M V8206M V8207M V8208M V8209M V8210M V8211M V8212M V8213M V8214M V8215M V8216M V8217M V8218M V8219M V8220M V8221M V8222M V8223M V8224M V18205M V18206M V18207M V18208M V18209M V18210M V18211M V18213M V18214M V18215M V18216M V18217M V18218M V18219M V18220M V18221M V18222M V18223M V18224M

save mothers, replace

*   STEP 3: CREATE FILE WITH FATHER RECORDS
use parent1
keep if ATYPEPAR=="2"

    rename V8201  V8201F
    rename V8202  V8202F
    rename V8203  V8203F
    rename V8204  V8204F
    rename V8205  V8205F
    rename V8206  V8206F
    rename V8207  V8207F
    rename V8208  V8208F
    rename V8209  V8209F
    rename V8210  V8210F
    rename V8211  V8211F
    rename V8212  V8212F
    rename V8213  V8213F
    rename V8214  V8214F
    rename V8215  V8215F
    rename V8216  V8216F
    rename V8217  V8217F
    rename V8218  V8218F
    rename V8219  V8219F
    rename V8220  V8220F
    rename V8221  V8221F
    rename V8222  V8222F
    rename V8223  V8223F
    rename V8224  V8224F

    rename V18205  V18205F
    rename V18206  V18206F
    rename V18207  V18207F
    rename V18208  V18208F
    rename V18209  V18209F
    rename V18210  V18210F
    rename V18211  V18211F
    rename V18213  V18213F
    rename V18214  V18214F
    rename V18215  V18215F
    rename V18216  V18216F
    rename V18217  V18217F
    rename V18218  V18218F
    rename V18219  V18219F
    rename V18220  V18220F
    rename V18221  V18221F
    rename V18222  V18222F
    rename V18223  V18223F
    rename V18224  V18224F

keep    HHID PN ASUBHH APN_SP AFAMR AFINR V1 V2 V3 V8201F V8202F V8203F V8204F V8205F V8206F V8207F V8208F V8209F V8210F V8211F V8212F V8213F V8214F V8215F V8216F V8217F V8218F V8219F V8220F V8221F V8222F V8223F V8224F V18205F V18206F V18207F V18208F V18209F V18210F V18211F V18213F V18214F V18215F V18216F V18217F V18218F V18219F V18220F V18221F V18222F V18223F V18224F
save fathers, replace

*   STEP 4: MERGE MOTHER AND FATHER FILES
use fathers
sort HHID PN
merge HHID PN using mothers
drop _merge
sort HHID PN
save parents2, replace
Top