Intergenerational Linking of NLSY79 Mothers and Their Young Adult Daughters
SPSS code for Step 3
Part A
/* sort two data sets by mother id, and then merge
/* data files are "free" or "space-delimited" format
data list file=' _your filename and location for NLSY79 data here_' list/
R0000100
R0216500
R0406510
R0619010
R0898310
R0898840
R1145110
R1146832
R1520310
R1522039
R1891010
R1892739
R2258110
R2259839
R2445510
R2448039
R2871300
R2877800
R3075000
R3076844
R3401700
R3407900
R3657100
R3659049
R4007600
R4009449
R4418700
R4444900
R5081700
R5087700
R5167000
R5173000
R6479800
R6486600
R7007500
R7014400
R7704800
R7712000
R8497200
R8504500
T0989000
T0996200
execute
/* rename NLSY79 id to match name of mother id variable in child dataset
compute momid=r0000100
/* following "list" command can be deleted to reduce size of *.log file
list
save outfile="datmom.sav"
data list file='_your filename and location for Child/Young Adult data here_' list/
C0000100
C0000200
Y0000100
Y0342400
Y0677400
Y0677600
Y0974800
Y1192400
Y1205100
Y1211100
Y1434300
Y1672700
Y1948500
execute
/* rename mother id to match name of variable in mom dataset
compute momid=c0000200
/* following "list" command can be deleted to reduce size of *.log file
list
save outfile="datkid.sav"
get file="datmom.sav"
sort cases by momid
save outfile="datmom2.sav"
get file="datkid.sav"
sort cases by momid
save outfile="datkid2.sav"
match files file="datkid2.sav" /table="datmom2.sav" /by=momid
/* following "list" command can be deleted to reduce size of *.log file
list
/* eliminate NLSY79 respondents with no children in child data set, final data set has 11469
/* observations using data through 2006
select if not(sysmis(c0000200))
/* rename NLSY79 id to match name of mother id variable in child dataset
compute momid = c0000200
sort cases by momid
Part B
/* create variables for age and year of last interview for mom
/* note that we name these variables to start with an "m" to denote that these are variables for
/* the mother
do if (t0989000 gt 0)
compute magelint = t0989000
compute myrlint = 2006
/* repeat for all intervening years
/* note that we redefine these variables each time "age at interview" is reported to
/* find the age at last interview
else if (r0898310 gt 0)
compute magelint = r0898310
compute myrlint = 1982
else
compute magelint = -4
compute myrlint = -4
end if
/* create variable indicating that mom had a teen birth
/* note that we define this variable only for women ages 18 and over
/* currently age 18 or over and age at 1st birth is between 0 and 17
do if (magelint ge 18 and myrlint eq 2006 and t0996200 gt 0 and t0996200 lt 18)
compute mtnbirth=1
/*currently age 18 or over and age at 1st birth is 18 or greater, so no teen birth
else if (magelint ge 18 and myrlint eq 2006 and t0996200 ge 18)
compute mtnbirth=0
/* currently age 18 or over and never gave birth, so no teen birth
else if (magelint ge 18 and myrlint eq 2006 and t0996200 eq -998)
compute mtnbirth=0
/* repeat for each year-- this strategy lets us define these variables using data reported at the
/* last interview
else if (magelint ge 18 and myrlint eq 1982 and r0898840 gt 0 and r0898840 lt 18)
compute mtnbirth=1
else if (magelint ge 18 and myrlint eq 1982 and r0898840 ge 18)
compute mtnbirth=0
else if (magelint ge 18 and myrlint eq 1982 and r0898840 eq -998)
compute mtnbirth=0
else
compute mtnbirth=-4
end if
/* using data through 2006
/* m_teenbirth (mean = .201, N = 11463)
/* m_year_lint (mean =2002, N = 11465)
/* m_age_lint (mean =41.4, N = 11465)
Part C
/* restrict sample to female young adults, drops 8322 observations using data through 2006
/* sample size is now 3147
select if (y0677400 eq 2)
/*create variables for age and year of last interview for young adult
/*note that we name these variables to start with "y" to denote that these are variables
/* for the young adult
if (y1205100 gt 0) yyrlint = y1205100
do if (yyrlint eq 2006)
compute yagelint = y1948500
/* repeat for each year--this strategy lets us define these variables using
/* data reported at the last interview
else if (yyrlint eq 1994)
compute yagelint = y0342400
end if
/* create variable indicating that female young adults who are 18 or over had a teen birth
/* currently age 18 or over and age at 1st birth is between 0 and 17
do if (yagelint ge 18 and y1211100 gt 0 and y1211100 lt 18)
compute ytnbirth=1
/* currently age 18 or over and age at 1st birth is 18 or greater, so no teen birth
else if (yagelint ge 18 and y1211100 ge 18)
compute ytnbirth=0
/* currently age 18 or over and never gave birth, so no teen birth
else if (yagelint ge 18 and y1211100 eq -998)
compute ytnbirth=0
end if
/* Final Statistics from Program: Data through 2006 survey;
/* m_teenbirth (mean = .249, N = 3147)
/* y_teenbirth (mean = .137, N = 2419) smaller sample size because only created
/* for those at least 18
/* y_year_lint (mean = 2006, N = 3147)
/* y_age_lint (mean = 21.3, N = 3147)
/* m_year_lint (mean = 2005, N = 3147)
/* m_age_lint (mean = 44.6, N = 3147)