Appendix 3: Family Background and Formation Variable Creation

Return to Table of Contents


Household Size as of the Survey Date

Variables Created:

1. Household size = HHSIZE = CV_HH_SIZE
2. Number of household members less than 6 years old = UNDER6 = CV_HH_UNDER_6
3. Number of household members less than 18 years old = UNDER18 = CV_HH_UNDER_18CV_HH_SIZE

Variables Used

Variable Name in Program

Question in Survey

pubid

PUBID
HAGE01 HHI AGE (ROS ITEM) L1 2002

HAGE02

HHI AGE (ROS ITEM) L2 2002

HAGE03

HHI AGE (ROS ITEM) L3 2002

HAGE04

HHI AGE (ROS ITEM) L4 2002

HAGE05 HHI AGE (ROS ITEM) L5 2002
HAGE06 HHI AGE (ROS ITEM) L6 2002
HAGE07 HHI AGE (ROS ITEM) L7 2002
HAGE08 HHI AGE (ROS ITEM) L8 2002
HAGE09 HHI AGE (ROS ITEM) L9 2002
HAGE10 HHI AGE (ROS ITEM) L10 2002
HAGE11 HHI AGE (ROS ITEM) L11 2002
HAGE12 HHI AGE (ROS ITEM) L12 2002
HAGE13 HHI AGE (ROS ITEM) L13 2002
HAGEST01 HHI, ESTIMATED AGE OF HH MEMBER 01 AS OF INTDATE (ROS ITEM) 2002
HAGEST02 HHI, ESTIMATED AGE OF HH MEMBER 02 AS OF INTDATE (ROS ITEM) 2002
HAGEST03 HHI, ESTIMATED AGE OF HH MEMBER 03 AS OF INTDATE (ROS ITEM) 2002
HAGEST04 HHI, ESTIMATED AGE OF HH MEMBER 04 AS OF INTDATE (ROS ITEM) 2002
HAGEST05 HHI, ESTIMATED AGE OF HH MEMBER 05 AS OF INTDATE (ROS ITEM) 2002
HAGEST06 HHI, ESTIMATED AGE OF HH MEMBER 06 AS OF INTDATE (ROS ITEM) 2002
HAGEST07 HHI, ESTIMATED AGE OF HH MEMBER 07 AS OF INTDATE (ROS ITEM) 2002
HAGEST09 HHI, ESTIMATED AGE OF HH MEMBER 08 AS OF INTDATE (ROS ITEM) 2002
HUID01 HHI UID (ROS ITEM) L12002
HUID02 HHI UID (ROS ITEM) L22002
HUID03 HHI UID (ROS ITEM) L32002
HUID04 HHI UID (ROS ITEM) L42002
HUID05 HHI UID (ROS ITEM) L52002
HUID06 HHI UID (ROS ITEM) L62002
HUID07 HHI UID (ROS ITEM) L72002
HUID08 HHI UID (ROS ITEM) L82002
HUID09 HHI UID (ROS ITEM) L92002
HUID10 HHI UID (ROS ITEM) L102002
HUID11 HHI UID (ROS ITEM) L112002
HUID12  HHI UID (ROS ITEM) L122002
HUID13  HHI UID (ROS ITEM) L132002
RSAGE SYMBOL!KEY!AGE

This program creates several variables describing the composition of the respondent's household: the total number of residents, the number of residents under age 6, and the number of residents under age 18.


ARRAY HAGE HAGE01-HAGE13;

ARRAY HUID HUID01-HUID13;

ARRAY HAGEST HAGEST01-HAGEST13;

 

/* Create dummy variables HHDUM[I] (I=1 TO 13) that equal one if the ith member has a member ID, and zero if the ith member does not have a member ID (i.e.HHID0i=-4).Also create dummies for the age:DUM6[I] (I=1 TO 13) that equal 1 if the ith household member is under age 6 and DUM18[I] (I=1 TO 13) that equal 1 if the ith household member is under age 18.*/

 

ARRAY HHDUM HHDUM01-HHDUM13;
ARRAY DUM6 DUM601-DUM613;
ARRAY DUM18 DUM1801-DUM1813;

 

DO I=1 TO 13;
HHDUM[I]=0;
DUM6[I]=0;
DUM18[I]=0;
END;

DO I=1 TO 13;
IF HUID[I]>-1 THEN HHDUM[I]=1;
IF -1<HAGE[I]<6 THEN DUM6[I]=1;
IF -1<HAGE[I]<18 THEN DUM18[I]=1;
IF -4<HAGE[I]<0 AND HAGEST[I]=1 THEN DO;
DUM18[I]=1;
UND6=-3;
END;
IF -4<HAGE[I]<0 AND HAGEST[I]=2 THEN DUM18[I]=1;
END;

 

/* Create the dummy for the respondent's age RDUM6 AND RDUM18. */
RDUM6=0;
RDUM18=0;

IF -1<RSAGE<6 THEN RDUM6=1;
IF -1<RSAGE<18 THEN RDUM18=1;

 

/* Create household size HHSIZE by adding up the dummies HHDUM[I] and also add one due to the respondent himself.
Similarly, create variables UNDER6 AND UNDER18 by adding up the other two dummies.*/

HHSIZE=1;
UNDER6=RDUM6;
UNDER18=RDUM18;

DO I=1 TO 13;
HHSIZE=HHSIZE+HHDUM[I];
UNDER6=UNDER6+DUM6[I];
UNDER18=UNDER18+DUM18[I];
END;

IF HUID01=-5 THEN HHSIZE=-5;
do I=1 TO 13;
IF -4<HUID[I]<0 THEN HHSIZE=-3;
END;

IF HUID01=-5 THEN UNDER6=-5;
IF HUID01=-5 THEN UNDER18=-5;
DO I=1 TO 13;
IF -4<HAGE[I]<0 THEN PRT1=-3;
END;

Do I=1 TO 13;
IF -4<HAGEST[I]<0 AND PRT1=-3 THEN PRT2=-3;
END;

IF PRT2=-3 OR HHSIZE=-3 THEN DO;
UNDER6=-3;
UNDER18=-3;
END;
IF UND6=-3 THEN DO;
UNDER6=-3;
END;

ENDSAS;

 

Return to top


Youth's Relationship to Household Parent Figure(s)

Variable Created: CV_YTH_REL_HH_CURRENT: Relationship of the parent figure(s)/guardian(s) in household to the youth as of the survey date.

Variables Used

Question Name

Name in Program

Question Name

Name in program

Round 6:

 

Round 1:

 

(all HHI_ in R6)

 

HHI2_UID.01-.17

HH1UID01-17

HHI_AGE.01-.13

hhage01-13

SH93.01-.05 SH931-5

HHI_UID.01-.13

HH2UID01-13

YOUTH_ID.01 

YID

HHI_MARSTAT.01-.13

marry_1-13

 

 
HHI_RELY.01-.13 rel_1-13

 

 
SYMBOL!KEY!AGE age    

Codes for Created Variable

-5 = Non-Interview

6 = Adoptive parent(s)

1 = Both biological parents 7 = Foster parent(s)
2 = Two parents, biological mother 8 = No parents, grandparents
3 = Two parents, biological father 9 = No parents, other relatives
4 = Biological mother only 10 = Anything else
5 = Biological father only  

NOTE: In some cases Rs did not report a relationship code for one or more household members (coded as -3). In such cases, if a parent/parent figure was reported in the household, the R received the correct code for that relationship. If no parent figure was reported and R is over 18, R  received a code of "10" on the CV. If no parent figure was reported and R is under 18, R received a code of "-3" on the CV.*/

This program creates a variable identifying the youth's relationship to the primary adults in the household. In rounds 2-5 there was no information collected on the legal guardian of the youth, so it is not possible to determine whether respondents are living with non-parent relatives because they are guardians or because the living situation is better (e.g., closer to school, no rent).  For this reason, youths above the age 18 and above are considered independent and, if they are not living with an identified parent or parent-figure (legal guardian), are put into the anything else category. Youths below the age of 18 who are not living with an identified parent or parent-figure are put into the category that most closely matches their household situation.


/*In round 6 there is no information collected on the legal guardian of the youth,
so it is not possible to determine whether respondents are living with non-parent
relatives because they are guardians or relatives because the living situation is
better (e.g., near to school, no rent). For this reason, youths at the age 18
and above are considered independent and, if not living with an identified parent
or parent figure (legal guardian) are put into the anything else category. Youths
below the age of 18 who are not living with an identified parent or parent figure
are put into the category that most closely matches their household situation.*/


*set hhage to 25 when actual age of hh members is unknown, but estimated to be over 25 (est. age var=4, 5, 6);
if ageest01>3 then hhage01=25;
if ageest02>3 then hhage02=25;
if ageest03>3 then hhage03=25;
if ageest04>3 then hhage04=25;
if ageest05>3 then hhage05=25;
if ageest06>3 then hhage06=25;
if ageest07>3 then hhage07=25;
if ageest09>3 then hhage09=25;
*set hhage to 17 when actual age of hh members is unknown, but estimated to be under 18 (est. age var=1, 2);
if ageest01=1 or ageest01=2 then hhage01=17;
if ageest02=1 or ageest02=2 then hhage02=17;
if ageest03=1 or ageest03=2 then hhage03=17;
if ageest04=1 or ageest04=2 then hhage04=17;
if ageest05=1 or ageest05=2 then hhage05=17;
if ageest06=1 or ageest06=2 then hhage06=17;
if ageest07=1 or ageest07=2 then hhage07=17;
if ageest09=1 or ageest09=2 then hhage09=17;

array rel_a (i) rel_1-rel_16;
array marry_a (i) marry_1-marry_16;
array age_a (i) hhage01-hhage16;

*this part determines legal guardians so that we can determine whether any guardians are present from the R1 interview use only unique IDs (cases with 6 digits are

hh members after R1 only, so this program won't do anything with them, as we don't have info on legal guardian status for these HH members ;

array hh1uid (i) hh1uid01-hh1uid16; *round 1 variable;
array hh2uid (i) hh2uid01-hh2uid16; *round 6 variable;


do i=1 to 16;
if yid=1 and sh931>0 and sh931+100=hh1uid then do;
uid=hh1uid;
end;
if yid=2 and sh932>0 and sh932+100=hh1uid then do;
uid=hh1uid;
end;
if yid=3 and sh933>0 and sh933+100=hh1uid then do;
uid=hh1uid;
end;
if yid=4 and sh934>0 and sh934+100=hh1uid then do;
uid=hh1uid;
end;
if yid=5 and sh935>0 and sh935+100=hh1uid then do;
uid=hh1uid;
end;
end;

do i=1 to 16;
if (uid ne . and uid=hh2uid) then line=i;
end;

legal=0;
do i=1 to 16;
if line=i then legal=rel_a;
end;

momid=0;
domid=0;
adopdad=0;
admom=0;
fostma=0;
fostda=0;
stepma=0;
stepda=0;
husb=0;
wife=0;
grand=0;
relat=0;
nonrel=0;
indep=0;
spouse=0;
both=0;
**legal;
do i=1 to 16;
if (legal>28 and legal<37) then do;
grand=1;
end;
*spouse;
if legal=1 or legal=2 then do;
spouse=1;
end;
*brother/sister;
if (legal>12 and legal<19) and age_a>20 then do;
relat=1;
end;
*aunt or uncle and other relatives;
if (legal>69 and legal<85) and age_a>20 then do;
relat=1;
end;
*lover, roommate, other non-relative, mom's or dad's partner;
if legal=69 or legal=68 or legal=85 or legal=88 or legal=89 then do;
nonrel=1;
end;
if legal=-1 or legal=-2 or legal=-3 then do;
invalid=1;
end;
if rel_1=-4 and rel_2=-4 and rel_3=-4 and rel_4=-4 and rel_5=-4 and rel_6=-4 and rel_7=-4 and
rel_8=-4 and rel_9=-4 and rel_10=-4 and rel_11=-4 and rel_12=-4 and rel_13=-4 and rel_14=-4 then do;
indep=1;
end;
end;
**not legal;
do i=1 to 16;
if (rel_a>28 and rel_a<37) then do;
nlgrand=1;
end;
*spouse;
if rel_a=1 or rel_a=2 then do;
nlspouse=1;
end;
*brother/sister;
if (rel_a>12 and rel_a<19) and age_a>20 then do;
nlrelat=1;
end;
*aunt or uncle and other relatives;
if (rel_a>69 and rel_a<85) and age_a>20 then do;
nlrelat=1;
end;
*lover, roommate, other non-relative, mom's or dad's partner;
if rel_a=69 or rel_a=68 or rel_a=85 or rel_a=88 or rel_a=89 then do;
nlnnrl=1;
end;
if rel_a=-1 or rel_a=-2 or rel_a=-3 then do;
nlinv=1;
end;
end;


/*problem is a variable to check whether R did not report a relationship code for one or more household members*/
problem=0;

do i=1 to 16;
if rel_a=-1 or rel_a=-2 or rel_a=-3 then problem=1;
end;


if age<18 then do;
if nlgrand ne . and legal=0 then grand=nlgrand;
if nlspouse ne . and legal=0 then spouse=nlspouse;
if nlrelat ne . and legal=0 then relat=nlrelat;
if nlnnrl ne . and legal=0 then nonrel=nlnnrl;
if nlinv ne . and legal=0 then invalid=nlinv;
end;



*for all youths;
if nlspouse ne . then spouse=nlspouse;

do i=1 to 16;
if rel_a=3 then momid=i;
if rel_a=4 then domid=i;
if rel_a=5 then admom=i;
if rel_a=6 then adopdad=i;
if rel_a=7 then stepma=i;
if rel_a=8 then stepda=i;
if rel_a=9 then fostma=i;
if rel_a=10 then fostda=i;
end; 

 

*used to determine whether single parent households contain another parent.
If so hand edits are done below;



/* This section is blocked out because if Rs mom or dad is married, a parental figure (i.e. stepmother or adoptive father) should show up as a household

member if they live with R. In cases where Rs parent is married, but the spouse does not appear to live in the home, R is coded 4 (bio mother only) or 5 (bio father

only) for HH adult relationship to R.

do i=1 to 16;
if momid>0 then do;
if momid=i and marry_a=1 then husb=i;
end;
end;

do i=1 to 16;
if domid>0 then do;
if domid=i and marry_a=1 then wife=i;
end;
end;
*/

rel=-16;

if age>17 then do;
rel=10;
end;

if marry_1=-5 then do;
rel=-5;
end;

if indep=1 then do;
rel=10;
end;

if invalid=1 then do;
rel=-3;
end;

if nonrel>0 then do;
rel=10;
end;

if relat>0 then do;
rel=9;
end;


if grand>0 and momid=0 and domid=0 then do;
rel=8;
end;

if spouse=1 then do;
rel=10;
end;

if fostda>0 or fostma>0 then do;
rel=7;
end;

if admom>0 or adopdad>0 then do;
rel=6;
end;

if stepda>0 or stepma>0 then do;
rel=10;
end;

if domid>0 and momid=0 then do;
rel=5;
end;

if momid>0 and domid=0 then do;
rel=4;
end;


if domid>0 and momid=0 then do;
if admom>0 or stepma>0 then rel=3;
end;

if momid>0 and domid=0 then do;
if adopdad>0 or stepda>0 then rel=2;
end;


if momid>0 and domid>0 then do;
both=1;
rel=1;
end;

if rel=-16 then rel=10;

endsas;

 

Return to top


Youth's Marital Status and Marital/Cohabitation History

Variables Created: CV_MARSTAT
                                CV_MARSTAT_COLLAPSED
                                CV_FIRST_COHAB_DATE_M
                                CV_FIRST_COHAB_DATE_Y
                                CV_FIRST_MARRY_DATE_M
                                CV_FIRST_MARRY_DATE_Y
                                CV_FIRST_COHAB_MONTH
                                CV_FIRST_MARRY_MONTH
                                CV_COHAB_TTL
                                CV_MARRIAGES_TTL

Variables Used

Name in Program

Question Name on CD

Name in Program

Question Name on CD

m700r1 YMAR.700.1997 M620 YMAR.620.2001
m45001r1 YMAR.4500.01.1997 M650 YMAR.650.2001
m45002r1 YMAR.4500.02.1997 M700 YMAR.700.2001
m540011r1 YMAR.5400.01.01.1997 M710 YMAR.710.2001
m540012r1 YMAR.5400.01.02.1997 M712 YMAR.712.2001
FCOH.Mr1 CV.FIRST.COHAB.DATE.M.1997 M714 YMAR.714.2001
FCOH.Yr1 CV.FIRST.COHAB.DATE.Y.1997 M718 YMAR.718.2001
FCOHCMr1 CV.FIRST.COHAB.MONTH.1997 M729D YMAR.729D.2001
FMAR.Mr1 CV.FIRST.MARRY.DATE.M.1997 M730 YMAR.730.2001
FMAR.Yr1 CV.FIRST.MARRY.DATE.Y.1997 M760 YMAR.760.2001
FMARMr1 CV.FIRST.MARRY.MONTH.1997 M31001M YMAR.3100.01.M.2001
INT.Dr1 CV.INTERVIEW.DATE.D.1997 M31001Y YMAR.3100.01.Y.2001
INT.Mr1 CV.INTERVIEW.DATE.M.1997 M31002M YMAR.3100.02.M.2001
INT.Yr1 CV.INTERVIEW.DATE.Y.1997 M31002Y YMAR.3100.02.Y.2001
MARSTAT1 CV.MARSTAT.1997 M31003M YMAR.3100.03.M.2001
CMARSTA1 CV.MARSTAT.COLLAPSED.1997 M31003Y YMAR.3100.03.Y.2001
COH.TTL1 CV.MARRIAGES.TTL.1997 M31004M YMAR.3100.04.M.2001
MAR.TTL1 CV.MARRIAGES.TTL.1997 M31004Y YMAR.3100.04.Y.2001
M45001 YMAR.4500.01.2001
m700r2 YMAR.700.1998 M45002 YMAR.4500.02.2001
M45001r2 YMAR.4500.01.1998 M45003 YMAR.4500.03.2001
M45002r2 YMAR.4500.02.1998 M45004 YMAR.4500.04.2001
M45003r2 YMAR.4500.03.1998 M46501 YMAR.4650.01.2001
M54011r2 YMAR.5400.01.01.1998 M46502 YMAR.4650.02.2001
M54012r2 YMAR.5400.01.02.1998 M46503 YMAR.4650.03.2001
FCOH.Mr2 CV.FIRST.COHAB.DATE.M.1998 M46504 YMAR.4650.04.2001
FCOH.Yr2 CV.FIRST.COHAB.DATE.Y.1998 M47001 YMAR.4700.01.2001
FCOHCMr2 CV.FIRST.COHAB.MONTH.1998 M47002 YMAR.4700.02.2001
FMAR.Mr2 CV.FIRST.MARRY.DATE.M.1998 M47003 YMAR.4700.03.2001
FMAR.Yr2 CV.FIRST.MARRY.DATE.Y.1998 M47004 YMAR.4700.04.2001
FMARMr2 CV.FIRST.MARRY.MONTH.1998 M48001M YMAR.4800.01.M.2001
INT.Dr2 CV.INTERVIEW.DATE.D.1998 M48001Y YMAR.4800.01.Y.2001
INT.Mr2 CV.INTERVIEW.DATE.M.1998 M48002M YMAR.4800.02.M.2001
INT.Yr2 CV.INTERVIEW.DATE.Y.1998 M48002Y YMAR.4800.02.Y.2001
MARSTAT2 CV.MARSTAT.1998 M48003M YMAR.4800.03.M.2001
CMARSTA2 CV.MARSTAT.COLLAPSED.1998 M48003Y YMAR.4800.03.Y.2001
COH.TTL2 CV.COHAB.TTL.1998 M48003M YMAR.4800.04.M.2001
MAR.TTL2 CV.MARRIAGES.TTL.1998 M48003Y YMAR.4800.04.Y.2001
M540011 YMAR.5400.01.01.2001
m700r3 YMAR.700.1999 M540012 YMAR.5400.01.02.2001
M45001r3 YMAR.4500.01.1999 M560012M YMAR.5600.01.02.M.2001
M45002r3 YMAR.4500.02.1999 M560012Y YMAR.5600.01.02.Y.2001
m54011r3 YMAR.5400.01.01.1999 M570011M YMAR.5700.01.01.M.2001
M54012r3 YMAR.5400.01.02.1999 M570011Y YMAR.5700.01.01.Y.2001
FCOH.Mr3 CV.FIRST.COHAB.DATE.M.1999 M570012M YMAR.5700.02.01.M.2001
FCOH.Yr3 CV.FIRST.COHAB.DATE.Y.1999 M570012Y YMAR.5700.02.01.Y.2001
FCOHCMr3 CV.FIRST.COHAB.MONTH.1999 M700011M YMAR.7000.01.01.M.2001
FMAR.Mr3 CV.FIRST.MARRY.DATE.M.1999 M700011Y YMAR.7000.01.01.Y.2001
FMAR.Yr3 CV.FIRST.MARRY.DATE.Y.1999 M700012M YMAR.7000.01.02.M.2001
FMARMr3 CV.FIRST.MARRY.MONTH.1999 M700012y YMAR.7000.01.02.Y.2001
INT.Dr3 CV.INTERVIEW.DATE.D.1999 M7900111 YMAR.7900.01.01.01.2001
INT.Mr3 CV.INTERVIEW.DATE.M.1999 M7900211 YMAR.7900.02.01.01.2001
INT.Yr3 CV.INTERVIEW.DATE.Y.1999 M810111M YMAR.8100.01.01.01.M.2001
MARSTAT3 CV.MARSTAT.1999 M810111Y YMAR.8100.01.01.01.Y.2001
CMARSTA3 CV.MARSTAT.COLLAPSED.1999 M8200111M YMAR.8200.01.01.01.M.2001
COH.TTL3 CV.COHAB.TTL.1999 M8200111Y YMAR.8200.01.01.01.Y.2001
MAR.TTL3 CV.MARRIAGES.TTL.1999 M8200112M YMAR.8200.01.01.02.M.2001
M8200112Y YMAR.8200.01.01.02.Y.2001
m700r4 YMAR.700.2000 M8200113M YMAR.8200.01.01.03.M.2001
M45001r4 YMAR.4500.01.2000 M8200113Y YMAR.8200.01.01.03.Y.2001
M45002r4 YMAR.4500.02.2000 M8200114M YMAR.8200.01.01.04.M.2001
M45003r4 YMAR.4500.03.2000 M8200114Y YMAR.8200.01.01.04.Y.2001
M45004r4 YMAR.4500.04.2000 M8200211M YMAR.8200.02.01.01.M.2001
m54011r4 YMAR.5400.01.01.2000 M8200211Y YMAR.8200.02.01.01.Y.2001
M54012r4 YMAR.5400.01.02.2000 M910011 YMAR.9100.01.01.2001
m54021r4 YMAR.5400.02.01.2000 M910012 YMAR.9100.01.02.2001
M54022r4 YMAR.5400.02.02.2000 M920011M YMAR.9200.01.01.M.2001
FCOH.Mr4 CV.FIRST.COHAB.DATE.M.2000 M920011Y YMAR.9200.01.01.Y.2001
FCOH.Yr4 CV.FIRST.COHAB.DATE.Y.2000 M920012M YMAR.9200.01.02.M.2001
FCOHCMr4 CV.FIRST.COHAB.MONTH.2000 M920012Y YMAR.9200.01.02.Y.2001
FMAR.Mr4 CV.FIRST.MARRY.DATE.M.2000 m11700011y YMAR.11700.01.Y.2001
FMAR.Yr4 CV.FIRST.MARRY.DATE.Y.2000 m11700011m YMAR.11700.02.M.2001
FMARMr4 CV.FIRST.MARRY.MONTH.2000 M114001 YMAR.11400.01.2001
INT.Dr4 CV.INTERVIEW.DATE.D.2000 M114002 YMAR.11400.02.2001
INT.Mr4 CV.INTERVIEW.DATE.M.2000 M114003 YMAR.11400.03.2001
INT.Yr4 CV.INTERVIEW.DATE.Y.2000 INT.D CV.INTERVIEW.DATE.D.2001
MARSTAT4 CV.MARSTAT.2000 INT.M CV.INTERVIEW.DATE.M.2001
CMARSTA4 CV.MARSTAT.COLLAPSED.2000 INT.Y CV.INTERVIEW.DATE.Y.2001
COH.TTL4 CV.COHAB.TTL.2000
MAR.TTL4 CV.MARRIAGES.TTL.2000

Codes for Created Variable

Marital/Cohabitation Status

1 = never married, cohabiting
2 = never married, not cohabiting
3 = married, spouse present
4 = married, spouse absent
5 = separated, cohabiting

6 = separated, not cohabiting
7 = divorced, cohabiting
8 = divorced, not cohabiting
9 = widowed, cohabiting
10 = widowed, not cohabiting

 

Collapsed Marital Status

0 = never married
1 = married
2 = separated
3 = divorced
4 = widowed

 

Marital Status in Event History
0 = never married, not cohabiting
1 = never married, cohabiting
2 = married
3 = separated
4 = divorced
5 = widowed

This program creates two variables that describe marital status/cohabitation status as of the interview date for respondents age 16 and older.  Other respondents are valid skips (-4).  Note that later partners take precedence over earlier partners.

The program also creates variables that provide the dates of the youth's first marriage and/or cohabitation in both a continuous month scheme and as actual dates (for more information on the continuous month scheme, see appendix 7 in this document). Summary variables count the total number of marriages and cohabitations for each youth. If a respondent is cohabiting and then marries it is considered both a cohabitation and a marriage. If someone refuses or doesn't know the full date of their marriage or cohabitation, then the spell is counted in the total variables and the date variables are coded -1 or -2 as applicable.


/* starting date for same cohabiting partner was reported in both R5 and R6. Delete R6 record*/
if pubid in
(976,1355,1386,1439,2019,2097,2493,2739,2788,3430, 4183, 4524,4616,6140,6363,7525,7527,7586,7732,7991,8303,4010)
then do;
m31001m=-4;
m31001y=-4;
end;


/* Starting and stopping dates for same partner reported in R5 and R6. Delete R6 record*/
if pubid in
(658,3327,4050)
then do;
m31001m=-4;
m31001y=-4;
m48001m=-4;
m48001y=-4;
end;

/*Both R5 and R6 have starting dates for the same partner but R6 added new info.
Delete R6 information that already reported in R5*/
if pubid in
(3327,4050,4650,5332,5814,6622,7711,7946,8532,8621,216)then do;
m31001m=m700011m;
m31001y=m700011y;
m48001y=-4;
m48001m=-4;
m46701=1;
M47001=-4;
m700011y=-4;
m700011m=-4;
end;


/* have dates of legal separation, but were never married */
if pubid in(1435,5645,6130,6460) then do;
m7900111=-4;
m540011=-4;
m114001=-4;
m117001y=-4;
m117001m=-4;
m560011y=-4;
m560011m=-4;
end;
if pubid in(5645,6460,5690)then do;
m48001m=m8100111m;
m48001y=m8100111y;
m8100111m=-4;
m8100111y=-4;
m7900111=-4;
end;


/*
Partner #1 and Partner #2 are same person*/
if pubid=7681 or pubid=4561 then do;
m31001m=m31002m;
m31001y=m31002y;
m31002m=-4;
m31002y=-4;
m45002=-4;
m46702=-4;
m47002=-4;
m45001=1;
m46701=1;
end;

if pubid=4561 then p1=p2;
if pubid=6170 then do;
m46701=0;
end;


/* Loop 1 and Loop 2 have same marriage dates. loop 2 dates deleted*/
if pubid= 5298 then do;
m7900112=-4;
m8200112m=-4;
m8200112y=-4;
end;

if pubid=8369 then do;
m7900211=-4;
m8200211m=-4;
m8200211y=-4;
end;

/*Delete partner 3 because partner 3 did not show in roster; correct loop sequence for
partner 1 and partner 2*/
if pubid=7463 then do;
m31001y=2002;
m31001m=10;
m48001y=-4;
m48001m=-4;
m47001=1;
m7900111=-4;
m31002y=2002;
m31002m=8;
m48002y=2002;
m48002m=10;
m47002=0;
m8200211m=-4;
m8200211y=-4;
m7900211=-4;
p1=p2;
p2=601;
m31003m=-4;
m31003y=-4;
m48003m=-4;
m48003y=-4;
m46703=-4;
end;

/* Same separation dates occurred in loop 2 and loop 3. Same partner. delete loop 3*/
if pubid=1435 then do;
m540012=-4;
m540013=-4;
m560012m=-4;
m560012y=-4;
m560013m=-4;
m560013y=-4;
end;

/* Same partner in loop 1 and loop 2, Delete one*/
if pubid = 4801 then do;
m31002y=-4;
m31002m=-4;
p2=-4;
m47001=1;
m47002=-4;
m46701=-4;
end;


if pubid =8369 then do;
m31002y=-4;
m31002m=-4;
m47002=-4;
end;

if pubid =3006 then do;
p1=p2;
p2=-4;
m31001y=m31002y;
m31001m=m31002m;
m31002y=-4;
m31002m=-4;
m47002=-4;
m47001=1;
m46701=-4;
end;

if pubid=410 then do;
m31001m=m31002m;
m31001y=m31002y;
m31002y=2002;
m31002m=12;
m48001y=m48002y;
m48001m=m48002m;
m48002y=2003;
m48002m=1;
p1=602;
p2=601;
end;

/* Too young to be a partner */
if pubid=1598 then do;
m31002y=-4;
m31002m=-4;
m47002=-4;
m48002m=-4;
m48002y=-4;
m114002=-4;
p2=-4;
end;



/* no partner name in R6, verified, it is R5 partner */
if pubid=2903 then p1=p1r5;

/* Same partner as in R4 */
if pubid in (2740,2860,4010,4692,5396,5403,5609,8142,8645) then p1=p1r4;

/* correct loop sequence -- divorce follows separation*/
if pubid=4111 then do;
m540011=m540012;
m540012=4;
m560011m=m560012m;
m560011y=m560012y;
m560012y=2002;
m560012m=10;
end;

/* Marriage and separation were reported in R5. Living back together before dli reported in R6*/
if pubid =6492 or pubid =216 or pubid = 8491
or pubid = 8773 or pubid =3825
then do;
m45001=1;
end;

if pubid =4010 then do;
m45001=1;
m46701=1;
m47001=-4;
end;

/*Listed as partners but were not real partners */
if pubid in
(1363,1663,1689,8885) then do;
m31001m=m31002m;
m31001y=m31002y;
m47001=1;
m46701=-4;
m48001m=-4;
m48001y=-4;
m31002y=-4;
m31002m=-4;
m47002=-4;
p1=p2;
p2=-4;
m45002=-4;
m63001=-4;
m114001=-4;
end;

if pubid=1363 then do;
m7900111=m7900211;
m7900211=-4;
m8200111y=m8200211y;
m8200111m=m8200211m;
m8200211m=-4;
m8200211y=-4;
end;





/* divorce dates reported but no marriage dates. no spouse relationship in
partner roster */
if pubid =2176 then do;
m48001m=m8100111m;
m48001y=m8100111y;
m47001=-4;
m7900111=-4;
m8100111y=-4;
m8100111m=-4;
end;

if pubid=8340 then do;
m540011=-4;
m560011m=-4;
m560011y=-4;
M114001=-4;
M117001M=-4;
M117001M=-4;
end;


/* married in R3 and divorced in R6 with R3 partner. correct sequence error */
if pubid=5637 then do;
m540011=m114001;
m560011m=m117001m;
m560011y=m117001y;
m48001m=12;
end;

/* flag for Double counting cases*/
if pubid in(560,658,976,1200,1355,1386,1439,2019,2097,2493,2739,2747,2788,3327,3430,
4050,4183,4462,4524,4616,4650,4742,5332,5645,5814,6140,6363,6622,6749,7198,7463,
7525,7527,7586,7681,7711,7732,7946,7991,8303,8491,8532,8621,8330,8968)then flagdc=1;


/*-4 assigned based on MAR11400*/

if m540011 in (-1, -2) or
m540012 in (-1, -2) or
m7900111 in (-1, -2) or
m7900112 in (-1, -2) or
m7900211 in (-1, -2) or
m114001 in (-1, -2) or
m114002 in (-1, -2) or
m114002 in (-1, -2) then flagcheck1=1;

if m540011 in (-1, -2) then m540011=-4;
if m540012 in (-1, -2) then m540012=-4;
if m7900111 in (-1, -2) then m7900111=-4;
if m7900112 in (-1, -2) then m7900112=-4;
if m7900211 in (-1, -2) then m7900211=-4;
if m114001 in (-1, -2) then m114001=-4;
if m114002 in (-1, -2) then m114002=-4;
if m114002 in (-1, -2) then m114003=-4;




/* Set up initial marital status by using dli created variables. */
prevmsta=MARSTAT5;
prevcmst=CMARSTA5;
mar_ttl=mar_ttl5;
coh_ttl=coh_ttl5;

premar_ttl=mar_ttl5;
precoh_ttl=coh_ttl5;
prevmary=FMAR_Yr5;
prevmarm=FMAR_Mr5;
prvmarcm=fmarmr5;
prevcohm=FCOH_Mr5;
prevcohy=FCOH_Yr5;
prvcohcm=FCOHCMr5;

/*Round 5 noninterview, go to round 4*/
if cmarsta5=-5 and cmarsta4 ne -5 then do;
prevmsta=MARSTAT4;
prevcmst=CMARSTA4;
premar_ttl=mar_ttl4;
precoh_ttl=coh_ttl4;
mar_ttl=mar_ttl4;
coh_ttl=coh_ttl4;
prevmary=FMAR_Yr4;
prevmarm=FMAR_Mr4;
prvmarcm=fmarmr4;
prevcohm=FCOH_Mr4;
prevcohy=FCOH_Yr4;
prvcohcm=FCOHCMr4;
end;

/*Round 4 noninterview, go to round 3*/
if cmarsta5=-5 and cmarsta4=-5 and cmarsta3 ne -5 then do;
prevmsta=marstat3;
prevcmst=cmarsta3;
premar_ttl=mar_ttl3;
precoh_ttl=coh_ttl3;
mar_ttl=mar_ttl3;
coh_ttl=coh_ttl3;
prevmary=FMAR_Yr3;
prevmarm=FMAR_Mr3;
prvmarcm=fmarmr3;
prevcohm=FCOH_Mr3;
prevcohy=FCOH_Yr3;
prvcohcm=FCOHCMr3;
end;

/*Round 3 noninterview, go to round 2*/
if cmarsta5=-5 and cmarsta4=-5 and cmarsta3=-5 and cmarsta2 ne -5 then do;
prevmsta=marstat2;
prevcmst=cmarsta2;
premar_ttl=mar_ttl2;
precoh_ttl=coh_ttl2;
mar_ttl=mar_ttl2;
coh_ttl=coh_ttl2;
prevmary=FMAR_Yr2;
prevmarm=FMAR_Mr2;
prvmarcm=fmarmr2;
prevcohm=FCOH_Mr2;
prevcohy=FCOH_Yr2;
prvcohcm=FCOHCMr2;
end;

/*Round5 round4 round3 and round 2 noninterview, go to round 1*/
if cmarsta5=-5 and cmarsta4=-5 and cmarsta3=-5 and cmarsta2=-5 and cmarsta1 ne -5 then do;
prevmsta=marstat1;
prevcmst=cmarsta1;
premar_ttl=mar_ttl1;
precoh_ttl=coh_ttl1;
mar_ttl=mar_ttl1;
coh_ttl=coh_ttl1;
prevmary=FMAR_Yr1;
prevmarm=FMAR_Mr1;
prvmarcm=fmarmr1;
prevcohm=FCOH_Mr1;
prevcohy=FCOH_Yr1;
prvcohcm=FCOHCMr1;
end;


/* Set up the c.v.'s for first marriage and first cohab and the dli value for each respective c.v. */
dlicohy=prevcohy;
dlicohm=prevcohm;
dlicohcm=prvcohcm;
dlimary=prevmary;
dlimarm=prevmarm;
dlimarcm=prvmarcm;

/* Create interview date and previous interview date in continuous
months and months/years;*/

if int_y gt 0 and int_m gt 0 then do;
iym=int_y*100+int_m;
doicm=(int_y-1980)*12+int_m;
end;

else if int_y eq -5 or int_m eq -5 then do;
doicm=-5;
iym=-5;
end;

else if int_y in(-1,-2, -3,-4) or int_m in(-1, -2, -3, -4) then do;
doicm=-3;
iym=-3;
end;


if MARSTAT5 ne -5 then do;
dliym=int_yr5*100+int_mr5;
dlicm=(int_yr5-1980)*12+int_mr5;
mardli=marstat5;
end;

else if MARSTAT5=-5 and MARSTAT4 ne -5 then do;

dliym=int_yr4*100+int_mr4;
dlicm=(int_yr4-1980)*12+int_mr4;
mardli=marstat4;
end;


else if MARSTAT5=-5 and marstat4 eq -5 and MARSTAT3 ne -5 then do;
dliym=int_yr3*100+int_mr3;
dlicm=(int_yr3-1980)*12+int_mr3;
mardli=marstat3;
end;


else if MARSTAT5=-5 and marstat4 eq -5 and MARSTAT3 eq -5 and MARSTAT2 ne -5 then do;
dliym=int_yr2*100+int_mr2;
dlicm=(int_yr2-1980)*12+int_mr2;
mardli=marstat2;
end;

else if MARSTAT5=-5 and marstat4 eq -5 and MARSTAT3 eq -5 and MARSTAT2 eq -5 and MARSTAT1 ne -5 then do;
dliym=int_yr1*100+int_mr1;
dlicm=(int_yr1-1980)*12+int_mr1;
mardli=marstat1;
end;


/* create variable START, start a month after dl1 */
start=dlicm+1;


/* partner flag*/
if (p1=p1r5 or p1=p1r4 or p1=p1r3 or p1=p1r2 or p1=p1r1) and P1>0 then flagp1=1;
if (p1=p2r5 or p1=p2r4 or p1=p2r3 or p1=p2r2 or p1=p2r1) and p1>0 then flagp1a=1;
if (p1=p3r5 or p1=p3r4 or p1=p3r3 or p1=p3r2 or p1=p3r1) and p1>0 then flagp1b=1;
if (p2=p1r5 or p2=p1r4 or p2=p1r3 or p2=p1r2 or p2=p1r1) and p2>0 then flagp2=1;
if (p2=p2r5 or p2=p2r4 or p2=p2r3 or p2=p2r2 or p2=p2r1) and p2>0 then flagp2a=1;
if p1=-4 and m48001m>-4 then flagp=1;
/* stop cohabiting for old partner*/
flag48001=0;
if M48001M>0 and M48001Y>0 then end48001=((M48001Y-1980)*12)+M48001M;
if (0<end48001<=dlicm and p1>0 and (p1=p1r5 or p1=p1r4 or p1=p1r3 or p1=p1r2)) or
(0<end48001<=dlicm+1 and p1>0 and (p1=p1r5 or p1=p1r4 or p1=p1r3 or p1=p1r2))
then flag48001=1;
/* stop cohabiting with new partner*/
flagbacknew=0;
if M48001M>0 and M48001Y>0 then end48001=((M48001Y-1980)*12)+M48001M;
if 0<end48001<=dlicm and p1>=601 then flagbacknew=1;
if M48002M>0 and M48002Y>0 then end48002=((M48002Y-1980)*12)+M48002M ;
if 0<end48002<=dlicm and p1>501 and p2>601 then flagbacknew=1;
stopstart=dlicm+1;
flagbacknew=0;
if M48001M>0 and M48001Y>0 then end48001=((M48001Y-1980)*12)+M48001M;
if 0<end48001<=stopstart and p1>501 then flagbacknew=1;
if M48002M>0 and M48002Y>0 then end48002=((M48002Y-1980)*12)+M48002M ;
if 0<end48002<=stopstart and p1>501 and p2>601 then flagbacknew=1;
if 0<end48001=dlicm and p1>501 then flagbacknew1=1;
if 0<end48002=dlicm and p1>501 and p2>601 then flagbacknew1=1;


flag1170001=0;
if M117001M>0 and M117001Y>0 then end1170001=((M117001Y-1980)*12)+m117001M;
if 0<end117001<=stopstart and p1>501 then flagbacknew=1;


flag560011=0;
mar560011=((M560011Yr-1980)*12)+M560011M;
if mar560011>0 and mar560011<=dlicm and (p1=p1r5 or p1=p1r4 or p1=p1r3 or p1=p1r2) then
flag560011=1;


flag560012=0;
if mar560012r6>0 and mar560012r6<dlicm and (p1=p1r5 or p1=p1r4 or p1=p1r3 or p1=p1r2) then
flag560012=1;


flag8100111=0;
mar8100111=((M8100111Y-1980)*12)+M8100111M;
if mar8100111>0 and mar8100111<=dlicm and (p1=p1r5 or p1=p1r4 or p1=p1r3 or p1=p1r2) then
flag8100111=1;

if flagp1=1 and m31001y>-4 then flagback=1;

if (cohhr5=-4 or cohhr5=. ) and (flag48001=1 or flagback=1) then do;
do l=169 to 269;
cohhr5=max(of r5co169-r5co269);
end;
end;



/* set up arrays for r5 partner and spouse*/
array r5mars (l) r5mars001_r5mars283;
array r5co (l) r5co001-r5co283;
array r5link (l) r5link001-r5link283;
array r5pt (l) r5pt001-r5pt283;
array r5sp (l) r5sp001-r5sp283;


/* set up arrays for r6 partner and spouse*/
array r6pt (l) r6pt001-r6pt283;
array r6sp (l) r6sp001-r6sp283;



/* set up Mar arrays for each partner in four period*/
array maf (l) maf001-maf283;
array mas (l) mas001-mas283;
array mat (l) mat001-mat283;
array mafour (l) mafour001-mafour283;

array mbf (l) mbf001-mbf283;
array mbs (l) mbs001-mbs283;
array mbt (l) mbt001-mbt283;
array mbfour (l) mbfour001-mbfour283;

array mcf (l) mcf001-mcf283;
array mcs (l) mcs001-mcs283;
array mct (l) mct001-mct283;
array mcfour (l) mcfour001-mcfour283;

array mdf (l) mdf001-mdf283;
array mds (l) mds001-mds283;
array mdt (l) mdt001-mdt283;
array mdfour (l) mdfour001-mdfour283;

/* array for partner a in first sec third and fourth period*/
array maa (l) maa001-maa283;
array mbb (l) mbb001-mbb283;
array mcc (l) mcc001-mcc283;
array mdd (l) mdd001-mdd283;

/* set up arrays for mar total*/
array mal (l) mal001-mal283;


/* set up cohabitation arrays for each partner in four period*/
array cohaf (l) cohaf001-cohaf283;
array cohas (l) cohas001-cohas283;
array cohat (l) cohat001-cohat283;
array cohafour (l) cohafour001-cohafour283;

array cohbf (l) cohbf001-cohbf283;
array cohbs (l) cohbs001-cohbs283;
array cohbt (l) cohbt001-cohbt283;
array cohbfour (l) cohbfour001-cohbfour283;

array cohcf (l) cohcf001-cohcf283;
array cohcs (l) cohcs001-cohcs283;
array cohct (l) cohct001-cohct283;
array cohcfour (l) cohcfour001-cohcfour283;

array cohdf (l) cohdf001-cohdf283;
array cohds (l) cohds001-cohds283;
array cohdt (l) cohdt001-cohdt283;
array cohdfour (l) cohdfour001-cohdfour283;

array cohaa (l) cohaa001-cohaa283;
array cohbb (l) cohbb001-cohbb283;
array cohcc (l) cohcc001-cohcc283;
array cohdd (l) cohdd001-cohdd283;

/*cohabitation total*/
array cohal (l) cohal001-cohal283;

/*arrays for event history */
array mars (l) mars001-mars283;
array cohh (l) cohh001-cohh283;
array link (l) link001-link283;
array dual (l) dual001-dual283;


do l=start to 283;

cohal=0;
cohaf=0;
cohas=0;
cohat=0;
cohafour=0;

cohbf=0;
cohbs=0;
cohbt=0;
cohbfour=0;


cohcf=0;
cohcs=0;
cohct=0;
cohcfour=0;

cohdf=0;
cohds=0;
cohdt=0;
cohdfour=0;



mal=0;
maf=0;
mas=0;
mat=0;
mafour=0;

mbf=0;
mbs=0;
mbt=0;
mbfour=0;

mcf=0;
mcs=0;
mct=0;
mcfour=0;

mdf=0;
mds=0;
mdt=0;
mdfour=0;

end;
/* In the array section, an index by "p" indicates a loop over partners,
while an index by "t" indicates a loop over time periods. */
/* year start cohabitating*/
/* yscd2: year start cohabitating with partner d prd 2 */

array ysca (t) M31001Y M700011Y M700012Y M700013Y;
array yscb (t) M31002Y M700021Y yscb3 yscb4;
array yscc (t) M31003Y M700031Y yscc3 yscc4;
array yscd (t) yscd1 yscd2 yscd3 yscd4;

array msca (t) M31001M M700011M M700012M M700013M;
array mscb (t) M31002M M700021M mscb3 mscb4;
array mscc (t) M31003M M700031M mscb3 mscb4;
array mscd (t) mscd1 mscd2 mscd3 mscd4;

array ysc (p) ysca yscb yscc yscd;
array msc (p) msca mscb mscc mscd;


/*year end cohabitating (not continuous)*/
array yeca (t) M48001Y M920011Y yeca3 yeca4;
array yecb (t) M48002Y M920021Y yecb3 yecb4;
array yecc (t) M48003Y yecc2 yecc3 yecc4;
array yecd (t) yecd1 yecd2 yecd3 yecd4;
array yec (p) yeca yecb yecc yecd;

/*month end cohabitating (not continuous)*/
array meca (t) M48001M M920011M meca3 meca4;
array mecb (t) M48002M M920021M mecb3 mecb4;
array mecc (t) M48003M mecc2 mecc3 mecc4;
array mecd (t) mecd1 mecd2 mecd3 mecd4;
array mec (p) meca mecb mecc mecd;
array ymsca (t) ymsca1 ymsca2 ymsca3 ymsca4;
array ymscb (t) ymscb1 ymscb2 ymscb3 ymscb4;
array ymscc (t) ymscc1 ymscc2 ymscc3 ymscc4;
array ymscd (t) ymscd1 ymscd2 ymscd3 ymscd4;
array ymsc (p) ymsca ymscb ymscc ymscd;


array ymeca (t) ymeca1 ymeca2 ymeca3 ymeca4;
array ymecb (t) ymecb1 ymecb2 ymecb3 ymecb4;
array ymecc (t) ymecc1 ymecc2 ymecc3 ymecc4;
array ymecd (t) ymecd1 ymecd2 ymecd3 ymecd4;
array ymec (p) ymeca ymecb ymecc ymecd;

/*continuous start month of cohabitation*/
array csmca (t) csmca1 csmca2 csmca3 csmca4;
array csmcb (t) csmcb1 csmcb2 csmcb3 csmcb4;
array csmcc (t) csmcc1 csmcc2 csmcc3 csmcc4;
array csmcd (t) csmcd1 csmcd2 csmcd3 csmcd4;
array csmc (p) csmca csmcb csmcc csmcd;


/*continuous end month of cohabitation*/
array cemca (t) cemca1 cemca2 cemca3 cemca4;
array cemcb (t) cemcb1 cemcb2 cemcb3 cemcb4;
array cemcc (t) cemcc1 cemcc2 cemcc3 cemcc4;
array cemcd (t) cemcd1 cemcd2 cemcd3 cemcd4;
array cemc (p) cemca cemcb cemcc cemcd;

/*year and month start of Marriage*/
array ymsma (t) ymsma1 ymsma2 ymsma3 ymsma4;
array ymsmb (t) ymsmb1 ymsmb2 ymsmb3 ymsmb4;
array ymsmc (t) ymsmc1 ymsmc2 ymsmc3 ymsmc4;
array ymsmd (t) ymsmd1 ymsmd2 ymsmd3 ymsmd4;
array ymsm (p) ymsma ymsmb ymsmc ymsmd;


/* continuous start month of marriage*/
array csmma (t) csmma1 csmma2 csmma3 csmma4;
array csmmb (t) csmmb1 csmmb2 csmmb3 csmmb4;
array csmmc (t) csmmc1 csmmc2 csmmc3 csmmc4;
array csmmd (t) csmmd1 csmmd2 csmmd3 csmmd4;
array csmm (p) csmma csmmb csmmc csmmd;

/* continuous start month of separation */
array csmsa (t) csmsa1 csmsa2 csmsa3 csmsa4;
array csmsb (t) csmsb1 csmsb2 csmsb3 csmsb4;
array csmsc (t) csmsc1 csmsc2 csmsc3 csmsc4;
array csmsd (t) csmsd1 csmsd2 csmsd3 csmsd4;
array csms (p) csmsa csmsb csmsc csmsd;

/* years and month start separation*/

array ymssa (t) ymssa1 ymssa2 ymssa3 ymssa4;
array ymssb (t) ymssb1 ymssb2 ymssb3 ymssb4;
array ymssc (t) ymssc1 ymssc2 ymssc3 ymssc4;
array ymssd (t) ymssd1 ymssd2 ymssd3 ymssd4;
array ymss (p) ymssa ymssb ymssc ymssd;

/* continuous end month of marriage*/
array cemma (t) cemma1 cemma2 cemma3 cemma4;
array cemmb (t) cemmb1 cemmb2 cemmb3 cemmb4;
array cemmc (t) cemmc1 cemmc2 cemmc3 cemmc4;
array cemmd (t) cemmd1 cemmd2 cemmd3 cemmd4;
array cemm (p) cemma cemmb cemmc cemmd;


/*continuous end month of separation */
array cemsa (t) cemsa1 cemsa2 cemsa3 cemsa4;
array cemsb (t) cemsb1 cemsb2 cemsb3 cemsb4;
array cemsc (t) cemsc1 cemsc2 cemsc3 cemsc4;
array cemsd (t) cemsd1 cemsd2 cemsd3 cemsd4;
array cems (p) cemsa cemsb cemsc cemsd;


/* dummy for cohabitation continuous - since dli*/
array cdlia (t) M46701 cdlia2 cdlia3 cdlia4;
array cdlib (t) cdlib1 cdlib2 cdlib3 cdlib4;
array cdlic (t) cdlic1 cdlic2 cdlic3 cdlic4;
array cdlid (t) cdlid1 cdlid2 cdlid3 cdlid4;
array cdli (p) cdlia cdlib cdlic cdlid;


/*dummy for cohabitation continuous - since start (after dli date)*/
array cbega (t) M47001 cbega2 cbega3 cbega4;
array cbegb (t) M47002 cbegb2 cbegb3 cbegb4;
array cbegc (t) M47003 cbegc2 cbegc3 cbegc4;
array cbegd (t) cbegd1 cbegd2 cbegd3 cbegd4;
array cbeg (p) cbega cbegb cbegc cbegd;


/* cohabitation continuous - since start (after dli date)*/
array cbeg2a (t) M910011 M910012 cbeg2a3 cbeg2a4;
array cbeg2b (t) M910021 cbeg2b2 cbeg2b3 cbeg2b4;
array cbeg2c (t) M910031 cbeg2c2 cbeg2c3 cbeg2c4;
array cbeg2d (t) cbeg2d1 cbeg2d2 cbeg2d3 cbeg2d4;
array cbeg2 (p) cbeg2a cbeg2b cbeg2c cbeg2d;

/* legally married when began cohabitating*/
array mbega (t) M45001 mbega2 mbega3 mbega4;
array mbegb (t) M45002 mbegb2 mbegb3 mbegb4;
array mbegc (t) M45003 mbegc2 mbegc3 mbegc4;
array mbegd (t) mbegd1 mbegd2 mbegd3 mbegd4;
array mbeg (p) mbega mbegb mbegc mbegd;

/*marital/cohabitation status at date of last interview*/
array mdlia (t) mardli mdlia2 mdlia3 mdlia4;
array mdlib (t) mdlib1 mdlib2 mdlib3 mdlib4;
array mdlic (t) mdlic1 mdlic2 mdlic3 mdlic4;
array mdlid (t) mdlid1 mdlid2 mdlid3 mdlid4;
array mdli (p) mdlia mdlib mdlic mdlid;
/* First or next change in status.
Read "howa2" as change in marital status for partner a, period 2. */

array howa1 (t) m540011 m540012 m540013 howa14;
array howa2 (t) m7900111 m7900112 how23 how24;
array howb3 (t) m7900211 howb32 howb33 howb34;
array howa4 (t) m9800111 howa42 howa43 howa44;

/*collapse into how status changed*/
array how1 (p) howa1 howb1 howc1 howd1;
array how2 (p) howa2 howb2 howc2 howd2;
array how3 (p) howa3 howb3 howc3 howd3;
array how4 (p) howa4 howb4 howc4 howd4;

array how (i) how1 how2 how3 how4 ;

/*month and year change is marry*/

array hyma1 (t) M570011y hyma12 hyma13 hyma14;
array hmma1 (t) M570011m hmma12 hmma13 hmma14;

array hyma2 (t) m8200111y m8200112y hyma23 hyma24;
array hmma2 (t) m8200111m m8200112m hmma23 hmma24;

array hymb3 (t) m8200211y hymb32 hymb33 hymb34;
array hmmb3 (t) m8200211m hmmb32 hmmb33 hmmb34;

array hyma4 (t) m1010011y hyma42 hyma43 hyma44;
array hmma4 (t) m1010011m hmma42 hmma43 hmma44;



/*collapse into month and year change is marry*/
array hym1 (p) hyma1 hymb1 hymc1 hymd1;
array hmm1 (p) hmma1 hmmb1 hmmc1 hmmd1;
array hym2 (p) hyma2 hymb2 hymc2 hymd2;
array hmm2 (p) hmma2 hmmb2 hmmc2 hmmd2;
array hym3 (p) hyma3 hymb3 hymc3 hymd3;
array hmm3 (p) hmma3 hmmb3 hmmc3 hmmd3;
array hym4 (p) hyma4 hymb4 hymc4 hymd4;
array hmm4 (p) hmma4 hmmb4 hmmc4 hmmd4;
array hym (i) hym1 hym2 hym3 hym4;
array hmm (i) hmm1 hmm2 hmm3 hmm4;

/*month and year change=separation, divorce, annulment*/
array hyssa1 (t) M560011Y M560012Y hyssa13 hyssa14;
array hmssa1 (t) M560011M M560012M hmssa13 hmssa14;
array hyssa2 (t) M8100111Y M8100112Y hyssa23 hyssa24;
array hmssa2 (t) M8100111M M8100112M hmssa23 hmssa24;
array hyssa3 (t) hyssa31 hyssa32 hyssa33 hyssa34;
array hmssa3 (t) hmssa31 hmssa32 hmssa33 hmssa34;
array hyssa4 (t) hyssa41 hyssa42 hyssa43 hyssa44;
array hmssa4 (t) hmssa41 hmssa42 hmssa43 hmssa44;



/*collapse into month and year change=separation, divorce, annulment*/
array hyss1 (p) hyssa1 hyssb1 hyssc1 hyssd1;
array hmss1 (p) hmssa1 hmssb1 hmssc1 hmssd1;
array hyss2 (p) hyssa2 hyssb2 hyssc2 hyssd2;
array hmss2 (p) hmssa2 hmssb2 hmssc2 hmssd2;
array hyss3 (p) hyssa3 hyssb3 hyssc3 hyssd3;
array hmss3 (p) hmsas3 hmssb3 hmssc3 hmssd3;
array hyss4 (p) hyssa4 hyssb4 hyssc4 hyssd4;
array hmss4 (p) hmssa4 hmssb4 hmssc4 hmssd4;
array hyss (i) hyss1 hyss2 hyss3 hyss4;
array hmss (i) hmss1 hmss2 hmss3 hmss4;


/* Collapsed marital status*/
array cmarsa (t) cmarsa1 cmarsa2 cmarsa3 cmarsa4;
array cmarsb (t) cmarsb1 cmarsb2 cmarsb3 cmarsb4;
array cmarsc (t) cmarsc1 cmarsc2 cmarsc3 cmarsc4;
array cmarsd (t) cmarsd1 cmarsd2 cmarsd3 cmarsd4;
array cmars (p) cmarsa cmarsb cmarsc cmarsd;



/* imars individual marital status */
array imarsa (t) imarsa1 imarsa2 imarsa3 imarsa4;
array imarsb (t) imarsb1 imarsb2 imarsb3 imarsb4;
array imarsc (t) imarsc1 imarsc2 imarsc3 imarsc4;
array imarsd (t) imarsd1 imarsd2 imarsd3 imarsd4;
array imars (p) imarsa imarsb imarsc imarsd;


/*dummy set to one if start month cohabitate is invalid*/
array fixmc1 (t) fixmc11 fixmc12 fixmc13 fixmc14;
array fixmc2 (t) fixmc21 fixmc22 fixmc23 fixmc24;
array fixmc3 (t) fixmc31 fixmc32 fixmc33 fixmc34;
array fixmc4 (t) fixmc41 fixmc42 fixmc43 fixmc44;
array fixmc (p) fixmc1 fixmc2 fixmc3 fixmc4;

/*dummy set to one if start month marry is invalid*/
array fixmm1 (t) fixmm11 fixmm12 fixmm13 fixmm14;
array fixmm2 (t) fixmm21 fixmm22 fixmm23 fixmm24;
array fixmm3 (t) fixmm31 fixmm32 fixmm33 fixmm34;
array fixmm4 (t) fixmm41 fixmm42 fixmm43 fixmm44;
array fixmm (p) fixmm1 fixmm2 fixmm3 fixmm4;

/*dummy set to one if start year cohabitate is invalid*/
array fixyc1 (t) fixyc11 fixyc12 fixyc13 fixyc14;
array fixyc2 (t) fixyc21 fixyc22 fixyc23 fixyc24;
array fixyc3 (t) fixyc31 fixyc32 fixyc33 fixyc34;
array fixyc4 (t) fixyc41 fixyc42 fixyc43 fixyc44;
array fixyc (p) fixyc1 fixyc2 fixyc3 fixyc4;



/*dummy set to one if start year marry is invalid*/
array fixym1 (t) fixym11 fixym12 fixym13 fixym14;
array fixym2 (t) fixym21 fixym22 fixym23 fixym24;
array fixym3 (t) fixym31 fixym32 fixym33 fixym34;
array fixym4 (t) fixym41 fixym42 fixym43 fixym44;
array fixym (p) fixym1 fixym2 fixym3 fixym4;

array coha (t) cohaf cohas cohat cohafour;
array cohb (t) cohbf cohbs cohbt cohbfour;
array cohc (t) cohcf cohcs cohct cohcfour;
array cohd (t) cohdf cohds cohdt cohdfour;
array coh (p) coha cohb cohc cohd ;

array ma (t) maf mas mat mafour;
array mb (t) mbf mbs mbt mbfour;
array mc (t) mcf mcs mct mcfour;
array md (t) mcf mcs mdt mdfour;
array m (p) ma mb mc md;


/*number of cohabitations*/
array nuca (t) nuca1 nuca2 nuca3 nuca4;
array nucb (t) nucb1 nucb2 nucb3 nucb4;
array nucc (t) nucc1 nucc2 nucc3 nucc4;
array nucd (t) nucd1 nucd2 nucd3 nucd4;
array nuc (p) nuca nucb nucc nucd;


/*number of marriages*/
array numa (t) numa1 numa2 numa3 numa4;
array numb (t) numb1 numb2 numb3 numb4;
array numc (t) numc1 numc2 numc3 numc4;
array numd (t) numd1 numd2 numd3 numd4;
array num (p) numa numb numc numd;


if mardli=-1 or mardli=-2 then do;
mardli=-3;
flagcheck=1;
end;


/* month and year relationship ended */
array eyra (t) M117001Y eyra2 eyra3 eyra4;
array eyrb (t) eyrb1 eyrb2 eyrb3 eyrb4;
array eyrc (t) eyrc1 eyrc2 eyrc3 eyrc4;
array eyrd (t) eyrd1 eyrd2 eyrd3 eyrd4;

array emoa (t) M117001M emoa2 emoa3 emoa4;
array emob (t) emob1 emob2 emob3 emob4;
array emoc (t) emoc1 emoc2 emoc3 emoc4;
array emod (t) emod1 emod2 emod3 emod4;


/*collapse all start years and months into arrays*/
array eyr (p) eyra eyrb eyrc eyrd;
array emo (p) emoa emob emoc emod;

/* Current status of relationship */
array fstata (t) M114001 fstata2 fstata3 fstata4;
array fstatb (t) M114002 fstatb2 fstatb3 fstatb4;
array fstatc (t) M114003 fstatc2 fstatc3 fstatc4;
array fstatd (t) fstatd1 fstatd2 fstatd3 fstatd4;

/*collapse married into array*/
array fstat (p) fstata fstatb fstatc fstatd;

do l=1 to 269;
if l=dlicm then do;
cohhr5=r5co;
end;
end;

/* set up back report case*/
if 0<p1<601 and (cohhr5=. or cohhr5=-4) then flagbackold=1;
if (cohhr5=-4 or cohhr5=. ) and (flag48001=1 or flagbackold=1) then do;
do l=169 to 269;
cohhr5=max(of r5co169-r5co269);
end;
end;


do p=1 to 4; /* loop for p */
do t=1 to 4; /* loop for t */

if cdli=1 then
do;
ymsc=dliym;
end;

if cdli=0 then ymsc=dliym;
if mdli=1 or mdli=2 then cmars=0;
if mdli=3 or mdli=4 then
do;
cmars=1;
ymsm=dliym;
end;
if mdli=5 or mdli=6 then do;
cmars=2;
ymss=dliym;
end;
if mdli=7 or mdli=8 then cmars=3;
if mdli=9 or mdli=10 then cmars=4;
if mdli<0 and mdli ne -4 then cmars=mdli;

if ysc>0 and msc>0 and ysc gt bdate_y then ymsc=(ysc*100)+msc;


/* If a start year or month is missing and flag ne 1 then I'm setting it to dli. */
if (-3 le ysc le 0 or -3 le msc le 0) then ymsc=dliym;
if (-3 le ysc le 0 and -3 le msc le 0) then ymsc=dliym;

csmc=(round(ymsc,100)-198000)*.12+(ymsc-round(ymsc,100));

/* create dummies for negative answers. Any negative answer is set
to the dli and dummies (fixyc, fixmc) are created to identify these cases. */

if -3 le ysc le 0 then fixyc=1;
if -3 le msc le 0 then fixmc=1;


if -3 le ysc le 0 or -3 le msc le 0 then ymsc=dliym;
if -3 le ysc le 0 and -3 le msc le 0 then ymsc=dliym;
if ysc > 0 and -3 le msc le 0 then ymsc=(ysc*100)+1;

* need to add stop information for arrays;

if yec>0 and mec>0 and yec gt bdate_y then ymec=(yec*100)+mec;

if (-3 le yec le 0 or -3 le mec le 0)
and (cbeg ne 1 and cbeg2 ne 1 and cdli ne 1) then ymec=iym;

if yec>0 and -4<mec<0 le mec le 0 then ymec=(yec*100)+12;
csmc=(round(ymsc,100)-198000)*.12+(ymsc-round(ymsc,100));
cemc=((round(ymec,100)-198000)*.12+(ymec-round(ymec,100)))-1;
if ymec=ymsc then cemc=(round(ymec,100)-198000)*.12+(ymec-round(ymec,100));
if cdli=1 or cbeg=1 then cemc=doicm;
if m910011=1 then cemca2=doicm;
if m910012=1 then cemca3=doicm;


if mbeg=1 then do;
cmars=1;
imars=1;
ymsm=ymsc;
ymsc=.;

if fixmc=1 then fixmm=1;
if fixyc=1 then fixym=1;
end;

if mbeg=0 then imars=0;
if mbeg=-4 and cmars ne . and cohhr5 gt 200 then imars=1;
else if mbeg=-4 and cmars ne . and cmars ne -4 and 100 lt cohhr5 lt 200 then imars=0;

csmm=(round(ymsm,100)-198000)*.12+(ymsm-round(ymsm,100));
csms=(round(ymss,100)-198000)*.12+(ymss-round(ymss,100));

if mardli=7 or mardli=8 then do;
ymss=dliym;
csms=(round(ymss,100)-198000)*.12+(ymss-round(ymss,100));
end;
if csms>0 then cems=doicm;
if csmm>0 then cemm=doicm;


do l=start to doicm; /* loop 1 */
C=C+1;
if csmc>0 and cemc>0 and csmc LE C LE cemc then cohal=1;
if csmc>0 and cemc>0 and csmc LE C LE cemc then coh=1;


if cmars=1 and csmm>0 and cemm>0 and csmm le c le cemm then mal=1;
if imars=1 and csmm>0 and cemm>0 and csmm le c le cemm then m=1;

if 2 le cmars le 3 and csms>0 and cems>0 and csms le c le cems then mal=cmars;
if 2 le imars le 3 and csms>0 and cems>0 and csms le c le cems then m=imars;
if cmars=0 then mal=cmars; /* add 7-15-02 */
if -2 le cmars le -1 then mal=cmars;
if -2 le imars le -1 then m=imars;
end; /* end loop 1 */




/* This loop 1 will help to reserve the information from last round, without this loop,
the old info. could be overwritten by the loops following. */


do i=1 to 4; /* Loop 2 */

if how=1 and hym>0 and hmm>0 then do;
cmars=1;
imars=1;
ymsm=hym*100+hmm;

end;

if -2 le how le -1 then do;
cmars=how;
imars=how;
end;

if how=1 and (-4<hym<0 or -4<hmm<0) then do;
cmars=1;
imars=1;
ymsm=iym;
end;

csmm=(round(ymsm,100)-198000)*.12+(ymsm-round(ymsm,100));



/* Marriage ends in legal separation */
if how=3 and hyss>0 and hmss>0 then do;
cmars=2;
imars=2;
ymss=(hyss*100)+hmss;

end;
/* Marriage ends in divorce */
if how=4 and hyss>0 and hmss>0 then do;
cmars=3;
imars=3;
ymss=(hyss*100)+hmss;

end;
/* Marriage ends in divorce */
if how=5 and hyss>0 and hmss>0 then do;
cmars=3;
imars=3;
ymss=(hyss*100)+hmss;

end;

csmm=(round(ymsm,100)-198000)*.12+(ymsm-round(ymsm,100));
csms=(round(ymss,100)-198000)*.12+(ymss-round(ymss,100));
if csms>0 then cems=doicm;
if csmm>0 then cemm=doicm;



/* YMAR-114000 (fstat in the arrays) collects current status of the relationship. */
if fstat=2 and eyr>0 and emo>0 then do;
cmars=0; /* fstat=annulment, which translates into never married in collapsed mar. status */
imars=0;
csms=(eyr-1980)*12 + emo;

end;

if fstat=2 and (-4<eyr<0 or -4<emo<0) then do;
cmars=0;
imars=0;
csms=doicm;
end;

if fstat=3 and eyr>0 and emo>0 then do;
cmars=2; /* separation */
imars=2;
csms=(eyr-1980)*12 + emo;


end;

if fstat=3 and (-4<eyr<0 or -4<emo<0) then do;
cmars=2;
imars=2;
csms=doicm;

end;

if fstat=4 and eyr>0 and emo>0 then do;
cmars=3;
imars=3; /* divorce */
csms=(eyr-1980)*12 + emo;

end;

if fstat=4 and (-4<eyr<0 or -4<emo<0) then do;
cmars=3;
imars=3; /* divorce */
csms=doicm;
end;

if fstat=5 and eyr>0 and emo>0 and csmm>0 then do;
cmars=4;
imars=4; /*widowed */
csms=(eyr-1980)*12 + emo;
widow=1;
end;

if fstat=5 and (-4<eyr<0 or -4<emo<0) and csmm>0 then do;
cmars=4;
imars=4;
csms=doicm;
widow=1;
end;
if csms>0 then cems=doicm;

if -4<fstat<0 then cmars=fstat;



/*The start & end dates of marriages/cohabs are created, we can place that information into the
array. The information from the last week is used to create the variable for marital status and collapsed marital
status. */
C=0;
do l=1 to doicm; /* loop 1 */
C=C+1;
if csmc>0 and cemc>0 and csmc LE C LE cemc then cohal=1;
if csmc>0 and cemc>0 and csmc LE C LE cemc then coh=1;

if cmars=1 and csmm>0 and cemm>0 and csmm le c le cemm then mal=1;
if imars=1 and csmm>0 and cemm>0 and csmm le c le cemm then m=1;


if cmars = 2 and csms>0 and cems>0 and csms le c le cems then mal=2;
if imars = 2 and csms>0 and cems>0 and csms le c le cems then m=2;
if cmars = 3 and csms>0 and cems>0 and csms le c le cems then mal=3;
if imars = 3 and csms>0 and cems>0 and csms le c le cems then m=3;
if cmars = 4 and csms>0 and cems>0 and csms le c le cems then mal=4;
if imars = 4 and csms>0 and cems>0 and csms le c le cems then m=4;

if -2 le cmars le -1 then mal=cmars;
if -2 le imars le -1 then m=imars;

if cmars=0 then mal=cmars;


if c=doicm then do;
if mal in (-1,-2) then mars=-3;
if mal=0 and cohal=1 then mars=1;
if mal=0 and cohal=0 then mars=2;
if mal=1 and cohal=1 then mars=3;
if mal=1 and cohal=0 then mars=4;
if mal=2 and cohal=1 then mars=5;
if mal=2 and cohal=0 then mars=6;
if mal=3 and cohal=1 then mars=7;
if mal=3 and cohal=0 then mars=8;
if mal=4 and cohal=1 then mars=9;
if mal=4 and cohal=0 then mars=10;
marstat=mars;
end;

end;
end;/* end of loop t*/
end;/*end of loop p*/


end;



/* Create collapsed marital status from marital status.*/
if 1 le marstat le 2 then cmarstat=0;
if 3 le marstat le 4 then cmarstat=1;
if 5 le marstat le 6 then cmarstat=2;
if 7 le marstat le 8 then cmarstat=3;
if 9 le marstat le 10 then cmarstat=4;
if -2 le marstat le -1 then cmarstat=marstat;
if marstat=-3 then cmarstat=-3;

if csmca1>0 then do;
cohcm=csmca1;
end;

if csmca1>0 and csmca2>0 and csmca1<csmca2 then do;
cohcm=csmca1;
end;

if csmca1>0 and csmca2>0 and csmca1>csmca2 then do
cohcm=csmca2;
end;

if csmca1>0 and csmca1<csmcb1 then do
cohcm=csmca1;
end;

if csmcb1>0 and csmca1>csmcb1 then do
cohcm=csmcb1;
end;

if csmma1>0 then do
marcm=csmma1;
end;

if csmma1>0 and csmma2>0 and csmma1> csmma2 then do
marcm=csmma2;
end;

if csmma1>0 and csmmb1>0 and csmma1> csmmb1 then do
marcm=csmmb1;
end;
r6marcm=marcm;
r6cohcm=cohcm;

if csmma1<0 and csmmb1>0 then do;
marcm=csmmb1;
end;
r6marcm=marcm;
r6cohcm=cohcm;

/* For respondents, their Round 1 c.v. for first marriage date post-dates a marriage they report in Round 2.
We need the continuous month min of these two dates. */
if dlimarcm>0 then marcm=dlimarcm;
if r6marcm>0 then marcm=r6marcm;
if dlimarcm>0 and r6marcm>0 then do;
marcm=dlimarcm;
end;
array cvcm cohcm marcm;
array cvy cohy mary;
array cvm cohm marm;


do over cvcm;
if 277 le cvcm le 283 then do;
cvy=2003;
cvm=cvcm-276;
end;

if 265 le cvcm le 276 then do;
cvy=2002;
cvm=cvcm-264;
end;

if 253 le cvcm le 264 then do;
cvy=2001;
cvm=cvcm-252;
end;

if 241 le cvcm le 252 then do;
cvy=2000;
cvm=cvcm-240;
end;
if 229 le cvcm le 240 then do;
cvy=1999;
cvm=cvcm-228;
end;
if 217 le cvcm le 228 then do;
cvy=1998;
cvm=cvcm-216;
end;
if 205 le cvcm le 216 then do;
cvy=1997;
cvm=cvcm-204;
end;
if 193 le cvcm le 204 then do;
cvy=1996;
cvm=cvcm-192;
end;
if 181 le cvcm le 192 then do;
cvy=1995;
cvm=cvcm-180;
end;
if 169 le cvcm le 180 then do;
cvy=1994;
cvm=cvcm-168;
end;
if 157 le cvcm le 168 then do;
cvy=1993;
cvm=cvcm-156;
end;
if cvcm=. then do;
cvcm=-4;
cvy=-4;
cvm=-4;
end;
end;




/*To correct for those who don't know the start month for cohabitation*/
if -4<m31001m<0 and m31001y>0 then do;
cohy=m31001y;
cohm=-3;
cohcm=-3;
end;


/*To correct for those who don't know the start year and month for cohabitation*/
if -4<m31001m<0 and -4<m31001y<0 and prvcohcm=-4 then do;
cohm=-3;
cohcm=-3;
cohy=-3;
end;
if (-4<m31001m<0 and -4<m31001y<0) and (m31002y>0 and m31002y>0 ) and prvcohcm=-4 then do;
cohm=-3;
cohcm=-3;
cohy=-3;
end;

if ((-4<m31002m<0 and -4<m31002y<0) or (-4<m700011y<0 and -4<m700011m<0))
and (m31001y>0 and m31001y>0 ) then do;
cohm=m31001m;
cohcm=csmca1;
cohy=m31001y;
end;

if m45001=1 and -4<m31001m<0 and -4<m31001y<0 then do;
cohm=-4;
cohcm=-4;
cohy=-4;
marcm=-3;
mary=-3;
marm=-3;
end;

/*If old date present use old date*/
if prevcohm ne -4 then do;
cohcm= prvcohcm;
cohy=prevcohy;
cohm= prevcohm;
end;




if prevmarm ne -4 then do;
marcm=prvmarcm;
mary=prevmary;
marm=prevmarm;
end;



if prevcohm =-4 and prevmarm>0 and (m31001y=-4 or m31002y=-4) then do;
cohcm= -4;
cohy=-4;
cohm= -4;
end;

if prevcohm =-4 and prevmarm>0 and (m31001y>-4 or m31002y>-4) then do;
cohcm=csmca1;
cohy=m31001y;
cohm=m31001m;
end;

if prevcohm =-3 then do ;
cohcm= prvcohcm;
cohy= prevcohy;
cohm= prevcohm;
end;

if prevcohm =-3 and m31001y>0 and m31001m>0 then do;
cohcm= csmca1;
cohy=m31001y;
cohm= m31001m;
end;

if prevcohm =-4 and m31001y=-4 and m31002y=-4 and m31003y=-4 then do ;
cohcm= prvcohcm;
cohy= prevcohy;
cohm= prevcohm;
end;

if prevmarm=-3 then do;
marcm=prvmarcm;
mary=prevmary;
marm=prevmarm;
end;

if prevmarm=-3 and m8200111y>0 and m8200111m>0 then do;
marcm=csmma1;
mary=m8200111y;
marm=m8200111m;
end;



/*hand edit those with start date prior to 1994*/
/* No cases found in R6. */
if cohcm gt 0 and cohcm lt b12cm then do;
cohcm=-3;
cohm=-3;
cohy=-3;

end;
if 0<=marcm<b12cm then do;
marcm=-3;
marm=-3;
mary=-3;

end;
/*Marital status for event history*/
do l=start to doicm;
if -2 le mal le -1 then mars=-3;
if mal=0 and cohal=1 then mars=1;
if mal=0 and cohal=0 then mars=0;
if mal=1 and cohal=1 then mars=2;
if mal=1 and cohal=0 then mars=2;
if mal=2 and cohal=1 then mars=3;
if mal=2 and cohal=0 then mars=3;
if mal=3 and cohal=1 then mars=4;
if mal=3 and cohal=0 then mars=4;
if mal=4 and cohal=1 then mars=5;
if mal=4 and cohal=0 then mars=5;
end;


*For the documentation except the marital status;

do l=start to doicm;
if cohaf=1 or cohas=1 or cohat=1 or cohafour=1 then cohaa=1;
if cohbf=1 or cohbs=1 or cohbt=1 or cohbfour=1 then cohbb=1;
if cohcf=1 or cohcs=1 or cohct=1 or cohcfour=1 then cohcc=1;
if cohdf=1 or cohds=1 or cohdt=1 or cohdfour=1 then cohdd=1;
if maf=1 or mas=1 or mat=1 or mafour=1 then maa=1;
if mbf=1 or mbs=1 or mbt=1 or mbfour=1 then mbb=1;
if mcf=1 or mcs=1 or mct=1 or mcfour=1 then mcc=1;
if mdf=1 or mds=1 or mdt=1 or mdfour=1 then mdd=1;
end;
/* Mar-Cohabitation;*/
do l=start to doicm;
if cohdd=1 then cohh=104;
if cohcc=1 then cohh=103;
if cohbb=1 then cohh=102;
if cohaa=1 then cohh=101;

if mdd=1 then cohh=204;
if mcc=1 then cohh=203;
if mbb=1 then cohh=202;
if maa=1 then cohh=201;

end;

if (flag48001=1 and p2>0 and prevmsta<3) or flagbacknew=1 then do;
do l=169 to doicm;
if cohaf=1 or cohas=1 or cohat=1 or cohafour=1 then cohaa=1;
if cohbf=1 or cohbs=1 or cohbt=1 or cohbfour=1 then cohbb=1;
if cohcf=1 or cohcs=1 or cohct=1 or cohcfour=1 then cohcc=1;
if cohdf=1 or cohds=1 or cohdt=1 or cohdfour=1 then cohdd=1;
if maf=1 or mas=1 or mat=1 or mafour=1 then maa=1;
if mbf=1 or mbs=1 or mbt=1 or mbfour=1 then mbb=1;
if mcf=1 or mcs=1 or mct=1 or mcfour=1 then mcc=1;
if mdf=1 or mds=1 or mdt=1 or mdfour=1 then mdd=1;
end;
/* Mar-Cohabitation;*/
do l=169 to doicm;
if cohdd=1 then cohh=104;
if cohcc=1 then cohh=103;
if cohbb=1 then cohh=102;
if cohaa=1 then cohh=101;

if mdd=1 then cohh=204;
if mcc=1 then cohh=203;
if mbb=1 then cohh=202;
if maa=1 then cohh=201;

end;
end;


/* Mar_Dual */
do l=start to doicm;
if cohh>0 and cohh ne 204 and cohh ne 104 and cohdd=1 then dual=104;
if cohh>0 and cohh ne 204 and cohh ne 104 and mdd=1 then dual=204;

if cohh>0 and cohh ne 203 and cohh ne 103 and cohcc=1 then dual=103;
if cohh>0 and cohh ne 203 and cohh ne 103 and mcc=1 then dual=203;

if cohh>0 and cohh ne 202 and cohh ne 102 and cohbb=1 then dual=102;
if cohh>0 and cohh ne 202 and cohh ne 102 and mbb=1 then dual=202;
end;

*Mar_Partner_Link;
do l=1 to doicm;
if cohdd=1 or mdd=1 then link=p4;
if cohcc=1 or mcc=1 then link=p3;
if cohbb=1 or mbb=1 then link=p2;
if cohaa=1 or maa=1 then link=p1;
end;


if doicm=-5 then do;
do l=start to doicm;
mars=-4;
cohh=-4;
dual=-4;
link=-4;
end;
end;

/* count the number of partners and spouses in r5;*/
do l=169 to 269;
if 100 lt r5co lt 200 then r5pt=r5co-100;
if r5co gt 200 then r5sp=r5co-200;
end;
nump5=max(of r5pt169-r5pt269);
nums5=max(of r5sp169-r5sp269);
numr5=max(nump5,nums5);
if nump5=. then nump5=0;
if nums5=. then nums5=0;

/* Add the partners and spouses from round 1 round 2 round 3 and round4 and round 5*/
do l=start to 283;
if cohh>0 and numr5>0 then cohh=cohh+numr5;
if dual>0 and numr5>0 then dual=dual+numr5;
end;


*Find the number of partners and spouses in round 6;
do l=start to 283;
if 100 lt cohh lt 200 then r6pt=cohh-100;
if cohh gt 200 then r6sp=cohh-200;
end;



/* If the respondent cohabited with the partner or spouse from last interview,
do the following change;*/
if 100 lt cohhr5 lt 200 and (flagp=1 or flagp1=1 or flagp1a=1 or flagp2=1 )
then do;
do l=start to doicm;
if 100 lt cohh lt 200 and r6pt=min(of r6pt001-r6pt283) then cohh=cohhr5;
else if 100 lt cohh lt 200 then cohh=cohh-1;
if cohh gt 200 and r6sp=min(of r6sp001-r6sp283) then cohh=200+(cohhr5-100);
else if cohh gt 200 then cohh=cohh-1;
if 100 lt dual lt 200 and r6pt=min(of r6pt001-r6pt283) then dual=cohhr5;
else if 100 lt dual lt 200 then cohh=dual-1;
if dual gt 200 and r6sp=min(of r6pt001-r6pt283) then dual=200+(cohhr5-100);
else if dual gt 200 then dual=dual-1;
end;
end;



if cohhr5>200 and (flagp=1 or flagp1=1 or flagp1a=1 or flagp2=1)
then do;
do l=start to doicm;
if cohh gt 200 and r6sp=min(of r6sp001-r6sp283) then cohh=cohhr5;
else if cohh gt 200 then cohh=cohh-1;
if 100 lt cohh lt 200 and r6pt=min(of r6sp001-r6sp283) then cohh=100+(cohhr5-200);
else if 100 lt cohh lt 200 then cohh=cohh-1;
if dual gt 200 and dual=min(of r6sp001-r6sp283)+200 then dual=cohhr5;
else if dual gt 200 then dual=dual-1;
if 100 lt dual lt 200 and dual=min(of r6sp001-r6sp283)+100 then dual=100+(cohhr5-200);
else if 100 lt dual lt 200 then dual=dual-1;
end;
end;
do l =start to doicm;
if dual=101 or dual=102 or dual=103 or dual=104 then r6dual=1;
else if cohh=101 and r6dual ne 1 then r6dual=0;
else if cohh=102 and r6dual ne 1 then r6dual=0;
else if cohh=103 and r6dual ne 1 then r6dual=0;
else if cohh=104 and r6dual ne 1 then r6dual=0;
else if cohh=201 and r6dual ne 1 then r6dual=0;
else if cohh=202 and r6dual ne 1 then r6dual=0;
else if cohh=203 and r6dual ne 1 then r6dual=0;
else if cohh=204 and r6dual ne 1 then r6dual=0;
else if r6dual ne 1 and r6dual ne 0 then r6dual=-4;
end;
if r6dual=. then r6dual=-4;



*Find the number of partner and spouses in round 6;
do l=start to doicm;
if 100 lt cohh lt 200 then r6pt=cohh-100;
if cohh gt 200 then r6sp=cohh-200;
end;

/*get the maximum for the number of marriages and the number of cohabitations */
nump6=max(of r6pt169-r6pt283);
nums6=max(of r6sp169-r6sp283);
numr6=max(nump6,nums6);
COH_TTL=nump6;
MAR_TTL=nums6;


/* double check whether the maximum number of cohabitations obtained above is correct*/
if int_y ne -5 and (COH_TTL<coh_ttl5 or coh_ttl=.) and coh_ttl5>=0
then COH_TTL=coh_ttl5;
if int_y ne -5 and int_cmr5=-5 and int_cmr4 ne -5 and (COH_TTL<coh_ttl4 or coh_ttl=.)
and coh_ttl4>=0 then COH_TTL=coh_ttl4;
if int_y ne -5 and int_cmr5=-5 and int_cmr4 = -5
and int_cmr3 ne -5 and (COH_TTL<coh_ttl3 or coh_ttl=.) and coh_ttl3>=0 then COH_TTL=coh_ttl3;
if int_y ne -5 and int_cmr5=-5 and int_cmr4= -5 and int_cmr3=-5 and int_cmr2 ne -5
and (COH_TTL<coh_ttl2 or coh_ttl=.) and coh_ttl2>=0 then COH_TTL=coh_ttl2;
if int_y ne -5 and int_cmr5=-5 and int_cmr4= -5 and int_cmr3=-5 and int_cmr2= -5
and int_cmr1 ne -5 and (COH_TTL<coh_ttl1 or coh_ttl=.) and coh_ttl1>=0 then COH_TTL=coh_ttl1;
if cohcm>0 and coh_ttl=0 then coh_ttl=1;
if cohcm=-4 and coh_ttl=1 and coh_ttl5=0 and 0<p1<601 and prevmsta=3 then coh_ttl=0;
if coh_ttl=. then coh_ttl=0;

/* double check whether the maximum number of marriages obtained above is correct*/
if int_y ne -5 and (mar_ttl<mar_ttl5 or mar_ttl=.) and mar_ttl5>=0
then mar_ttl=mar_ttl5;
if int_y ne -5 and int_cmr5=-5 and int_cmr4 ne -5 and (mar_ttl<mar_ttl4 or mar_ttl=.) and mar_ttl4>=0
then mar_ttl=mar_ttl4;
if int_y ne -5 and int_cmr5=-5 and int_cmr4 = -5 and int_cmr3 ne -5
and (mar_ttl<mar_ttl3 or mar_ttl=.) and mar_ttl3>0
then mar_ttl=mar_ttl3;
if int_y ne -5 and int_cmr5=-5 and int_cmr4= -5 and int_cmr3=-5 and int_cmr2 ne -5
and (mar_ttl<mar_ttl2 or mar_ttl=.) and mar_ttl2>0
then mar_ttl=mar_ttl2;
if int_y ne -5 and int_cmr5=-5 and int_cmr4= -5 and int_cmr3=-5 and int_cmr2= -5
and int_cmr1 ne -5 and (mar_ttl<mar_ttl1 or mar_ttl=.) and mar_ttl1>0
then mar_ttl=mar_ttl1;
if marcm>0 and mar_ttl=0 then mar_ttl=1;
if mar_ttl=. and mary=-4 then mar_ttl=0;

/* Cohabitation and marriage started at the same time. Count it as marriage only. */
if( m45001=1 or m45002=1 )and Mar_ttl>0
and (coh_ttl5<=0 and coh_ttl4<=0 and coh_ttl3<=0 and coh_ttl2<=0 and coh_ttl1<=0)then coh_ttl=0;
if (m45001=1 or m45002=1) and Mar_ttl>0 and coh_ttl=0 and prvcohcm<0 then do;
cohcm=-4;
cohy=-4;
cohm=-4;
end;

/* Cohabitation and marriage started at the same time, but stopped in R6.*/
if (m45001=1 or prevmsta =4 or prevmsta =3) and m48001m>0 and m48001y>0 and m700011y =-4
and p2=-4 and (m540011=-4 and m540012=-4) and (m114001<=1 or m114001=6)
then flagm=1;
if flagm=1 then do;
endm=(m48001y*100)+m48001m;
cendm=((round(endm,100)-198000)*.12+(endm-round(endm,100)))-1;
end;

/* Cohabitation and marriage started at the same time.
for cohabitation lasted less than one month*/
if flagm=1 and m31001y>0 and m31001y=m48001y and m31001m=m48001m and m700011y =-4
and p2=-4 and (m540011=-4 and m540012=-4) and m114001<=1
then flagmm=1;
if flagmm=1 then do;
endm=(m48001y*100)+m48001m;
cendm=((round(endm,100)-198000)*.12+(endm-round(endm,100)));
end;
if (m45001=1 or prevmsta =4 or prevmsta =3) and m920011m>0 and m920011y>0 and m700011y =-4
and p2=-4 and (m540011=-4 and m540012=-4) and m114001<=1
then flagm1=1;
if flagm1=1 then do;
endm1=(m920011y*100)+m920011m;
cendm1=((round(endm1,100)-198000)*.12+(endm1-round(endm1,100)))-1;
end;
/* Cohabitation and marriage started at the same time. count as marriage only*/
do l=169 to doicm;
if (flagm=1 or flagmm=1 or flagm1=1 ) and l>cendm and m47002 ne 1 then cohh=.;
end;
/* Cohabitation and marriage started at the same time. calculate the stopping dates*/
if (m45001=1 or prevmsta =4 or prevmsta =3) and m48001m>-4 and m48001y>-4 and m700011y>-4
and p2=-4 and (m540011=-4 and m540012=-4) and (m114001<=1 or m114001=6)
then flagn=1;
if flagn=1 then do;
endm=(m48001y*100)+m48001m;
cendm=((round(endm,100)-198000)*.12+(endm-round(endm,100)))-1;
end;
if flagn=1 and m31001y>0 and m31001y=m48001y and m31001m=m48001m and m700011y >-4
and p2=-4 and (m540011=-4 and m540012=-4) and m114001<=1
then flagnn=1;
if flagnn=1 then do;
endm=(m48001y*100)+m48001m;
cendm=((round(endm,100)-198000)*.12+(endm-round(endm,100)));
end;

if (m45001=1 or prevmsta =4 or prevmsta =3) and m920011m>0 and m920011y>0 and m700011y >-4
and p2=-4 and (m540011=-4 and m540012=-4) and m114001<=1
then flagn1=1;
if flagn1=1 then do;
endm1=(m920011y*100)+m920011m;
cendm1=((round(endm1,100)-198000)*.12+(endm1-round(endm1,100)))-1;
end;
do l=169 to doicm;
if (flagn=1 or flagnn=1 or flagn1=1 ) and cendm<l<csmca2 then cohh=.;
if ((flagn=1 or flagnn=1 or flagn1=1 ) and csmca3>0) and cemca2<l<csmca3 then cohh=.;
end;


if (prevmsta =4 or prevmsta =3 or m45001=1) and (m48001y>-4 or m48002y>-4 or m48003y>-4) and
(m540011>-4 or m540012>-4 or m540013>-4 or m114001>1 or m114001>1 )and m114001 ne 6 then flagsp=1;
if (prevmsta=3 or prevmsta=4) and p1>0 and m46701=-4 and m31001y>-4 then flagsp1=1;


linkr6=min(of link169-link283);
do l=start to doicm;
if (flagsp=1 or flagsp1=1) and mars<2 then mars=2;
if flagsp=1 and cemca1<=l<csmsa1 then do;
link=linkr6;
if linkr6=. then link=p1r5;
end;
if flagsp=1 and p2=-4 and 0<cohh<cohhr5 then cohh=cohhr5;
if flagsp=1 and p2=-4 and m45001=1 and cohhr5<201 then cohh=201;
end;


/*report first time marriage dates that happened before dli, but never mentioned in R5 */
if pubid=2642 then do;
do l=273 to doicm;
cohh=101;
end;
cohm=9;
cohy=2002;
cohcm=273;
coh_ttl=1;
mar_ttl=1;
end;

if pubid=2845 then do;
do l=start to 277;
cohh=101;
end;
coh_ttl=1;
mar_ttl=1;
cohy=2001;
cohm=1;
cohcm=253;
end;

/* report first time marriage dates and stop dates that happened before dli, report new cohabitation in R6*/

if pubid=6880 then do;
do l=start to doicm;
cohh=102;
link=p2;
marstat=4;
coh_ttl=2;
end;
end;

/* legal separation in R3*/
if pubid=3427 then do;
marstat=5;
cmarstat=2;
do l=265 to doicm;
mars=3;
end;
end;

/* Do not have stopping dates in R6 and R5. back to live with R5 partner again*/
do l=274 to doicm;
if pubid=7463 then do;
cohh=201;
end;
end;



/* Hand edit cases who reported marriage, stopping, and/or separation dates before or at dli. non-current partners*/

if pubid in(
3430,
4316,
4353,
4462,
8968)

then do;
do l=start to doicm;
mars=2;
link=p1;
marstat=4;
cmarstat=1;
end;
end;

if pubid =4462 then do;
do l=start to doicm;
cohh=.;
end;
end;


/* cohabiting with more than one partner at the same time*/
if pubid=5324 then do;
do l=273 to 274;
cohh=103;
coh_ttl=4;
link=602;
end;
end;
if pubid=5324 then do;
do l=275;
cohh=104;
end;
end;

if pubid=1200 then do;
do l=start to 274;
mars=3;
end;
end;

if pubid=4111 then do;
do l=start to 273;
mars=3;
link=-4;
end;
end;


if pubid=5785 then do;
do l=243;
cohh=201;
end;
end;

if pubid=2116 then do;
marcm=253;
marm=1;
end;

/* correct 202 to 201 if it is first marriage for very few cases*/
if prevmsta<3 and (m8200111y>-4 or m8200211y>-4 or m45001=1 or m45002=1 ) then do;
do l=start to doicm;
if cohh>201 then do;
cohh=201;
mar_ttl=1;
end;
end;
end;

if precoh_ttl=0 and coh_ttl=2 and p2=-4 then do;
do l=start to doicm;
if cohh>101 then do;
cohh=101;
coh_ttl=1;
end;
end;
end;

/* recode stopping dates at the time of dli*/
if precoh_ttl=coh_ttl and (0<p1<601 and p2>=601) then do;
coh_ttl=coh_ttl+1;
do l=start to doicm;
if 0<cohh<200 then do;
cohh=cohh+1;
end;
end;
end;


/*divorce dates were the time of dli, then married with new partner*/
if pubid = 4862 then do;
do l=start to 273;
mars=4;
link=-4;

cohh=-4;
end;
do l=270 to 273;
link=p2;
cohh=101;
end;
do l=274 to doicm;
mars=2;
link=p2;
cohh=202;
coh_ttl=1;
mar_ttl=2;
end;
end;

/*stopping dates were the time of dli*/
if pubid in (1260,5997,6025,7718,6446, 6663) then do;
do l=start to doicm;
if cohh>0 then cohh=cohh+1;
end;
coh_ttl=coh_ttl+1;
end;


/* no stopping year for cohabitation, count dli as stopping year*/
if pubid =1436 then do;
do l=doicm;
cohh=.;
end;
end;

if pubid =3825 then do;
do l=doicm;
cohh=.;
end;
end;

/* married with new partner before The EX spouse moved out of the house */
if pubid =6474 then do;
marstat=3;
cmarstat=1;
do l=doicm;
mars=2;
end;
end;

/* marriage and divorce dates reported in R5, and no partner name in R6*/
if pubid =6892 then do;
do l=start to doicm;
mars=4;
cmarstat=3;
marstat=8;
mar_ttl=mar_ttl5;
end;
end;


/** 16 cases married before dli. No spouse names in R6 partner roster because they were legally separated,*/
/*not because they broke up.*/
if pubid in (370, 1928, 3803, 3933, 4046, 4061, 4236, 4258, 5387, 5651, 5845, 7443, 8309, 8522,
8534, 8556) then flagnoname=1;

if flagnoname=1 then do;
do l=start to doicm;
cohh=.;
mars=3;
link=.;
marstat=6;
cmarstat=2;
mar_ttl=premar_ttl;
end;
end;



do l=169 to dlicm;
mars=-4;
link=-4;
cohh=-4;
end;

do l= start to 283;
if mars=. then mars=-4;
if link=. then link=-4;
if cohh=. then cohh=-4;
end;

if int_y=-5 and int_m=-5 then do;
marstat=-5;
cmarstat=-5;
cohcm=-5;
cohm=-5;
cohy=-5;
marcm=-5;
mary=-5;
marm=-5;
coh_ttl=-5;
mar_ttl=-5;
r6dual=-5;
end;

endsas;

Return to top


Youth's Fertility and Child Status

Variables Created:

  1. month and year of birth of youth's first (second, third) child <actual time>:
    CV_CHILD_BIRTH_DATE.xx_M CV_CHILD_BIRTH_DATE.xx_Y
  2. month of birth of youth's first (second, third) child <continuous month scheme>:
    CV_CHILD_BIRTH_MONTH.xx
  3. month and year of death of youth's bio-children:
    CV_CHILD_DEATH_DATE_.xxM CV_CHILD_DEATH_DATE.xx_Y
  4. month of death of youth's bio-children <continuous month scheme>:
    CV_CHILD_DEATH_MONTH.xx
  5. status of youth's first (second, third, fourth) child: CV_CHILD_STATUS.xx
  6. number of children ever born (biological, not adopted) to the youth as of the survey date
    and residing in the household: CV_BIO_CHILD_HH
  7. number of children ever born (biological, not adopted) to the youth as of the survey date
    not residing in the household: CV_BIO_CHILD_NR

Variables Used

Name in Program

Question Name on CD

Name in Program

Question Name on CD

CV01

CV_CHILD_BIRTH_MONTH_01_2001

DEAD01

BIOADOPTCHILD_DEAD_01_2002

CV02

CV_CHILD_BIRTH_MONTH_02_2001

DEAD02

BIOADOPTCHILD_DEAD_02_2002

CV03

CV_CHILD_BIRTH_MONTH_03_2001

DEAD03

BIOADOPTCHILD_DEAD_03_2002

CV04 CV_CHILD_BIRTH_MONTH_04_2001 DEAD04 BIOADOPTCHILD_DEAD_04_2002
CV05 CV_CHILD_BIRTH_MONTH_05_2001 DEAD05 BIOADOPTCHILD_DEAD_05_2002
DATE1MR5 CV_CHILD_DEATH_DATE_01_M_2001 DEAD06 BIOADOPTCHILD_DEAD_06_2002
DATE1YR5 CV_CHILD_DEATH_DATE_01_Y_2001 RESIDE01 BIOADOPTCHILD_RESIDE_01_2002
MONTH1R5 CV_CHILD_DEATH_MONTH_01_2001 RESIDE02 BIOADOPTCHILD_RESIDE_02_2002
STAT1R5 CV_CHILD_STATUS_01_2001 RESIDE03 BIOADOPTCHILD_RESIDE_03_2002
STAT2R5 CV_CHILD_STATUS_02_2001 RESIDE04 BIOADOPTCHILD_RESIDE_04_2002
STAT3R5 CV_CHILD_STATUS_03_2001 RESIDE05 BIOADOPTCHILD_RESIDE_05_2002
STAT4R5 CV_CHILD_STATUS_04_2001 RESIDE06 BIOADOPTCHILD_RESIDE_06_2002
STAT5R5 CV_CHILD_STATUS_05_2001 bioid01 BIOADOPTCHILD_ID_01_2002
status1 YFER_1850_01_2002 bioid02 BIOADOPTCHILD_ID_02_2002
status2 YFER_1850_02_2002 bioid03 BIOADOPTCHILD_ID_03_2002
status3 YFER_1850_03_2002 bioid04 BIOADOPTCHILD_ID_04_2002
status4 YFER_1850_04_2002 bioid05 BIOADOPTCHILD_ID_05_2002
status5 YFER_1850_05_2002 bioid06 BIOADOPTCHILD_ID_06_2002
status6 YFER_1850_06_2002 biouid01 BIOADOPTCHILD_UID_01_2002
BD01 BIOADOPTCHILD_BDATE_01_D_2002 biouid02 BIOADOPTCHILD_UID_02_2002
BM01 BIOADOPTCHILD_BDATE_01_M_2002 biouid03 BIOADOPTCHILD_UID_03_2002
BY01 BIOADOPTCHILD_BDATE_01_Y_2002 biouid04 BIOADOPTCHILD_UID_04_2002
BD02 BIOADOPTCHILD_BDATE_02_D_2002 biouid05 BIOADOPTCHILD_UID_05_2002
BM02 BIOADOPTCHILD_BDATE_02_M_2002 biouid06 BIOADOPTCHILD_UID_06_2002
BY02 BIOADOPTCHILD_BDATE_02_Y_2002 f4830_1 YFER_4830_01_2002
BD03 BIOADOPTCHILD_BDATE_03_D_2002 f4830_2 YFER_4830_02_2002
BM03 BIOADOPTCHILD_BDATE_03_M_2002 f5900_1 YFER_5900_01_2002
BY03 BIOADOPTCHILD_BDATE_03_Y_2002 f5900_2 YFER_5900_02_2002
BD04 BIOADOPTCHILD_BDATE_04_D_2002 YFER12001 YFER_1200_01_2002
BM04 BIOADOPTCHILD_BDATE_04_M_2002 YFER12002 YFER_1200_02_2002
BY04 BIOADOPTCHILD_BDATE_04_Y_2002 YFER12003 YFER_1200_03_2002
BD05 BIOADOPTCHILD_BDATE_05_D_2002 YFER12004 YFER_1200_04_2002
BM05 BIOADOPTCHILD_BDATE_05_M_2002 YFER12005 YFER_1200_05_2002
BY05 BIOADOPTCHILD_BDATE_05_Y_2002 YFER13001D YFER_1300_01_D_2002
BD06 BIOADOPTCHILD_BDATE_06_D_2002 YFER13001M YFER_1300_01_M_2002
BM06 BIOADOPTCHILD_BDATE_06_M_2002 YFER13001Y YFER_1300_01_Y_2002
BY06 BIOADOPTCHILD_BDATE_06_Y_2002 YFER13002D YFER_1300_02_D_2002
dm01 BIOADOPTCHILD_DOD_01_M_2002 YFER13002M YFER_1300_02_M_2002
dy01 BIOADOPTCHILD_DOD_01_Y_2002 YFER13002Y YFER_1300_02_Y_2002
dm02 BIOADOPTCHILD_DOD_02_M_2002 adopt1 YFER_5850_01_2002
dy02 BIOADOPTCHILD_DOD_02_Y_2002 adopt2 YFER_5850_02_2002
dm03 BIOADOPTCHILD_DOD_03_M_2002 pubid PUBID
dy03 BIOADOPTCHILD_DOD_03_Y_2002

Codes for Created Variables

Date of birth and death variables: Date variables are presented as both the actual month and year and the month number in a continuous month scheme.

Status variables

1 Adopted
2 Deceased
3 Non-resident, foster care
4 Non-resident, not adopted or in foster care
5 Resident

This program creates a number of variables describing the youth's fertility and the current status of the youth's children.  For more information on the continuous month system, see appendix 7 in this document.


/* child had correct birth dates in R4, YFER1200=1 AND YFER1300=28/7/1999.*/
if pubid=440 then do;
bm03=7;
by03=1999;
end;

 

/* first, create a variable indicating the bmonth(i), birth month, and byear(i), birth year, for each biological child. This part, use variable from roster: BIOADOPT, which is the "clean" roster for all bio children */

 

array bmonth(6) bm01-bm06;

array byear(6) by01-by06;

 

/* second, create a continuous month scheme variable for the month of birth of the children using the formula: (12*(byear(i)-1980)+bmonth(i)) */

 

array mob(6) mob1-mob6;

 

do i=1 to 6;

  mob(i)=-4;

  if bmonth(i) gt 0 then mob(i)=12*(byear(i)-1980)+bmonth(i);

  if bmonth(i) =-2 then bmonth(i) =-3;
  if byear(i) = -2 then byear(i)=-3;
  if bmonth(i) = -3 then mob(i)=-3;
  if bmonth(i) = -5 then mob(i)=-5;

end;

 

/* third, create an actual date variable for the date of death of the youth's children */

 

dm04=-4;
dm05=-4;
dm06=-4;
dy04=-4;
dy05=-4;
dy06=-4;

 

array dmonth[6] dm01-dm03 dm04 dm05 dm06;

array dyear[6] dy01-dy03 dy04 dy05 dy06;

array dead[6] dead01-dead06;

array reside[6] reside01-reside06;

 

/* fourth, create a continuous month scheme variable for the month of death of the children using the formula: (12*(dody(i)-1980)+dodm(i)) */

 

array mod[6] mod1-mod6;

 

do i=1 to 6;

  if dmonth(i)=-4 then mod(i)=-4;

  if dmonth(i) gt 0 and dyear(i) ge 1980 then mod(i)=12*(dyear(i)-1980)+dmonth(i);

  if dmonth(i)=-3 then mod(i)=-3;

  if dmonth(i)=-5 then mod(i)=-5;

end;

 

/* fifth, create a variable indicating the status of youth's first (second, third) child:

    1. Adopted

    2. Deceased

    3. Non-resident, foster care

    4. Non-resident, not adopted out or in foster care

    5. Resident  */

 

/*update status for newly found children*/

if f4830_1>0 then do;

   if f4830_1=bioid01 then status1=f5900_1;

   else if f4830_1=bioid02 then status2=f5900_1;

   else if f4830_1=bioid03 then status3=f5900_1;

   else if f4830_1=bioid04 then status4=f5900_1;

   else if f4830_1=bioid05 then status5=f5900_1;

   else if f4830_1=bioid06 then status6=f5900_1;

end;

if f4830_2>0 then do;

   if f4830_2=bioid01 then status1=f5900_2;

   else if f4830_2=bioid02 then status2=f5900_2;

   else if f4830_2=bioid03 then status3=f5900_2;

   else if f4830_2=bioid04 then status4=f5900_2;

   else if f4830_2=bioid05 then status5=f5900_2;

   else if f4830_2=bioid06 then status6=f5900_2;

end;

 

array status[6] status1-status6;

array stat_n[6] stat_n1-stat_n6;

 

do i=1 to 6;

  if status(i)=-4 and mob(i)>0 then status(i)=9999;

end;

 

/* corrected wrong status including those who have Different ID in R5 and R6.
Verified, it is same child in R5 and R6*/
do i=1 to 6;
if pubid in (161, 227, 1097, 2009, 2099, 3826, 6780, 8076) and status[i]=9999 then do;
status[i]=f5900_1 ;
end;
end;

 

do i=1 to 6;

  if status(i)=1 then stat_n(i)=5;

  else if status(i)=2 then stat_n(i)=4;

  else if status(i)=3 then stat_n(i)=1;

  else if status(i)=4 then stat_n(i)=3;

  else if status(i)=5 then stat_n(i)=4;

  else if status(i)=6 then stat_n(i)=5;

  else if status(i)=7 then stat_n(i)=5;

  else if status(i)=8 then stat_n(i)=4;

  else if status(i)=9 then stat_n(i)=2;

  else if status(i)=10 then stat_n(i)=-3;          

  else if status(i)=11 then stat_n(i)=4;

  else if status(i)=12 then stat_n(i)=4;

  else if status(i)=9999 then stat_n(i)=-16;

  else if status(i)=-1 or status(i)=-2 or status(i)=-3 then stat_n(i)=-3;

  else if status(i)=-4 then stat_n(i)=-4;

  else if status(i)=-5 then stat_n(i)=-5;

end;

 

/* correct wrong status including those who died and those who were adopted out in previous rounds */

array bioid (6) bioid01-bioid06;

do i=1 to 6; 

  if dmonth(i) gt -4 and dead(i)=1 then stat_n(i)=2;

end;

 

/* correct wrong status including those who do not report status */
do i=1 to 6;
if stat_n(i)=-16 then do;
if pubid in
(51,
80,
1425,
2426,
3516,
6169,
6991,
7630,
7727,
7733,
7737 ) then stat_n(i)=4;
if pubid in( 3516, 6991) then stat_n(i)=5 ;
end;
end;
if pubid=440 then stat_n3=-3; 

 

/* END OF ROUND 6 FIXES */ 

 

/* sixth, the number of children ever born and residing in the household (tbiores) */

 

array biores[6] biores1-biores6;

 

do i=1 to 6;

  biores(i)=0;

  if stat_n(i) eq 5 then biores(i)=1;

end;

 

tbiores=biores1+biores2+biores3+biores4+biores5+biores6;

if stat_n1=-3 or stat_n2=-3 or stat_n3=-3 or stat_n4=-3 or stat_n5=-3 or stat_n6=-3 then tbiores=-3;

if (mob1=-4 and mob2=-4 and mob3=-4 and mob4=-4 and mob5=-4 and mob6=-4) then tbiores=-4;

if mob1=-5 then tbiores=-5;

 

/* seventh, the number of children ever born and not residing in the household (tbionres) */

 

array bionres[6] bionres1-bionres6;

 

do i=1 to 6;

  bionres(i)=0;

  if (stat_n(i) eq 1 or stat_n(i) eq 3 or stat_n(i) eq 4) and stat_n(i) ne 2 then bionres(i)=1;

end;

 

tbionres=bionres1+bionres2+bionres3+bionres4+bionres5+bionres6;

if stat_n1=-3 or stat_n2=-3 or stat_n3=-3 or stat_n4=-3 or stat_n5=-3 then tbionres=-3;

if (mob1=-4 and mob2=-4 and mob3=-4 and mob4=-4 and mob5=-4) then tbionres=-4;

if mob1=-5 then tbionres=-5;

   

/* Last, sort created variables by birthdays, so that the first child listed is the oldest child. */

array smob[6] smob1-smob6;

 

do i=1 to 6; smob(i)=mob(i); end;

 

do i=1 to 6;

  if mob(i)=-3 then smob(i)=1000;

  if mob(i)=-4 then smob(i)=9999;

end;

 

m1=-4; m2=-4; m3=-4; m4=-4; m5=-4; m6=-4

 

/* order the children by birthdate, start with oldest */

 

m1=min(smob1, smob2, smob3, smob4, smob5, smob6);

/* set min birthdate to missing to remove from potential list */

if m1=smob1 then smob1=9999;

else if m1=smob2 then smob2=9999;

else if m1=smob3 then smob3=9999;

else if m1=smob4 then smob4=9999;

else if m1=smob5 then smob5=9999;

else if m1=smob6 then smob6=9999;

 

/* move onto second oldest */

m2=min(smob1, smob2, smob3, smob4, smob5, smob6);

if m2=smob1 then smob1=9999;

else if m2=smob2 then smob2=9999;

else if m2=smob3 then smob3=9999;

else if m2=smob4 then smob4=9999;

else if m2=smob5 then smob5=9999;

else if m2=smob6 then smob6=9999;

 

/* move onto third oldest */

m3=min(smob1, smob2, smob3, smob4, smob5, smob6);

if m3=smob1 then smob1=9999;

else if m3=smob2 then smob2=9999;

else if m3=smob3 then smob3=9999;

else if m3=smob4 then smob4=9999;

else if m3=smob5 then smob5=9999;

else if m3=smob6 then smob6=9999;

 

/* move onto fourth oldest */

m4=min(smob1, smob2, smob3, smob4, smob5, smob6);

if m4=smob1 then smob1=9999;

else if m4=smob2 then smob2=9999;

else if m4=smob3 then smob3=9999;

else if m4=smob4 then smob4=9999;

else if m4=smob5 then smob5=9999;

else if m4=smob6 then smob6=9999;

 

/* move onto fifth oldest */

m5=min(smob1, smob2, smob3, smob4, smob5, smob6);

if m5=smob1 then smob1=9999;

else if m5=smob2 then smob2=9999;

else if m5=smob3 then smob3=9999;

else if m5=smob4 then smob4=9999;

else if m5=smob5 then smob5=9999;

else if m6=smob6 then smob6=9999;

 

/* move onto sixth oldest */
m6=min(smob1, smob2, smob3, smob4, smob5, smob6);
if m6=smob1 then smob1=9999;
else if m5=smob2 then smob2=9999;
else if m5=smob3 then smob3=9999;
else if m5=smob4 then smob4=9999;
else if m5=smob5 then smob5=9999;
else if m5=smob6 then smob6=9999;

       

if m1=9999 then m1=-4;

if m2=9999 then m2=-4;

if m3=9999 then m3=-4;

if m4=9999 then m4=-4;

if m5=9999 then m5=-4;

if m6=9999 then m6=-4;

 

if m1=1000 then m1=-3;

if m2=1000 then m2=-3;

if m3=1000 then m3=-3;

if m4=1000 then m4=-3;

if m5=1000 then m5=-3;

if m6=1000 then m6=-3;

 

      

array cv02bm[6] cv02bm1-cv02bm6;

array cv02by[6] cv02by1-cv02by6;

array cv02mob[6] cv02mob1-cv02mob6;

array cv02dm[6] cv02dm1-cv02dm6;

array cv02dy[6] cv02dy1-cv02dy6;

array cv02mod[6] cv02mod1-cv02mod6;

array cv02stat[6] cv02sta1-cv02sta6;

 

do i=1 to 6;

   if m1=mob(i) then do;

   cv02bm1 =bmonth(i);

   cv02by1 =byear(i);

   cv02mob1=mob(i);

   cv02dm1 =dmonth(i);

   cv02dy1 =dyear(i);

   cv02mod1=mod(i);

   cv02sta1=stat_n(i);

   end;

end;

 

do i=1 to 6;

   if m2=mob(i) then do;

   cv02bm2 =bmonth(i); 

   cv02by2 =byear(i);  

   cv02mob2=mob(i);    

   cv02dm2 =dmonth(i); 

   cv02dy2 =dyear(i);  

   cv02mod2=mod(i);    

   cv02sta2=stat_n(i); 

   end;

end;

 

do i=1 to 6;

   if m3=mob(i) then do;

   cv02bm3 =bmonth(i); 

   cv02by3 =byear(i);  

   cv02mob3=mob(i);    

   cv02dm3 =dmonth(i); 

   cv02dy3 =dyear(i);  

   cv02mod3=mod(i);    

   cv02sta3=stat_n(i); 

   end;

end;

 

do i=1 to 6;

   if m4=mob(i) then do;

   cv02bm4 =bmonth(i); 

   cv02by4 =byear(i);  

   cv02mob4=mob(i);    

   cv02dm4 =dmonth(i); 

   cv02dy4 =dyear(i);  

   cv02mod4=mod(i);    

   cv02sta4=stat_n(i); 

   end;

end;

 

do i=1 to 6;

   if m5=mob(i) then do;

   cv02bm5 =bmonth(i); 

   cv02by5 =byear(i);  

   cv02mob5=mob(i);    

   cv02dm5 =dmonth(i); 

   cv02dy5 =dyear(i);  

   cv02mod5=mod(i);    

   cv02sta5=stat_n(i); 

   end;

end;

 

do i=1 to 6;
if m6=mob(i) then do;
cv02bm6 =bmonth(i);
cv02by6 =byear(i);
cv02mob6=mob(i);
cv02dm6 =dmonth(i);
cv02dy6 =dyear(i);
cv02mod6=mod(i);
cv02sta6=stat_n(i);
end;
end;


do i=1 to 6;
if dmonth(i)=-5 then do;
cv02dm[i]=-5;
cv02dy[i]=-5;
cv02mod[i]=-5;
end;
end;

/* create newly adopted child flag. These adopted children should not be included
in created variables*/
if adopt1=1 and pubid in (8719, 6446) then do;
cv02bm1=-4;
cv02by1=-4;
cv02mob1=-4;
cv02sta1=-4;
stat_n1=-4;
tbiores=-4;
tbionres=-4;
end;

/* three children. only one of them is biological*/
if pubid = 6465 then do;
cv02bm2=-4;
cv02by2=-4;
cv02mob2=-4;
cv02sta2=-4;
stat_n2=-4;
tbiores=1;
end;
/* two children. The older one is adopted child*/
if pubid=8885 then do;
cv02bm1=cv02bm2;
cv02by1=cv02by2;
cv02mob1=cv02mob2;
cv02sta1=cv02sta2;
stat_n1=stat_n2;
cv02bm2=-4;
cv02by2=-4;
cv02mob2=-4;
cv02sta2=-4;
stat_n2=-4;
tbiores=tbiores-1;
end;
/* One of the children is adopted child*/
if pubid=6464 then do;
cv02bm3=-4;
cv02by3=-4;
cv02mob3=-4;
cv02sta3=-4;
stat_n3=-4;
tbiores=tbiores-1;
end;



/* three cases who have incorrect birthdates (1982, 1982, 1980)
correct birthdates are in 97 merged HH_BD*/
if pubid =2094 then do;
cv02bm1=11;
cv02by1=2001;
cv02mob1=263;
end;

if pubid=3165 then do;
cv02bm1=12;
cv02by1=2002;
cv02mob1=276;
end;

if pubid=7283 then do;
cv02bm1=8;
cv02by1=2001;
cv02mob1=248;
end;

/* incorrect birthdates in R6. Corrected based on YFER1200 YFER1300 in R5 */

if pubid =1389 then do;
cv02bm2=4;
cv02by2=1999;
cv02mob2=232;
end;

if pubid =1722 then do;
cv02bm1=4;
cv02by1=1999;
cv02mob1=232;
end;

if pubid = 3118 then do;
cv02bm1=5;
cv02by1=1994;
cv02mob1=173;
end;

if pubid =3826 then do;
cv02bm1=8;
cv02by1=2001;
cv02mob1=260;
end;

if pubid = 6025 then do;
cv02bm1=12;
cv02by1=1998;
cv02mob1=228;
end;

if pubid = 7283 then do;
cv02bm1=8;
cv02by1=2001;
cv02mob1=260;
end;



/* No fourth child, delete Fourth Child */
if pubid=7924 then do;
tbiores=3;
stat_n4=-4;
end;

/*Add children missing in round 6 but who were in previous rounds. Most of missing children had been adopted.*/
/* These children were added from previous round to R6*/

/*Case 1:One child listed in R5, None listed in R6 */
if pubid in (635,1321,1901,2861,3211,3450,3508,5272,8212) then do;

cv02bm1 = BM01r5 ;
cv02by1 = BY01r5;
cv02mob1 = CV01;
cv02sta1 = STAT1R5;
tbiores = tbioresR5;
tbionres = tbionresR5;
end;

/*Case 2: Two children listed in R5. None listed in R6*/
if pubid=769 then do;
cv02bm1 = BM01r5;
cv02by1 = BY01r5;
cv02mob1 = CV01;
cv02sta1 = STAT1R5;
cv02bm2 = BM02r5;
cv02by2 = BY02r5;
cv02mob2 = CV02;
cv02sta2 = STAT2R5;
tbiores =tbioresR5;
tbionres =tbionresR5;
end;

/*Case 3:Two children listed in R5. Only one child listed in R6*/
if pubid in (2370, 3924, 7630) then do;
cv02bm1 = BM01r5;
cv02by1 = BY01r5;
cv02mob1 = CV01;
cv02sta1 = STAT1R5;
cv02bm2 = BM02r5;
cv02by2 = BY02r5;
cv02mob2 = CV02;
cv02sta2 = STAT2R5;
tbiores = tbioresR5;
tbionres = tbionresR5;
end;

/*Case 4: Three children listed in R5. Only two listed in R6 */
if pubid in(1056, 7796,2822) then do;
cv02bm1 = BM01r5;
cv02by1 = BY01r5;
cv02mob1 = CV01;
cv02sta1 = STAT1R5;
cv02bm2 = BM02r5;
cv02by2 = BY02r5;
cv02mob2 = CV02;
cv02sta2 = STAT2R5;
cv02bm3 = BM03r5;
cv02by3 = BY03r5;
cv02mob3 = CV03;
cv02sta3 = STAT3R5;
tbiores = tbioresR5;
tbionres = tbionresR5;
end;

/*Case 5: One child listed in R5 and another child was added in R6.
In R6, only the new child was listed. The child in R5 was added in R6*/
if pubid in (4255,5615,6072) then do;
cv02bm2 = cv02bm1;
cv02by2 = cv02by1;
cv02mob2 = cv02mob1;
cv02sta2 = cv02sta1;
cv02bm1 = BM01r5;
cv02by1 = BY01r5;
cv02mob1 = CV01;
cv02sta1 = STAT1R5;
tbiores = tbioresR5+tbiores;
tbionres = tbionresR5+tbionres;
end;

/*Case 6: Child death record listed in Round 5, but the record did not show up in R6. */
if pubid=1056 then do;
cv02dm1 =3;
cv02dy1 =1997;
cv02mod1=207;
cv02sta1 = 2;

end;

/*Case 7: Child death record listed in Round 4, but the record did not show up in R5 and R6. */
if pubid =8729 then do;
cv02bm3 = 11 ;
cv02by3 = 1992;
cv02mob3 = 155;
cv02sta3 = 2;
cv02dm3 = 11;
cv02dy3 = 1996;
cv02mod3= 203;

end;

/*case 8 This child listed in R5. but the record did not show up in R6. given up for adoption in R5*/
if pubid =5494 then do;
cv02bm1 = -3;
cv02by1 = -3;
cv02mob1 = -3;
cv02sta1 = 1;
tbiores = tbioresR5;
tbionres = tbionresR5;
end;



/* In R6, respondent corrected the child's birth date, the old birth date was still used in R6. Corrected*/
if pubid=2822 then do;
cv02bm2 =6;
cv02by2 =2001;
cv02mob2=258;
tbiores =2;
tbionres =1;
end;


/* Child birth records listed in Round 5, did not show up in R6, but showed up in R7. Included in R6*/
/* Checked: They were not adopted. */

if pubid in (1901,5615) then do;
cv02sta1 = -3;
tbiores = -3;
tbionres = -3;
end;

if pubid =7630 then do;
cv02sta1 = -3;
cv02sta2 = -3;
tbiores = -3;
tbionres = -3;
end;

/* reported as deceased in R1. not included in Roster. */
if pubid =2310 then do;
cv02bm2 = 8;
cv02by2 = 1995;
cv02mob2 = 188;
cv02sta2 = 2;
cv02dm2 = -3;
cv02dy2 = -3;
cv02mod2= -3;
end;

/* reported in R2, not included in Roster.*/
if pubid=3299 then do;
cv02bm1 = 2 ;
cv02by1 = 1997 ;
cv02mob1 = 206 ;
cv02sta1 = -3 ;
cv02bm2 = 2 ;
cv02by2 = 1997;
cv02mob2 = 206;
cv02sta2 = -3;
tbiores = -3;
tbionres = -3;
end;

/* reported in R3, not included in Roster.*/
if pubid=8052 then do;
cv02bm1 = 11;
cv02by1 = 1998;
cv02mob1 = 227;
cv02sta1 = -3 ;
tbiores = -3 ;
tbionres = -3 ;
end;

/* verified, child needs to be included in R6*/
if pubid=8346 then do;
cv02bm1 = 7;
cv02by1 = 1998;
cv02mob1 = 223;
cv02sta1 = -3 ;
tbiores = -3 ;
tbionres = -3 ;
end;

/* one child added in R6*/
if pubid=441 then do;
cv02bm2 = 11;
cv02by2 = 1998;
cv02mob2 = 227;
cv02sta2 = -3 ;
tbiores = -3 ;
tbionres = -3 ;
end;

/* there should be only one child, not two. One deleted*/
if pubid=80 then do;
cv02bm2 = -4;
cv02by2 = -4;
cv02mob2 = -4;
cv02sta2 = -4;
tbionres = -4;
end;


endsas;

Return to top


Number of Residences Since Age 12

Variables Created

Question Name on CD

Name in Program

CV_TTL_RESIDENCES 2002 RESID

Variables Used

Question Name on CD

Name in Program

CV_TTL_RESIDENCES 1997

CVR1

CV_TTL_RESIDENCES 1998

CVR2

CV_TTL_RESIDENCES 1999

CVR3

CV_TTL_RESIDENCES 2000

CVR4

CV_TTL_RESIDENCES 2001 CVR5
YHHI-3500 2001 Y3500
YHHI-3600 2001 Y3600
PUBID 2001 PUBID

This program calculates the number of residences in which youth has lived since age 12. In round 1, the variable was created with information from the parent interview.  In round 2, information collected from the respondent was combined with the round 1 variable to update the previous information. Subsequent rounds continue to update the variable with respondent-provided data.


RESID=-4;

 

/** R interviewed in Round 5 and Round 6 **/

 

array cvr [5] cvr5 cvr4 cvr3 cvr2 cvr1;

 

do i=1 to 5;

   if cvr[i] ne -5 then do;

      cv=cvr[i];

      round=6-i;

      i=5;

   end;

end;  

 

if cv=-1 or y36005=-1 then resid=-3;                     /*refusal in dli or r6*/

if cv=-2 or y36005=-2 then resid=-3;                     /*dont know in dli or r6*/

if cv=-3 then resid=-3;                                            /*parents not interviewed in r1*/

if round=1 and cv=-4 then resid=-3;                        /*parents not interviewed in r1*/

if cv >= 0 and y3600 >= 0 then resid=cv+y3600;

if cv >= 0 and y3500=0 then resid=cv;

 

/** Respondent was not interviewed in Round 6 **/
if y3500=-5 then resid=-5;
label RESID = "CV_TTL_RESIDENCES 2001";

endsas;


Return to top Return to Table of Contents