/* File: 17th_pums_mixed.do Date: Feb 11, 2005 Desc: Processes extract variables that require both household- and person-level data */ /* Determine data year */ local year=`1' /* get data year from 17th_pums_master.do */ /* senior citizen in household in 1980 */ if `year'==1980 { sort state serialno by state serialno: egen maxage=max(age) replace pergt64=0 replace pergt64=1 if (65<=maxage & maxage~=.) drop maxage } /* household includes non-nuclear family members */ if `year'==1980 { /* in 1980, relat1 is a person-level, not household-level variable */ gen byte nn=1 if relat1==5 sort state serialno subfamn age by state serialno: egen knn=max(nn) replace nonnuc=0 replace nonnuc=1 if knn==1 drop nn knn } /* employment structure for mcf */ gen byte zmf2=0 if mcf==1 /* zmf2: zero work; male works; female works; two work */ if `year'==1980 { * total employment among mcf * identify male working reference persons or spouses in mcf gen byte mref=1 if mcf==1 & female==0 & (relat1==0 | relat1==1) & lfs==1 * mark all individuals in mcf households with working male reference persons * or spouses sort state serialno by state serialno: egen kmref=max(mref) /* takes value missing or 1 */ * identify female working reference persons or spouse or unmarried partner in * mcf gen byte fref=1 if mcf==1 & female==1 & (relat1==0 | relat1==1) & lfs==1 * mark all individuals in mcf households with working male reference person or * spouse sort state serialno by state serialno: egen kfref=max(fref) /* takes value missing or 1 */ * use preceding two variables to determine whether 0, 1, 2 members of * couple are employed egen totemp=rsum(kmref kfref) * create zmf2 * neither employed replace zmf2=1 if mcf==1 & totemp==0 * male only employed replace zmf2=2 if mcf==1 & totemp==1 & kmref==1 * female only employed replace zmf2=3 if mcf==1 & totemp==1 & kfref==1 * both employed replace zmf2=4 if mcf==1 & totemp==2 drop mref kmref fref kfref totemp } if `year'==1990 { * total employment among mcf * identify male working ref. persons or spouses or unmarried partners in mcf gen byte mref=1 if mcf==1 & sex==0 & (relat1==0 | relat1==1 | relat1==10) & /* */ lfs==1 * mark all individuals in mcf households with working male reference persons * or spouses sort state serialno by state serialno: egen kmref=max(mref) /* takes value missing or 1 */ * identify female working reference persons or spouse or unmarried partner in * mcf gen byte fref=1 if mcf==1 & sex==1 & (relat1==0 | relat1==1 | relat1==10) & /* */ lfs==1 * mark all individuals in mcf households with working male reference person or * spouse sort state serialno by state serialno: egen kfref=max(fref) /* takes value missing or 1 */ * use preceding two variables to determine whether 0, 1, 2 members of * couple are employed egen totemp=rsum(kmref kfref) * create zmf2 * neither employed replace zmf2=1 if mcf==1 & totemp==0 * male only employed replace zmf2=2 if mcf==1 & totemp==1 & kmref==1 * female only employed replace zmf2=3 if mcf==1 & totemp==1 & kfref==1 * both employed replace zmf2=4 if mcf==1 & totemp==2 drop mref kmref fref kfref totemp } if `year'==2000 { * total employment among mcf * identify male working reference persons or spouses in mcf gen byte mref=1 if mcf==1 & sex==1 & (relate==1 | relate==2 | relate==19) & /* */ lfs==1 * mark all individuals in mcf households with working male ref. persons or * spouses sort state serialno by state serialno: egen kmref=max(mref) /* takes value missing or 1 */ * identify female working reference persons or spouse in mcf gen byte fref=1 if mcf==1 & sex==2 & (relate==1 | relate==2 | relate==19) & /* */ lfs==1 * mark all individuals in mcf households with working male reference person or * spouse sort state serialno by state serialno: egen kfref=max(fref) /* takes value missing or 1 */ * use preceding two variables to determine whether 0, 1, 2 members of * couple are employed egen totemp=rsum(kmref kfref) * create zmf2 * neither employed replace zmf2=1 if mcf==1 & totemp==0 * male only employed replace zmf2=2 if mcf==1 & totemp==1 & kmref==1 * female only employed replace zmf2=3 if mcf==1 & totemp==1 & kfref==1 * both employed replace zmf2=4 if mcf==1 & totemp==2 drop mref kmref fref kfref totemp } lab var zmf2 "Employment structure, married couple families" lab def zmf2 1 None 2 Male 3 Female 4 Both lab val zmf2 zmf2 notes zmf2: Based on hhtype, relat1, lfs, female in 1980 notes zmf2: Based on rhhfamtp, relat1, rlabor, sex in 1990 notes zmf2: Based on htt, relate, esr, sex in 2000