You are here
Home › Cohorts › NLSY97 › Other Documentation › Codebook Supplement › Appendix 2: Employment Variable Creation ›Employment Status Recode - Appendix 2
Employment Status Recode - Appendix 2
Variables Created
- CV_ESR
- CV_ESR_COLLAPSED
Using data from the CPS section, this program creates a variable for the respondent's employment status during the week before the interview. The CPS section was included only in rounds 1, 4, and 10, so these variables are available only for those rounds.
Variables Used
/*Variable Names in Program Variable Names in Gator*/
CMAGE_INTD CV_AGE_MONTHS_INT_DATE
AGE_INTD CV_AGE_INT_DATE
C2400 YCPS-2400
C2600 YCPS-2600
C2800 YCPS-2800
C2900 YCPS-2900
C3100 YCPS-3100
C78001 YCPS-7800.01
C78002 YCPS-7800.02
C79001 YCPS-7900.01
C79002 YCPS-7900.02
C81001 YCPS-8100.01
C82001 YCPS-8200.01
C82002 YCPS-8200.02
C87001 YCPS-8700.01
C87002 YCPS-8700.02
C92001 YCPS-9200.01
C93001 YCPS-9300.01
C93002 YCPS-9300.02
C96001 YCPS-9600.01
C96002 YCPS-9600.02
C103001 YCPS-10300.01
C103002 YCPS-10300.02
C104001 YCPS-10400.01
C104002 YCPS-10400.02
C105001 YCPS-10500.01
C105002 YCPS-10500.02
C106001 YCPS-10600.01
C106002 YCPS-10600.02
C109001 YCPS-10900.01
C109002 YCPS-10900.02
C110001 YCPS-11000.01
C110002 YCPS-11000.02
C111001 YCPS-11100.01
C112001 YCPS-11200.01
C140001 YCPS-14000.01
C141001 YCPS-14100.01
C142001 YCPS-14200.01
C143001 YCPS-14300.01
C152001 YCPS-15200.01
C153001 YCPS-15300.01
C154001 YCPS-15400.01
C155001 YCPS-15500.01
C158001 YCPS-15800.01
C159001 YCPS-15900.01
C176001 YCPS-17600.01
C186001 YCPS-18600.01
C186002 YCPS-18600.02
C236001 YCPS-23600.01
C236002 YCPS-23600.02
C237001 YCPS-23700.01
C237002 YCPS-23700.02
C27300 YCPS-27300
C30700 YCPS-30700
C30800 YCPS-30800
PUBID PUBID
SAS Code for Variable Creation
/** We first create the ESR variable: **/
/** Initialize ESR; **/
ESR=-1;
/*since c81002 does not exist, must create it for the program to run*/
c81002=-4;
/** Define some arrays to be used later in the program at various times; **/
ARRAY C7800 (I) C78001 C78002;
ARRAY C7900 (I) C79001 C79002;
ARRAY C8100 (I) C81001 C81002;
ARRAY C8200 (I) C82001 C82002;
ARRAY C8700 (I) C87001 C87002;
ARRAY C17600 (I) C176001 C176002;
ARRAY C9300 (I) C93001 C93002;
ARRAY C9600 (I) C96001 C96002;
ARRAY C10300 (I) C103001 C103002;
ARRAY C10500 (I) C105001 C105002;
ARRAY C10900 (I) C109001 C109002;
ARRAY C11100 (I) C111001 C111002;
ARRAY C10400 (I) C104001 C104002;
ARRAY C10600 (I) C106001 C106002;
ARRAY C11000 (I) C110001 C110002;
ARRAY C11200 (I) C112001 C112002;
ARRAY C18600 (I) C186001 C186002;
ARRAY C23600 (I) C236001 C236002;
ARRAY C23700 (I) C237001 C237002;
/** [1] Calculate the USUAL HOURS WORKED PER WEEK(hruslt) **/
***FOR MORE THAN ONE JOB;
*MAIN JOB;
DO I=1 TO 2;
IF C10400 GE 0 THEN HRUSLT1=C10400;
END;
IF HRUSLT1=. THEN HRUSLT1=0;
*FOR 2 JOBS - OTHER JOB;
DO I=1 TO 2;
IF C11000 GE 0 THEN HRUSLT2=C11000;
END;
IF HRUSLT2=. THEN HRUSLT2=0;
*FOR MORE THAN 2 JOBS - OTHER JOBS;
DO I=1 TO 2;
IF C11200 GE 0 THEN HRUSLT3=C11200;
END;
IF HRUSLT3=. THEN HRUSLT3=0;
***FOR ONLY ONE JOB;
DO I=1 TO 2;
IF C10600 GE 0 THEN HRUSLT4=C10600;
END;
IF HRUSLT4=. THEN HRUSLT4=0;
HRUSLT=HRUSLT1+HRUSLT2+HRUSLT3+HRUSLT4;
/** [2] Calculate the ACTUAL HOURS WORKED LAST WEEK(hractt) **/
***FOR MORE THAN ONE JOB;
*MAIN JOB;
IF C15200 GE 0 THEN MAINJOB1=C15200;
IF C15200 LT 0 THEN MAINJOB1=0;
IF C15300 GE 0 THEN MAINJOB2=C15300;
IF C15300 LT 0 THEN MAINJOB2=0;
*FOR 2 JOBS - OTHER JOB;
IF C15900 GE 0 THEN OTHJOB=C15900;
IF C15900 LT 0 THEN OTHJOB=0;
*FOR MORE THAN 2 JOBS - OTHER JOBS;
IF C15800 GE 0 THEN OTHJOBS=C15800;
IF C15800 LT 0 THEN OTHJOBS=0;
***FOR ONLY ONE JOB;
IF C15400 GE 0 THEN ONLYJOB1=C15400;
IF C15400 LT 0 THEN ONLYJOB1=0;
IF C15500 GE 0 THEN ONLYJOB2=C15500;
IF C15500 LT 0 THEN ONLYJOB2=0;
HRACTT=MAINJOB1+MAINJOB2+OTHJOB+OTHJOBS+ONLYJOB1+ONLYJOB2;
/** [3] **/
IF (C104001=-4 and C104002=-4 and C106001=-4 and C106002=-4 and
C110001=-4 and C110002=-4 and C112001=-4 and C112002=-4 and
C15200=-4 and C15300=-4 and C15400=-4 and C15500=-4 and
C15800=-4 and C15900=-4) then JOBQSKIP=1;
/** [4] **/
DO I=1 TO 2;
IF C8100=1 THEN HADJOBLWK1=1;
IF C8200=1 THEN HADJOBLWK2=1;
END;
DO I=1 TO 2;
IF HADJOBLWK1 NE 1 AND C8100=0 THEN HADJOBLWK1=0;
IF HADJOBLWK2 NE 1 AND C8200=0 THEN HADJOBLWK2=0;
END;
IF HADJOBLWK1=. AND HADJOBLWK2 NE . THEN HADJOBLWK=HADJOBLWK2;
IF HADJOBLWK2=. AND HADJOBLWK1 NE . THEN HADJOBLWK=HADJOBLWK1;
IF (C82001=-4 AND C82002=-4 AND C81001=-4 AND C81002=-4) THEN HADJOBLWK=-4;
/** [5] **/
DO I=1 TO 2;
IF C9600=1 THEN UNPAID=1;
END;
/** [6] **/
DO I=1 TO 2;
IF C10300=995 THEN HOURSVARY=1;
IF C10500=995 THEN HOURSVARY=1;
IF C10900=995 THEN HOURSVARY=1;
IF C11100=995 THEN HOURSVARY=1;
END;
/** [7] **/
DO I=1 to 2;
IF C8700=1 THEN LAIDOFFLWK=1;
IF C9300=1 THEN LAIDOFFLWK=1;
IF C9300=2 THEN SLACKBUSLWK=1;
END;
/****************************** CHECK VARIABLES *************************/
IF C2800 LE 0 AND C2800 GE -3 AND HRACTT GT 0 THEN PROB1=1;
IF C2900 LE 0 AND C2900 GE -3 AND HRACTT GT 0 THEN PROB2=1;
if hractt le 0 then hracttN=0;
if hractt gt 0 then hracttN=1;
if hractt ge 15 then hracttN=2;
if hruslt le 0 then hrusltN=0;
if hruslt gt 0 then hrusltN=1;
if hruslt ge 15 then hrusltN=2;
IF HADJOBLWK=-4 THEN PROB3=1;
/************************************************************************/
/* IF AT WORK OR ABSENT*/
/** If hh owns a farm and worked last week or was absent from work **/
IF C2600=1 THEN DO;
IF C2900=1 THEN DO;
IF HRACTT GT 0 THEN ESR=1;
IF HRACTT LE 0 THEN DO;
IF HADJOBLWK=1 THEN DO;
IF (HRUSLT GT 0 OR HOURSVARY=1) THEN ESR=2;
IF (HRUSLT LE 0 AND HOURSVARY=.) THEN ESR=-3;
END;
IF (HADJOBLWK=0 OR HADJOBLWK=-4) AND (HOURSVARY=1 OR HRUSLT GT 0) THEN ESR=-3;
END;
END;
IF C2900=0 THEN DO;
IF C3100=1 THEN DO;
IF HRACTT GE 15 THEN ESR=1;
IF HRACTT LT 15 AND HRUSLT GE 15 THEN DO;
ESR=2;
ESRFLAG=1;
END;
END;
IF C3100 NE 1 THEN DO;
IF HADJOBLWK=1 THEN DO;
IF (HRUSLT GT 0 OR HOURSVARY=1) THEN ESR=2;
IF (HRUSLT LE 0 AND HOURSVARY=.) THEN DO;
IF UNPAID=1 THEN ESR=2;
ELSE IF UNPAID=. THEN ESR=-3;
END;
END;
IF (HADJOBLWK=0 OR HADJOBLWK=-4) AND (HOURSVARY=1 OR HRUSLT GT 0) THEN ESR=-3;
END;
END;
END;
/** If hh does not own a farm and worked or was absent from work during last week **/
IF C2600 < 1 THEN DO;
IF C2800=1 THEN DO;
IF HRACTT GT 0 THEN ESR=1;
IF HRACTT LE 0 THEN DO;
IF HADJOBLWK=1 THEN DO;
IF (HRUSLT GT 0 OR HOURSVARY=1) THEN ESR=2;
IF (HRUSLT LE 0 AND HOURSVARY=.) THEN ESR=-3;
END;
IF (HADJOBLWK=0 OR HADJOBLWK=-4) AND (HOURSVARY=1 OR HRUSLT GT 0) THEN ESR=-3;
END;
END;
IF C2800=0 THEN DO;
IF HADJOBLWK=1 THEN DO;
IF (HRUSLT GT 0 OR HOURSVARY=1) THEN ESR=2;
IF (HRUSLT LE 0 AND HOURSVARY=.) THEN ESR=-3;
END;
IF (HADJOBLWK=0 OR HADJOBLWK=-4) AND (HOURSVARY=1 OR HRUSLT GT 0) THEN ESR=-3;
END;
END;
/** IF LAID OFF DURING LAST WEEK **/
DO I=1 TO 2;
IF (LAIDOFFLWK=1 AND C17600=1) THEN ESR=3;
IF (SLACKBUSLWK=1 AND C17600=1) THEN ESR=3;
END;
/** If unemployed and looking for a job during last week **/
DO I=1 to 2;
IF (C18600=1 AND C23600=1) OR (C18600=1 AND C23600=0 AND C23700=1) THEN ESR=4;
END;
/** If not in the labor force and retired **/
IF (C2800=2 OR C2900=2 OR C30800=5) THEN ESR=5;
/** If not in the labor force and disabled **/
/** If hh owns a farm: **/
DO I=1 to 2;
IF C2600=1 THEN DO;
IF C2900=3 AND (C7800=1 OR C7900=1) THEN ESR=6;
END;
END;
/** If hh does not own a farm: **/
DO I=1 to 2;
IF C2600=0 THEN DO;
IF C2800=3 AND (C7800=1 OR C7900=1) THEN ESR=6;
END;
END;
/*END; may not belong*/
IF ESR=-1 THEN DO;
/** If not in the labor force and "other" category: **/
IF C30700=3 OR C30800>-4 THEN ESR=7;
/** If in the army during last week; **/
IF C2400=1 THEN ESR=8;
END;
/** Taking care of non-interviews; **/
IF C2400=-5 THEN ESR=-5;
/** We now create the Collapsed ESR code; **/
IF ESR=1 OR ESR=2 THEN COLLESR=1;
IF ESR=3 OR ESR=4 THEN COLLESR=2;
IF ESR=5 OR ESR=6 OR ESR=7 THEN COLLESR=3;
IF ESR=8 THEN COLLESR=4;
IF ESR=-5 THEN COLLESR=-5;
IF ESR=-4 THEN COLLESR=-4;
IF ESR=-1 THEN COLLESR=-1;
IF ESR=-3 THEN COLLESR=-3;
IF ESR=-2 THEN COLLESR=-2;
endsas;