Variables Created:
CV_ENROLLSTAT
CV_HGC_EVER
CV_HGC_YR
CV_HIGHEST_DEGREE_EVER
CV_HIGHEST_DEGREE_YR
Variables Used
|
Name in Program |
Question Name on CD |
Name in Program |
Question Name on CD |
| Round 1 | Round 5 cont. | ||
| sym1gr11 | SYMBOL!CUR!FIRSTGRADE.01.01 |
e913111 |
YSCH-9131.01.01 |
| compyr4 | from r4 program |
e913112 |
YSCH-9131.01.02 |
| e3500r1 | YSCH-3500 |
e913121 |
YSCH-9131.02.01 |
| e11700r1 | YSCH-11700 |
e913122 |
YSCH-9131.02.02 |
| e26700r1 | YSCH-26700 |
e913131 |
YSCH-9131.03.01 |
| 28200r1 | YSCH-28200 |
e913132 |
YSCH-9131.03.02 |
| t70001r1 | YTRN-7000.01 |
e913141 |
YSCH-9131.04.01 |
| t70002r1 | YTRN-7000.02 |
e913151 |
YSCH-9131.05.01 |
| t70003r1 | YTRN-7000.03 |
e933511M |
YSCH-9335.01.01~M |
| encat1 | CV_ENROLLSTAT |
e933511Y |
YSCH-9335.01.01~Y |
| GRSURV1 | CV_HGC_EVER |
e933512M |
YSCH-9335.01.02~M |
| DEGSURV1 | CV_HIGHEST_DEGREE_EVER |
e933512Y |
YSCH-9335.01.02~Y |
|
e933521M |
YSCH-9335.02.01~M |
||
| Round 2 |
e933521Y |
YSCH-9335.02.01~Y |
|
| e2857r2 | YSCH-2857 |
e933531M |
YSCH-9335.03.01~M |
| e3112r2 | YSCH-3112 |
e933531Y |
YSCH-9335.03.01~Y |
| e11700r2 | YSCH-11700 |
e933541M |
YSCH-9335.04.01~M |
| t70001r2 | YTRN-7000.01 |
e933541M |
YSCH-9335.04.01~Y |
| t70002r2 | YTRN-7000.02 |
e933551M |
YSCH-9335.05.01~M |
| encat2 | CV_ENROLLSTAT |
e933551Y |
YSCH-9335.05.01~Y |
| GRSURV2 | CV_HGC_EVER |
e938511 |
YSCH-9385.01.01 |
| GRJUNE2 | CV_HGC_YR |
e938512 |
YSCH-9385.01.02 |
| DEGSURV2 | CV_HIGHEST_DEGREE_EVER |
e938521 |
YSCH-9385.02.01 |
| DEGJUNE2 | CV_HIGHEST_DEGREE_YR |
e938522 |
YSCH-9385.02.02 |
|
e938531 |
YSCH-9385.03.01 |
||
| Round 3 |
e938532 |
YSCH-9385.03.02 |
|
| e2857r3 | YSCH-2857 |
e938541 |
YSCH-9385.04.01 |
| e3112r3 | YSCH-3112 |
e938551 |
YSCH-9385.05.01 |
| e11700r3 | YSCH-11700 |
e9589111 |
YSCH-9589.01.01.01 |
| t70001r3 | YTRN-7000.01 |
e9589112 |
YSCH-9589.01.01.02 |
| t70002r3 | YTRN-7000.02 |
e9589113 |
YSCH-9589.01.01.03 |
| t70003r3 | YTRN-7000.03 |
e9589114 |
YSCH-9589.01.01.04 |
| t70004r3 | YTRN-7000.04 |
e9589121 |
YSCH-9589.01.02.01 |
| e13300r3 | YSCH-13300 |
e9589122 |
YSCH-9589.01.02.02 |
| encat3 | CV_ENROLLSTAT |
e9589211 |
YSCH-9589.02.01.01 |
| grsurv3 | CV_HGC_EVER |
e9589212 |
YSCH-9589.02.01.02 |
| grjune3 | CV_HGC_YR |
e9589213 |
YSCH-9589.02.01.03 |
| degsurv3 | CV_HIGHEST_DEGREE_EVER |
e9589311 |
YSCH-9589.03.01.01 |
| degjune3 | CV_HIGHEST_DEGREE_YR |
e9589411 |
YSCH-9589.04.01.01 |
|
e9589412 |
YSCH-9589.04.01.02 |
||
| Round 4 |
e9946111 |
YSCH-9946.01.01.01 |
|
| e2857r4 | YSCH-2857 |
e9946112 |
YSCH-9946.01.01.02 |
| e3112r4 | YSCH-3112 |
e9946113 |
YSCH-9946.01.01.03 |
| e11700r4 | YSCH-11700 |
e9946114 |
YSCH-9946.01.01.04 |
| t70001r4 | YTRN-7000.01 |
e9946121 |
YSCH-9946.01.02.01 |
| t70002r4 | YTRN-7000.02 |
e9946122 |
YSCH-9946.01.02.02 |
| t70003r4 | YTRN-7000.03 |
e9946211 |
YSCH-9946.02.01.01 |
| t70004r4 | YTRN-7000.04 |
e9946212 |
YSCH-9946.02.01.02 |
| encat4 | CV_ENROLLSTAT |
e9946213 |
YSCH-9946.02.01.03 |
| grsurv4 | CV_HGC_EVER |
e9946311 |
YSCH-9946.03.01.01 |
| grjune4 | CV_HGC_YR |
e9946411 |
YSCH-9946.04.01.01 |
| degsurv4 | CV_HIGHEST_DEGREE_EVER |
e9946412 |
YSCH-9946.04.01.02 |
| degjune4 | CV_HIGHEST_DEGREE_YR |
e199111M |
YSCH-10099.01.01.01~M |
|
e199111Y |
YSCH-10099.01.01.01~Y |
||
| Round 5 |
e199112M |
YSCH-10099.01.01.02~M |
|
|
e3103 |
YSCH-3103 |
e199112Y |
YSCH-10099.01.01.02~Y |
|
e3104 |
YSCH-3104 |
e199113M |
YSCH-10099.01.01.03~M |
|
e2806 |
YSCH-2806 |
e199113Y |
YSCH-10099.01.01.03~Y |
|
e2857 |
YSCH-2857 |
e199114M |
YSCH-10099.01.01.04~M |
|
e2908 |
YSCH-2908 |
e199114Y |
YSCH-10099.01.01.04~Y |
|
e3010 |
YSCH-3010 |
e199121M |
YSCH-10099.01.02.01~M |
|
e3061 |
YSCH-3061 |
e199121Y |
YSCH-10099.01.02.01~Y |
|
e3112 |
YSCH-3112 |
e199122M |
YSCH-10099.01.02.02~M |
|
e3877 |
YSCH-3877 |
e199122Y |
YSCH-10099.01.02.02~Y |
|
e3877B |
YSCH-3877B |
e199211M |
YSCH-10099.02.01.01~M |
|
e3878 |
YSCH-3878 |
e199211Y |
YSCH-10099.02.01.01~Y |
|
e4793 |
YSCH-4793 |
e199212M |
YSCH-10099.02.01.02~M |
|
e4795 |
YSCH-4795 |
e199212Y |
YSCH-10099.02.01.02~Y |
|
e1605 |
YSCH-1605 |
e199213M |
YSCH-10099.02.01.03~M |
|
e16151 |
YSCH-1615.01 |
e199213Y |
YSCH-10099.02.01.03~Y |
|
e16241 |
YSCH-1624.01 |
e199311M |
YSCH-10099.03.01.01~M |
|
e16271 |
YSCH-1627.01 |
e199311Y |
YSCH-10099.03.01.01~Y |
|
e4951 |
YSCH-4951 |
e199411M |
YSCH-10099.04.01.01~M |
|
e54581 |
YSCH-5458.01 |
e199411Y |
YSCH-10099.04.01.01~Y |
|
e54582 |
YSCH-5458.02 |
e199412M |
YSCH-10099.04.01.02~M |
|
e54583 |
YSCH-5458.03 |
e199412Y |
YSCH-10099.04.01.02~Y |
|
e54584 |
YSCH-5458.04 |
e11700 |
YSCH-11700 |
|
e54585 |
YSCH-5458.05 |
e11900M |
YSCH-11900~M |
|
e67841 |
YSCH-6784.01 |
e11900Y |
YSCH-11900~Y |
|
e67842 |
YSCH-6784.02 |
e273371 |
YSCH-27337.01 |
|
e67843 |
YSCH-6784.03 |
e273372 |
YSCH-27337.02 |
|
e67844 |
YSCH-6784.04 |
e273373 |
YSCH-27337.03 |
|
e67845 |
YSCH-6784.05 |
e273374 |
YSCH-27337.04 |
|
e69381 |
YSCH-6938.01 |
e273375 |
YSCH-27337.05 |
|
e69382 |
YSCH-6938.02 |
e273376 |
YSCH-27337.06 |
|
e69383 |
YSCH-6938.03 |
e234501 |
YSCH-23450.01 |
|
e69384 |
YSCH-6938.04 |
e234502 |
YSCH-23450.02 |
|
e69385 |
YSCH-6938.05 |
e234503 |
YSCH-23450.03 |
|
e694311 |
YSCH-6943.01.01 |
e234504 |
YSCH-23450.04 |
|
e694321 |
YSCH-6943.02.01 |
e234505 |
YSCH-23450.05 |
|
e714211 |
YSCH-7142.01.01 |
e234506 |
YSCH-23450.06 |
|
e714221 |
YSCH-7142.01.02 |
t70001 |
YTRN-7000.01 |
|
e714231 |
YSCH-7142.01.03 |
t70002 |
YTRN-7000.02 |
|
e71921 |
YSCH-7192.01 |
t70003 |
YTRN-7000.03 |
|
e71922 |
YSCH-7192.02 |
t70004 |
YTRN-7000.04 |
|
e71923 |
YSCH-7192.03 |
PUBID |
PUBID |
|
e71924 |
YSCH-7192.04 |
DTHS |
CV_HS_DIPLOMA |
|
e71925 |
YSCH-7192.05 |
DTGED |
CV_GED |
|
e841611 |
YSCH-8416.01.01 |
DTAA |
CV_AA_DEGREE |
|
e841612 |
YSCH-8416.01.02 |
DTBA |
CV_BA_DEGREE |
|
e841621 |
YSCH-8416.02.01 |
ROSCODE1 |
NEWSCHOOL_SCHCODE.01 |
|
e841622 |
YSCH-8416.02.02 |
ROSCODE2 |
NEWSCHOOL_SCHCODE.02 |
|
e841631 |
YSCH-8416.03.01 |
ROSCODE3 |
NEWSCHOOL_SCHCODE.03 |
|
e841632 |
YSCH-8416.03.02 |
ROSCODE4 |
NEWSCHOOL_SCHCODE.04 |
|
e841641 |
YSCH-8416.04.01 |
ROSCODE5 |
NEWSCHOOL_SCHCODE.05 |
|
e841651 |
YSCH-8416.05.01 |
ROSCODE6 |
NEWSCHOOL_SCHCODE.06 |
Codes for Created Variables
|
Enrollment Status (CV_ENROLLSTAT) |
|
|
1.
not enrolled, no high school degree, no GED |
7.
not enrolled, graduate degree |
|
Highest Grade Completed (CV_HGC_EVER, CV_HGC_YR) |
|||
|
0.
none |
6.
sixth |
12.
twelvth |
17.
fifth year college |
|
Highest Degree Received (CV_HIGHEST_DEGREE_EVER, CV_HIGHEST_DEGREE_YR) |
|
|
0.
none |
4.
bachelor's degree (B.A., B.S., or unspecified) |
This program first creates an enrollment status variable for each respondent. It then identifies the highest grade completed by the respondent as of the round 5 interview date and as of June 30, 2001. Finally, it determines the highest degree or diploma received by the respondent as of the same two dates.
Notes on education variables: Respondents who report receiving both a GED and a high school diploma are coded as receiving a high school diploma. Respondents who report completing 12th grade but do not report receiving a diploma or GED are coded as having completed 12th grade (in the GRSURV and GRJUNE variables, if applicable) but are not credited with a diploma/GED in the ENCAT, DEGSURV, or DEGJUNE variables. Researchers interested in diploma receipt should use the DEGSURV or ENCAT variables and should not assume that completion of 12th grade signifies receipt of a high school diploma.
Some respondents provided conflicting information about grades attended/completed in the schooling loops (e8416 and e9589) versus the single items (e3112, e2857). In Round 5, approximately 100 respondents have conflicting grade reports, identified using the code:
where (enroll=0 and 12>=e3112^=grsurv>0 and degsurv not in (1,2) and grsurv^=95)
or (0<maxgrade=grsurv<95 and grsurv^=e3112 and e3112<=12)
This program gives priority to information provided in the schooling loops over that provided on single item questions. Users may wish to check the CV_HGC_EVER variable against student single item self-reports of HGC (e3112), which in many cases indicates a higher grade was completed than that reported in the loops.
Thirty-six respondents gave irreconcilable conflicting reports regarding their school attendance in the loops versus the single-item sections of the questionnaire. These respondents are assigned invalid skips (-3) because no reasonable determination of their enrollment status and grades completed can be made. Specifically, respondents are assigned a -3 if they a) report being not enrolled, b) report a highest grade completed on the single items (e3112) that is greater than the CV_HIGHEST_DEGREE_EVER for the prior round, but do not indicate completing this grade in a schooling loop, and c) report that their highest grade attended (e2857) is two or more greater than the highest grade completed in the previous round. If these respondents provide valid information on degrees earned, that variable will have a valid value.
/*************** ENROLLMENT STATUS **************/*
/** Initialize variables **/
FILL1=-4; /*FILL1,2,3,4 and 5 are a filler variable to make the array match in N */
FILL2=-4;
FILL3=-4;
FILL4=-4;
FILL5=-4;
enroll=-3; /* Indicator of whether respondent currently enrolled */
ENCAT=-3; /* Enrollment status variable (including educational attainment) */
dip=0; /* Indicator of whether respondent has a hs diploma (check previous rounds) */
ged=0; /* Indicator of whether respondent has a ged (check previous rounds) */
hs=0; /* Indicator of whether respondent is currently attending grades 1 to 12 */
college=0; /* Indicator of whether respondent is current attending 2 or 4 year college */
flagcol=0; /* Indicator to flag respondents currently attending grades 1 to 12 and enrolled in college */
FLAGLOOP=0; /* Indicator to flag respondents going through old school re-enrollment loop twice */
SOMECOLL=0; /* Indicator to flag respondents having attended a college (in a degree program) in current or
previous rounds */
FLAGGRADE=0; /* Indicator to flag respondents reporting HGC greater than HGA */
QUEX_PROB_Loop=0; /* Indicator to flag when respondents reporting attending a 2 or 4 year college are not asked
degree that they are working towards. */
PROB_SEAM=0; /* Indicator to flag respondents who received a degree in the same month as the interview and so
the ENCAT is not correct. **/
PROB_previnfo=0; /* Indicator to flag respondents who received a degree in the last round and that information was
not incorporated when computing ENCAT and so the ENCAT is not correct. **/
/*
GED_TR=1 If we have assigned a ged to R in the cveduR5_3.sas i.e. DATE OG DEGREE RECEIVED program
GED_TR=2 if we have assigned a ged to R in this program and training questions are not -1, -2, -3.
GED_TR=3 if we have assigned a ged to R in this program and training questions are either -1, -2, -3.*/
/** Defining arrays to be used later in the program **/
array e6784 e67841 e67842 e67843 e67844 e67845;
array e7192 e71921 e71922 e71923 e71924 e71925;
array e6938 e69381 e69382 e69383 e69384 e69385;
array e69431 e694311 e694321 FILL1 FILL2 FILL3;
array e7142 e714211 e714221 e714231 FILL4 FILL5;
array e23450 e234501 e234502 e234503 e234504 e234505 e234506;
array e27337 e273371 e273372 e273373 e273374 e273375 e273376;
array roscode roscode1 roscode2 roscode3 roscode4 roscode5 roscode6;
array t7000a t70001 t70002 t70003 t70004
t70001r1 t70002r1 t70003r1
t70001r2 t70002r2
t70001r3 t70002r3 t70003r3 t70004r3
t70001r4 t70002r4 t70003r4 t70004r4;
array intm int97_m int98_m int99_m int00_m;
array inty int97_y int98_y int99_y int00_y;
array encatt encat1-encat4;
array enrollt enroll1-enroll4;
do J=1 to 4;
if intm(J) NE -5 then dlicm=((inty(J)-1980)*12)+intm(J)+1;
end;
if int01_m NE -5 then do;
doicm=((int01_y-1980)*12)+int01_m;
end;
do I=1 to 6;
if (roscode(I)=4 OR roscode(I)=5) and e27337(I)=-4 then QUEX_PROB_LOOP=1;
end;
do I=1 to 4;
if encatt(I) in (8,9,10,11) then enrollt(I)=1;
if encatt(I) in (1,2,3,4,5,6,7) then enrollt(I)=0;
if encatt(I) lt 0 then enrollt(I)=encatt(I);
end;
LASTenroll=0;
do I=1 to 4;
if enrollt(I)=1 then LASTenroll=I;
end;
/** ENROLLMENT STATUS: Begin by determining whether the respondent is enrolled
Note that summer vacations are included as part of the enrollment period **/
if e2857 lt e3112 then FLAGGRADE=1;
if e4951=-5 then do;
enroll=-5;
ENCAT=-5;
end;
if e4795=1 OR e4793=1 then enroll=1; /* Continuously enrolled in old school since dli (or start date) */
if e4795=0 and e4951=0 then enroll=0; /* Not continuously enrolled and not enrolled in any other schools since */
/* Not continuously enrolled in old school since dli, not re-enrolled in old school since dli, and no new schools since dli */
if e1605=-2 then enroll=-2;
if e4795=0 and e1605=0 and e4951=0 then enroll=0;
if e4793=0 and e1605=0 and e4951=0 then enroll=0;
if e3878=0 then enroll=0;
/* Not continuously enrolled in old school since dli, have RECEIVED DEGREE and/OR COMPLETED COURSE WORK old school (i.e., YSCH-1600=1), and has not reported new school since */
if e4793=0 and e4951=0 and e1605=-4 then enroll=0;
/** RE-ENROLLMENT in OLD SCHOOL:
Note that respondents can only re-enroll loop once and it is not possible to determine which individuals
re-enrolled additional times. Individuals who were not continuously enrolled up to the interview during the last
enrollment spell and who do not report any new schools will be coded as not enrolled. **/
if e16241=1 then FLAGLOOP=1; /* Flag those who re-enroll */
/* Respondents ENROLLED AT DLI */
if (e4795=0 and e1605=1) then do;
if e16151=1 then enroll=1; /* Continuously enrolled in old school */
if e16151=0 and e16241=0 and e16271=0 and e4951=0 then enroll=0; /* Not continuously enrolled in old school,
first time through loop, no other
re-enrollments at old school and no new
schools reported */
end;
/* Respondents NOT ENROLLED AT DLI but re-enrolled in old school SDLI */
if e4793=0 and e1605=1 then do;
if e16151=1 then enroll=1;
if e16151=0 and e16241=0 and e16271=0 and e4951=0 then enroll=0;
end;
/** ENROLLMENT in NEW SCHOOLS **/
if (e4951=1 OR e3878=1) then do;
do I=1 to 5;
if e6784(I)=1 and e7192(I)=0 then enroll=1;/* Continuously enrolled in new school no other new schools
reported */
if e6784(I)=0 and e7192(I)=0 then enroll=0;/* Not continuously enrolled in new school, did not re-enroll in
new school, no other new schools reported */
end;
end;
/** Make sure that all members of the e6784 array are in the dataset - R's who leave a new school because they
graduated or finished coursework will not be asked this question **/
/** RE-ENROLLMENT PERIODS in NEW SCHOOLS **/
if (e4951=1 OR e3878=1) then do;
do I=1 to 5; /* Allow for up to three times through this loop */
if (e6784(I)=0 and e6938(I)=1) then do;
if e69431(I)=1 and e7192(I)=0 then enroll=1;/* Continuously re-enrolled in new school, no other new
schools reported */
if e69431(I)=0 and e7142(I)=0 and e7192(I)=0 then enroll=0;/* Not continuously re-enrolled in new school,
not re-enrolled in new school for a
subsequent spell, no other new schools
reported */
end;
end;
end;
/** ENROLLMENT STATUS CATEGORIES **/
/** First create variables to flag those who have ever received a ged or hs diploma
dip is set to 1 if R received hs diploma in rounds 1 through 5 **/
if e11700=1 OR e11700r1=1 OR e26700r1=1 OR e11700r2=1 OR e11700r3=1 OR e11700r4=1 then dip=1;
else if e11700 in (-1, -2, -3) OR e11700r1 in (-1, -2, -3) OR e26700r1 in (-1, -2, -3)
OR e11700r2 in (-1, -2, -3) OR e11700r3 in (-1, -2, -3) OR e11700r4 in (-1, -2, -3) then dip=-3;
if DIP_x=1 then dip=1; /* From the date of degree received program. (Added on February 10, 2003) */
/** ged is set to 1 if R received ged in rounds 1 through 5
NOTE: e13300 is not available for R2--use CV (encat2) from R2 **/
if e28200r1=1 OR encat2=2 OR e13300r3=1 OR e13300r4=1 OR e13300=1
OR e234501=9 OR e234502=9 OR e234503=9 OR e234504=9 OR e234505=9 OR e234506=9 then ged=1;
if e28200r1 in (-1, -2, -3) OR encat2 in (-1, -2, -3) OR e13300r3 in (-1, -2, -3)
OR e13300r4 in (-1, -2, -3) OR e13300 in (-1, -2, -3)
OR e234501 in (-1, -2, -3) OR e234502 in (-1, -2, -3) OR e234503 in (-1, -2, -3)
OR e234504 in (-1, -2, -3) OR e234505 in (-1, -2, -3) OR e234506 in (-1, -2, -3) then ged=-3;
do I=1 to 17;
if t7000a(I)=4 then do;
ged=1;
GED_TR=2;
end;
if ged=0 and t7000a(I) in (-1, -2, -3) then do;
ged=-3;
GED_TR=3;
end;
end;
if GED_x=1 then ged=1; /* From the date of degree received program. (Added on February 10, 2003) */
/** HANDEDITS (1): added on March 31, 2003 **/
if pubid=72 then do; ged=0; end;
/** NOT ENROLLED **/
if (enroll=0) then do; /* BEGIN1 */
/* Flag to indicate that R attended college (in a degree program) in a previous round */
if encat4 in (4,5,6,7,9,10,11) and degsurv4 in (1,2) then SOMECOLL=1;
if encat3 in (4,5,6,7,9,10,11) and degsurv3 in (1,2) then SOMECOLL=1;
if encat2 in (4,5,6,7,9,10,11) and degsurv2 in (1,2) then SOMECOLL=1;
if encat1 in (4,5,6,7,9,10,11) and degsurv1 in (1,2) then SOMECOLL=1;
if ged le 0 and dip le 0 then ENCAT=1;/* No high school degree, no ged */
if ged=1 then ENCAT=2;/* ged */
if dip=1 then ENCAT=3;/* High school degree */
/* Highest grade attended is at least 1 year of college
R reports a college on the roster and indicates being enrolled in a college degree program
(e27337<7 and e27337^=2) and R has hs diploma/ged.
PLEASE NOTE: Those who indicated attending a college and working toward a "vocational or technical
certificate" (e27337=2) are coded as not having attended college (because these credits typically won't
transfer for a BA or AA degree. **/
do I=1 to 6;
if roscode(I) in (4,5) and e27337(I) in (-2,-3) then do;
ENCAT=-3;
reason=1;
end;
if dip=1 and roscode(I) in (4,5) and (e27337(I)>6 OR e27337(I)=2) and SOMECOLL=0 then do;
ENCAT=3;
end;
if ged=1 and dip=0 and roscode(I) in (4,5) and (e27337(I)>6 OR e27337(I)=2) and 13<=e2857<=20 and
SOMECOLL=0 then do;
ENCAT=2;
end;
if ged=0 and dip=0 and roscode(I) in (4,5) and (e27337(I)<=6 and e27337(I) NE 2) and 13<=e2857<=20 then do;
ENCAT=-3;
reason=2;
end;
end;
/** Added on March 04, 2003:
Changed the code from "(e27337(I)>6 OR e27337(I)=2)" to "(e27337(I)<=6 and e27337(I) NE 2)" **/
/** If R attended any college (and was enrolled in a degree program), but is not currenly enrolled ENCAT=4
since they attended some college. **/
prevrnd=0;
/* R attended some college in current round */
do I=1 to 6;
if roscode(I) in (4,5) and (1<=e27337(I)<=6 and e27337(I)^=2) and (13<=e2857<=20 OR e3112>=12) then
ENCAT=4;
end;
/* If R attended college in a prior round */
if SOMECOLL=1 then ENCAT=4;
/* Received junior college or 2 year associate degree (need to check each school) */
if (e234501=1 OR e234502=1 OR e234503=1 OR e234504=1 OR e234505=1 OR e234506=1) then ENCAT=5;
/* Received bachelor's degree (need to check each school) */
if (e234501=3 OR e234502=3 OR e234503=3 OR e234504=3 OR e234505=3 OR e234506=3) then ENCAT=6;
/* Received master's, doctoral or professional degree (need to check each school) */
do I=1 to 6;
if e23450(I) in (4,5,6) then ENCAT=7;
end;
end; /* END1; The corresponding do is at BEGIN1 */
flagvoc=0; /* flag for Rs enrolled in "vocational/technical certificate program" */
do I=1 to 6;
if e27337(I)=2 then flagvoc=1;
end;
nodegree=0; /* flag for Rs enrolled in non-degree college programs */
/** ENROLLED **/
if (enroll=1) then do; /* BEGIN2 */
/* Missing values */
do I=1 to 6;
if roscode(I)=-2 then do;
ENCAT=-3;
reason=3;
end;
end;
do I=1 to 6;
if e27337(I)=-2 then do;
ENCAT=-3;
college=-3;
flagcol=-3;
reason=4;
end;
end;
/* Highest grade attended as of today less than or equal to 12th grade and don't have a diploma/ged */
if 1<=e2857<=12 and dip le 0 and ged le 0 then ENCAT=8;
/** Use roster info on sch enrollment to identify type of school enrolled in
2year/4year college should refer to the TYPE OF INSTITUTION (from roster info) not the TYPE OF DEGREE
PROGRAM (since many attending 2-year schools report being in a 4-year degree program because that is
their ultimate degree goal, thus the type of institution better reflects their current enrollment
status) **/
/** Those who completed high school (or a ged), but report being enrolled in a grade>12 and do not indentify
a college on the school rosters are coded as -3 on ENCAT. **/
do I=1 to 6;
if enroll=1 and (dip=1 OR ged=1) and e2857 ge 13 and e2857 lt 95 and roscode(I) in (1,2,3,6) then do;
ENCAT=-3;
reason=5;
end;
end;
/** Those who completed high school (or a ged), but report being enrolled in a grade<=12 are coded as -3 on
ENCAT. **/
do I=1 to 6;
if enroll=1 and (dip=1 OR ged=1) and e2857<=12 then do;
ENCAT=-3;
reason=6;
end;
end;
/** If enrolled in 2-year school, working toward a degree, and current grade is greater than high school then
ENCAT=2 year college
If R enrolled in a 2/4 year school (roscode in 4,5) and e27337=9 and R doesn't have a diploma then R is
working toward a ged. **/
do I=1 to 6;
if dip=1 and roscode(I)=4 and e27337(I)=2 then do;
ENCAT=3;
nodegree=1;
end;
if ged=1 and roscode(I)=4 and e27337(I)=2 then do;
ENCAT=2;
nodegree=1;
end;
if ged=0 and dip=0 and roscode(I) in (4,5) and e27337(I)=9 then ENCAT=8;
if ((roscode(I)=4 and e27337(I) in (1,3,4,5,6)) and e2857 ge 13 and e2857 lt 95) then ENCAT=9;
end;
/** If enrolled in 4-year school, working toward a degree and current grade is greater than high school then
ENCAT=4 year college. **/
do I=1 to 4;
if dip=1 and roscode(I)=5 and e27337(I)=2 then do;
ENCAT=3;
nodegree=1;
end;
if ged=1 and roscode(I)=5 and e27337(I)=2 then do;
ENCAT=2;
nodegree=1;
end;
if ((roscode(I)=5 and e27337(I) in (1,3,4,5,6)) and e2857 ge 13 and e2857 lt 95) then ENCAT=10;
end;
/** Rs who have obtained a BA, are still enrolled in a post-secondary institution, and report working toward
a graduate or professional degree should be coded as enrolled in a graduate program (this code is based
on degree program, not type of institution--again, there is a reporting problem here, with some whose
ultimate degree goal is a post-baccalaureate degree indicating that they are currently working toward the
higher degree, even though they have not yet completed a BA/BS. **/
/** Enrolled in a university, working towards a graduate degree and current grade is greater than or equal to
4th year college. **/
do I=1 to 4;
if roscode(I)=5 and (4<=e27337(I)<=6) and e2857 ge 16 and e2857 lt 95 then ENCAT=11;
end;
end; /* END2; The corresponding do is at BEGIN2 */
/** The following is for respondents who are enrolled, have no evidence of a high school diploma, yet
reported that highest grade attended was 1st year of college since there is no evidence these people have
a diploma and have not attended a new school, they will be placed under enrolled in grades 1-12. **/
flagged=0;
if enroll=1 and e2857=13 and dip=0 and ged=0 then ENCAT=8;
do I=1 to 6;
if enroll=1 and roscode(I) in (4,5) and e2857>=13 and dip=0 and ged=0 and e27337(I) in (7,8) then do;
ENCAT=8;
flagged=1;
nodegree=1;
end;
end;
/** The following is for respondents who have a high school diploma, a valid date for the diploma, have not
enrolled in a new school since dli, and report the highest grade completed being 12.
They have been categorized as not enrolled with a high school diploma (ENCAT=3) despite the fact that
these respondents claim to be continuously enrolled since dli.
Since there is no evidence of college from the respondent, they have been grouped as not enrolled. **/
if e11700=1 and e11900M>0 and e11900Y>0 and e4951=0 and e3112=12 then ENCAT=3;
/** The following is for respondents who report the highest grade attended as ungraded (YSCH-2857=95), show
no evidence of a high school diploma, were skipped out of the homeschool question, and are enrolled.
Again, since there is no evidence of a high school diploma, they are regarded as enrolled between grades
1 and 12. **/
if e2857=95 and dip=0 and ged=0 and enroll=1 then ENCAT=8;
/** The following is for Rs who received a hs diploma, provide a valid date for diploma receipt, yet also
report current enrollment in a high school. Because these Rs have obtained a diploma, they are
characterized as 3, not enrolled, a high school degree, no ged. **/
/* If r reports being enrolled and already has a diploma */
flagende=0;
do I=1 to 6;
if enroll=1 and e11700=1 and e11900M>0 and e11900Y>0 and e3112=12 and roscode(I)=3 then do;
ENCAT=3;
flagende=1;
end;
end;
/** Flag individuals who are enrolled in grades 1 to 12 and are enrolled in 2 or 4 year colleges (could be
getting credits towards ged). For created enrollment status variable above, the flagged individuals will
fall into category 8. **/
if enroll=1 then do;
if 1<=e2857<=12 and dip=0 and ged=0 then hs=1;
do I=1 to 6;
if e27337(I)=1 OR e27337(I)=3 then college=1;
end;
end;
if hs=1 and college=1 then do;
flagcol=1;
ENCAT=8;
end;
/** Those who completed high school, report being enrolled in college, but are in a non-degree program are
coded as not enrolled, a high school degree (3). If they previously attended a college in a degree
program they are coded as not enrolled, some college (4).
Those whose most recent enrollment is in a degree program are coded as enrolled in a 2year (ENCAT=9) or
4year (ENCAT=10) school. **/
/* Flag to indicate that R attended college (in a degree program) in a previous round (who did not correct
HGA as of last int. (e2806) to indicate that HGA <13 */
if encat4 in (4,5,6,7,9,10,11) and ((e2806 in (-4,-5)) OR (e2806>=13)) then SOMECOLL=1;
if encat3 in (4,5,6,7,9,10,11) and ((e2806 in (-4,-5)) OR (e2806>=13)) then SOMECOLL=1;
if encat2 in (4,5,6,7,9,10,11) and ((e2806 in (-4,-5)) OR (e2806>=13)) then SOMECOLL=1;
if encat1 in (4,5,6,7,9,10,11) and degsurv1 in (1,2) then SOMECOLL=1;
do I=1 to 6;
if enroll=1 and roscode(I) in (4,5) and e27337(I) in (1,3,4,5,6) then SOMECOLL=1;
if enroll=1 and dip=1 and roscode(I) in (4,5) and e27337(I) in (2,7,8) and SOMECOLL=0 then do;
ENCAT=3;
nodegree=1;
end;
if enroll=1 and ged=1 and roscode(I) in (4,5) and e27337(I) in (2,7,8) and SOMECOLL=0 then do;
ENCAT=2;
nodegree=1;
end;
if enroll=1 and roscode(I) in (4,5) and e27337(I) in (2,7,8) and SOMECOLL=1 then ENCAT=4;
if enroll=1 and roscode(I) in (4,5) and e27337(I) in (2,7,8) and SOMECOLL=1 then ENCAT=4;
if enroll=1 and roscode(I)=4 and e27337(I) in (1,3,4,5,6) then ENCAT=9;
if enroll=1 and roscode(I)=5 and e27337(I) in (1,3,4,5,6) then ENCAT=10;
end;
check=0;
if e4795=1 and ENCAT in (1,2,3,4,5,6,7) and flagende=0 and nodegree=0 then check=1;
/** Rs who report continuous enrollment in a DLI school, who subsequently report an additional school
(typically the first school is a 4 year college and R is working toward a BA and the second school is a
2/4 year college R attends in the summer in a non-degree program. This code overwrites code above that
erroneously replaces the continuous enrollment information with the more recently reported non-degree
school.
A report of continuous enrollment in high school is overwritten with college enrollment if R reports
earning a diploma or ged--Continuous enrollment in a high school is overwritten with ENCAT in (2,3)
depending on degree reported.
Must fix "enroll" flag because this flag is used in the grades skipped/repeated program
NOTE: if roscode1=2 and roscode2, roscode3, roscode4, roscode5 in (4,5) then the case must be hand edited
to ensure accuracy--CHECK FOR ROUND 5. **/
/** FUTURE CODE SHOULD BE ADDED to ENSURE THAT HIGHER DEGREE PROGRAMS (MA and above)
ARE BEING TREATED PROPERLY in THIS SECTION **/
if e4795=1 and roscode1=4 and e273371 in (1,3,4,5,6) then do;
ENCAT=9;
enroll=1;
end;
if e4795=1 and roscode1=5 and e273371 in (1,3,4,5,6) then do;
ENCAT=10;
enroll=1;
end;
if e4795=1 and roscode1 in (2,3) and dip=0 and ged=0 then do;
ENCAT=8;
enroll=1;
end;
if e4795=1 and roscode1=2 and roscode2=3 and dip=0 and ged=0 then do;
ENCAT=8;
enroll=1;
end;
do I=2 to 6;
if e4795=1 and roscode1=3 and roscode(I)=4 and e27337(I) in (1,3,4,5,6) then do;
ENCAT=9;
enroll=1;
end;
if e4795=1 and roscode1=3 and roscode(I)=5 and e27337(I) in (1,3,4,5,6) then do;
ENCAT=10;
enroll=1;
end;
if e4795=1 and roscode1=3 and roscode(I) in (-4,1,2,3) then do;
if dip=1 then ENCAT=3;
if ged=1 then ENCAT=2;
end;
end;
flagndeg=0;
do I=1 to 6;
if e27337(I) in (2,7,8) then flagndeg=1;
end;
/** HANDEDIT (2): The program does not incorporate the degree received aspect for those Rs who received the degree in
the same month as the interview and so the ENCAT is not correct. **/
if pubid=94 OR pubid=3695 OR pubid=4083 OR pubid=4769 then do;
ENCAT=5;
enroll=0;
PROB_SEAM=1;
end;
/** HANDEDIT (3): The program does not incorporate the degree received information from last round when computing
ENCAT and so the ENCAT is not correct. **/
if pubid=2370 OR pubid=3979 OR pubid=266 OR pubid=997 OR pubid=6369 OR pubid=5189 then do;
ENCAT=5;
PROB_previnfo=1;
end;
/** HANDEDIT (4): Some Rs reported being in some post high school program but corrobarating evidence showed they were
either still in high school or pursuing a program to obtain a GED. So the ENCAT is not correct.**/
if pubid=438 OR pubid=440 OR pubid=1883 OR pubid=4553 OR pubid=4593 OR pubid=5452
OR pubid=5983 OR pubid=8309 OR pubid=2380 OR pubid=2573 OR pubid=4372 OR pubid=5015 then do;
ENCAT=8;
end;
/** HANDEDIT (5): Miscellaneous cases. **/
if pubid=6000 then do;
ENCAT=5;
end;
if pubid=1404 OR pubid=6407 then do;
ENCAT=-3;
end;
/***** CREATED VARIABLE - HIGHEST GRADE COMPLETED AS OF THE SURVEY DATE (GRSURV) ****/
/** Create four arrays:
the first array includes items that ask if R has completed for which at least one R answered positively,
the second and third arrays list all of the questions giving the month and year of completion, and
the fourth array lists the questions indicating the grades that the R may or may not have completed
ROSCODE and e27337 arrays are also employed to ensure consistency between ENCAT and grsurv variables
--if R reports attending a grade that is > 12 but doesn't report being enrolled in a degree program at a college
or university, they are coded as having completed 12th grade **/
array logic e913111 e913112 e913121 e913131 e913141 e913151
e9946111 e9946112 e9946113 e9946114 e9946121 e9946122
e9946211 e9946212 e9946213 e9946311 e9946411 e9946412;
array cyear e933511Y e933512Y e933521Y e933531Y e933541Y e933551Y
e199111Y e199112Y e199113Y e199114Y e199121Y e199122Y
e199211Y e199212Y e199213Y e199311Y e199411Y e199412Y;
array cmonth e933511M e933512M e933521M e933531M e933541M e933551M
e199111M e199112M e199113M e199114M e199121M e199122M
e199211M e199212M e199213M e199311M e199411M e199412M;
array grade e841611 e841612 e841621 e841631 e841641 e841651
e9589111 e9589112 e9589113 e9589114 e9589121 e9589122
e9589211 e9589212 e9589213 e9589311 e9589411 e9589412;
array e23450 e234501 e234502 e234503 e234504 e234505 e234506;
array e27337 e273371 e273372 e273373 e273374 e273375 e273376;
array roscode roscode1 roscode2 roscode3 roscode4 roscode5 roscode6;
/** HANDEDIT (6): Incorporating some corrected information from the comments. **/
if pubid=2757 then do; e199111m=6; FLAG_comm=1; end;
if pubid=8737 then do; e199211m=6; e199211y=2000; FLAG_comm=1; end;
if pubid=6628 then do; e9946111=0; e199111m=-4; e199111y=-4; FLAG_comm=1; end;
if pubid=8201 then do; e933511m=5; FLAG_comm=1; end;
maxgrade=-16;
compmon=-16;
compyr=-16;
everloop=0;
badgrade=0;
assign='unassigned';
do I=1 to 18;
if grade(I) ge 0 and grade(I) gt maxgrade then do; /* Select cases where there is a valid grade and it is greater
than the previously recorded grade */
if logic(I)=1 then do;
assign='from loop';
maxgrade=grade(I);
compmon=cmonth(I);
compyr=cyear(I);
if cyear(I) lt 2001 OR (cyear(I) eq 2001 and cmonth(I) le 6) then do;
grjune=grade(I);
cjumon=cmonth(I);
cjuyr=cyear(I);
end;
end;
else if logic(I) in (-1,-2,-3) then do;
maxgrade=logic(I);
assign='logic missing ';
end;
end;
if grade(I) in (0,-1, -2, -3,-4) and logic(I) gt -4 then do;
maxgrade=-55;
assign='grade invalid ';
end;
if logic(I) gt -4 then everloop=1; /* Flag all observations that go through a grade loop at least once */
end;
hgaloop=e841611; /* Create variable indicating highest grade attended from loops */
do I=2 to 18;
if grade(I) gt hgaloop then do;
hgaloop=grade(I);
end;
end;
/* Create variable indicating grsurv for previous interview */
grsprev=grsurv4;
if grsurv4 lt 0 then do;
grsprev=grsurv3;
if grsurv3 lt 0 then do;
grsprev=grsurv2;
if grsurv2 lt 0 then do;
grsprev=grsurv1;
end;
end;
end;
if e3061 ge 0 then grsprev=e3061;
grsurv=maxgrade; /* Make grsurv equal to maximum grade */
LOCATOR=1;
if e3112=-5 then do; /* If non-interview then grsurv=-5 */
grsurv=-5;
assign = 'non-interview';
ged=-5;
dip=-5;
LOCATOR=-5;
end;
/** If invalid or incorrect grade data was read into loop or if R never goes through the loops (usually because
they now attend 2 or 4 year colleges, sometimes because of infosheet error) and they attended school at some
time either at dli or since dli, then replace grsurv with single item */
/** HOWEVER: this single item must be checked against the roster data: If R completed high school, never reports
attending a college in the loop/roster information, but indicates enrollment in a grade > 12 in the
single item measure, the grsurv variable is set to 12 since no college degree program has been
reported. **/
subsitem=0;
if ((e841611 le 0 and e913111 NE -4) OR grsurv=-55 OR everloop=0) and e3878 NE 0 and e3112 NE -5 then do;
subsitem=1;
do I=1 to 6;
if e3112>12 and roscode(I) in (4,5) and e27337(I) in (2,7,8,9) then grsurv=12;
if e3112>12 and ENCAT in (4,5,6,7,9,10,11) then grsurv=e3112;
if e3112>12 and (dip=0 and ged=0) and roscode(I) NE 4 and roscode(I) NE 5 then grsurv=-16;
if e3112>=12 and roscode(I) in (4,5) and e27337(I) in (1,3,4,5,6) then grsurv=e3112;
if e3112<12 and (dip=0 and ged=0) then grsurv=e3112;
if e3112>=12 and dip=0 and ged=0 and roscode(I) in (1,2,3,6) then grsurv=-16; /** Changed on Feb 05 -added 2**/
if e841611 le 0 and e913111 NE -4 then assign= 'Enrolled, bad grade: subs. item';
else if everloop=0 then assign='Enrolled, not thru loops: subs. item';
else if maxgrade=-55 then assign='Enrolled, bad grade: subs. item';
end;
LOCATOR=2;
end;
/** If R was enrolled but didn't confirm completing a grade, we substitute a value equal to one less than highest
grade attended from loop using a conservative approach:
If the hga from loop is equal to the single item hga (e2857) substitute hgaloop-1.
Otherwise if the hga from loop minus 1 is equal to the single item hgc (e3112) substitute hgaloop-1.
Otherwise if the the single item hgc (e3112) is equal to the previous hgc then substitute e3112.
If none of the other statements are true and hgaloop-1 is greater than e3112 substitute e3112. **/
subshgam=0;
tempflag=0;
if grsurv eq -16 and enroll=1 then do;
if hgaloop=e2857 then do;
subshgam=1;
grsurv=hgaloop-1;
assign= 'Enrolled-no loop hgc-hgaloop eq 2857: subs hgaloop-1';
LOCATOR=3;
end;
else if (hgaloop ge 0) and (e3112 ge 0) and ((hgaloop-1) eq e3112) then do;
subshgam=1;
grsurv=hgaloop-1;
assign= 'Enrolled-no loop hgc-hgaloop-1 eq e3112: subs hgaloop-1';
LOCATOR=4;
end;
else if grsprev eq e3112 then do;
subsitem=1;
grsurv=e3112;
assign= 'Enrolled-no loop hgc-e3112 eq grsprev: subs item';
LOCATOR=5;
end;
else if (hgaloop ge 0) and (e3112 ge 0) and ((hgaloop-1) gt e3112) then do;
subsitem=1;
grsurv=e3112;
assign= 'Enrolled-no loop hgc-hgaloop-1 gt item: subs item';
LOCATOR=6;
end;
else if (hgaloop ge 0) and (e3112 ge 0) and (hgaloop le e3112) and (grsprev lt e3112) then do;
subsprev=1;
grsurv=grsprev;
assign= 'Enrolled-no loop hgc-said no to grade: subs prev';
LOCATOR=7;
end;
end;
/** If someone confirmed completing a grade in the loop and didn't know the year of completion, then use the loop
data or the single item (YSCH-3112) whichever is lower. **/
dateloop=0;
dateitem=0;
if maxgrade=grsurv and compyr=-2 and maxgrade gt e3112 then do;
dateitem=1;
grsurv=e3112;
assign= 'subs. item: no date item lower';
subsitem=1;
LOCATOR=8;
end;
else if maxgrade=grsurv and compyr=-2 and maxgrade le e3112 then do;
dateloop=1;
grsurv=maxgrade;
assign= 'subs. loop: no date loop data lower';
subsitem=1;
LOCATOR=9;
end;
else if compyr NE -2 then do;
dateloop=.;
dateitem=.;
end;
/** If someone reported receiving a ged or h.s. diploma, then set their hgc to 12. **/
set12=0;
if (dip=1 OR ged=1) and grsurv lt 12 and e3112 NE -5 then do;
set12=1;
grsurv=12;
assign= 'set to 12: dip or ged';
LOCATOR=10;
end;
/** College attendance is not reported in the loops and college year completion should therefore make use of the
single item HGC, but only if enrollment in a college degree program (AA, BA, MA, etc) is reported (e27337) in
the current or a previous round. Use ENCAT to determine whether R was ever in college
BUT if e3112<12 and R reports completing a High School diploma or ged then grsurv is set equal to 12. **/
if (ENCAT in (4,5,6,7,9,10,11) and 95>=e3112<12) OR (ENCAT in (4,5,6,7,9,10,11) and e3112<0) then do;
grsurv=-3;
assign='college, unclear';
LOCATOR=11;
end;
if ENCAT in (4,5,6,7,9,10,11) and 95>=e3112>=12 then do;
grsurv=e3112;
assign='college';
LOCATOR=12;
end;
if ENCAT in (4,5,6,7,9,10,11) and 95=>e3112<12 and (dip=1 OR ged=1) then do;
grsurv=12;
set12=1;
assign='college, set to 12';
LOCATOR=13;
end;
if ENCAT in (4,5,6,7,9,10,11) and 95>e3112<12 and grsurv4>12 and encat4 in (4,5,6,7,9,10,11) then do;
if e3061<0 then grsurv=grsurv4;
if e3061>0 then grsurv=e3061;
assign='college, previous round';
LOCATOR=14;
end;
/** If R reports completing a grade in a previous round that is > grsurv for the current round and the single item
provides a more consistent grade, the single item is used. If the single item is also inconsistent, the grsurv
value from the previous round is used. **/
disagree=0;
oldgrade=grsprev;
if 0<oldgrade<95 and oldgrade>grsurv>0 then disagree=1;
if disagree=1 then do;
if (95>e3112>12 OR 95>oldgrade>12) and ENCAT in (4,5,6,7,9,10,11) then do; /* don't use single item of >12 if
no college reported */
if oldgrade=(e3112-1) then grsurv=e3112;
if oldgrade=(e3112-2) then grsurv=e3112;
if oldgrade=e3112 then grsurv=e3112;
if oldgrade>e3112 then grsurv=oldgrade;
assign='disagree: college reported, single item or prior round';
LOCATOR=15;
end;
if e3112<=12 then do;
if oldgrade=(e3112-1) then grsurv=e3112;
if oldgrade=(e3112-2) then grsurv=e3112;
if oldgrade=95 then grsurv=e3112;
if oldgrade=e3112 then grsurv=e3112;
if oldgrade>e3112 then grsurv=oldgrade;
assign='disagree: replace with single item or prior round';
LOCATOR=16;
end;
if (95>e3112>12 OR 95>oldgrade>12) and ENCAT in (1,2,3,8,-3) then do;
grsurv=-3;
assign='disagree: no college reported';
LOCATOR=17;
end;
end;
/** Not enrolled: Assign previous highest grade completed and create a variable flagging observations
that substituted the value of the previous year - If previous HGC is missing, then assign the single item.**/
subsprev=0;
if grsurv in (-16,-3) and enroll=0 and grsprev ge 0 then do;
if compyr4 gt 0 and grsurv4 ge 0 then do;
if e3061<0 then grsurv=grsurv4;
if e3061>0 then grsurv=e3061;
subsprev=1;
assign= 'Not enrolled-r4 value from loop: subs. r4';
LOCATOR=18;
end;
if compyr4 le 0 then do;
if grsprev le e3112 and (0 le e3112 lt 95) and grsprev NE 95 then do;
grsurv=e3112;
subsitem=1;
assign= 'Not enrolled-r4 value not from loop: subs. item';
LOCATOR=19;
end;
if e3112 lt grsprev and (0 le e3112 lt 95) and grsprev NE 95 then do;
grsurv=grsprev;
subsprev=1;
assign= 'Not enrolled-r4 value not from loop: subs. earlier rounds';
LOCATOR=20;
end;
if (e3112 le 0 OR e3112=95) and grsprev NE 95 then do;
grsurv=grsprev;
subsprev=1;
assign= 'Not enrolled-r4 value not from loop: subs. earlier rounds';
LOCATOR=21;
end;
end;
end;
if grsurv in (-16,-3) and enroll=0 and grsprev ge 0 and compyr4 le 0 then do;
grsurv=e3112;
LOCATOR=22;
subsitem=1;
assign= 'Not enrolled-r4 value not from loop: subs. item';
end;
else if grsurv in (-16,-3) and e3878=0 and grsprev lt 0 then do;
grsurv=e3112;
subsitem=1;
assign= 'subs. item: not enrolled,bad data prev';
LOCATOR=23;
end;
/** Flag Rs whose response highest grade completed question doesn't agree with their highest grade completed
obtained from the grade completion loops **/
diffhgc=0;
if maxgrade NE e3112 and e3112 ge 0 and maxgrade ge 0 then diffhgc=1;
if maxgrade lt 0 OR e3112 lt 0 then diffhgc=.;
if grsurv=0 then grsurv=-3;
if grsurv in (-55,-2,-3,-16) then grsurv=-3;
/** HANDEDIT (7): **/
if pubcid=406 then do; grsurv=12; end;
if pubid=8015 then do; grsurv=10; end;
/****** CREATED VARIABLE - HIGHEST GRADE COMPLETED AS OF JUNE 30, 2001 (GRJUNE) *****/
/** calculate date in continuous month of receipt of ged or hs diploma
Those who completed a grade that is > 12 do not provide completion dates for each college year (only for
degrees). Thus, all Rs who attended college are coded as -4 on this variable since we do not have complete
grade completion data. **/
prev=0;
if grjune = . then do;
if e3112 = -5 then grjune=-5;
else if set12 = 1 then grjune=-3;
else if (subsitem=1 OR subshgam=1) and (grsurv le 12 OR grsurv=95) then grjune=-3;
else if (subsitem=1 OR subshgam=1) and grsurv gt 12 and grsurv lt 95 then grjune=-4;
else if e3878=0 OR subsprev=1 then grjune=grsurv;
else if assign= 'HAND edit because HGC is greater than HGA' and grsurv=grsurv4 then grjune=grsurv;
else if assign= 'HAND edit because HGC is greater than HGA' and grsurv NE grsurv4 then grjune=-3;
else if assign='Enrolled-grade not confirmed in loop-r2 loop good:subs r2' then grjune=grsurv;
if set12=1 and ged=1 then do;
if dtged gt 0 and dtged le 258 then grjune=grsurv;
else if dtged gt 258 and maxgrade gt 0 then grjune=grsurv;
else if dtged gt 258 and maxgrade le 0 and subsprev=1 then grjune=grsprev;
else if dtged gt 258 and maxgrade le 0 and subsitem=1 then grjune=e3112;
end;
if set12=1 and dip=1 then do;
if dths gt 0 and dths le 258 then grjune=grsurv;
else if dths gt 258 and maxgrade gt 0 then grjune=grsurv;
else if dths gt 258 and maxgrade le 0 then grjune=grsprev;
else if dths gt 258 and maxgrade le 0 and subsitem=1 then grjune=e3112;
end;
if 0<dths le 258 and grsurv=12 then grjune=12;
if 0<dtged le 258 and grsurv=12 then grjune=12;
if 0<dths le 258 and grsurv>12 then grjune=-4;
if 0<dtged le 258 and grsurv>12 then grjune=-4;
if enroll=0 and e3010=0 and maxgrade<0 and grsurv=e3061 then grjune=e3061;
if grsurv=grsprev then do; grjune=grsurv; if enroll=1 then funny=1; end;
if 0<grsurv=grsurv4=e3061 and grjune<grsurv then grjune=grsurv;
if compyr gt 0 and maxgrade=grsurv then do;
if compyr in (1997,1998,1999,2000) OR (compyr=2001 and compmon ge 1 and compmon le 6) then grjune=grsurv;
else if (compyr eq 2001 and compmon gt 6) OR compyr gt 2001 then do;
grjune=grsprev;
prev=1;
end;
end;
end;
else if compyr=-2 then grjune=-3;
if grjune=. OR grjune=0 then grjune=-3;
/** If R attended college, they are valid skips on this variable since we do not have dates for completion of
college terms. However, if grsurv=12 then they could reasonably have a value in this variable since in all
cases June is PRIOR to the survey date, thus those who attended college whose grsurv=12 get a -3 on this
variable. **/
if ENCAT in (4,5,6,7,9,10,11,12) and grsurv>12 then grjune=-4;
/** Cases where R reported a higher grade in e3112 (HGC) than was reported in R4 and who indicate their e2857
(HGA) is at least two greater than the grsurv4 value, but who indicated that they were not enrolled should
be coded as a -3 on both grsurv and grjune since the R is providing conflicting information. **/
if enroll=0 and (grsurv=grsprev) and 12=>e3112>grsurv and e2857>0 and e2857-2>=grsurv then do;
grsurv=-3;
grjune=-3;
ENCAT=-3;
assign='Conflicting information';
reason=7;
LOCATOR=24;
end;
if grsurv=-3 then grjune=-3;
/****** CREATED VARIABLE - HIGHEST DEGREE RECEIVED AS OF THE SURVEY DATE (DEGSURV)****/
degsurv=0;
/* ged */
if ged=1 then degsurv=1;
else if ged=-3 then degsurv=-3;
/* High school diploma */
if dip=1 then degsurv=2;
else if dip=-3 then degsurv=-3;
/* Junior college or two-year associate degree */
do I=1 to 6;
if e23450(I)=1 then degsurv=3;
else if e23450(I) in (-1, -2, -3) then degsurv=-3;
end;
/* Bachelor's degree */
do I=1 to 6;
if e23450(I)=3 then degsurv=4;
else if e23450(I) in (-1, -2, -3) then degsurv=-3;
end;
/* Master's degree */
do I=1 to 6;
if e23450(I)=4 then degsurv=5;
else if e23450(I) in (-1, -2, -3) then degsurv=-3;
end;
/* Doctoral degree */
do I=1 to 6;
if e23450(I)=5 then degsurv=6;
else if e23450(I) in (-1, -2, -3) then degsurv=-3;
end;
/* Professional degree */
do I=1 to 6;
if e23450(I)=6 then degsurv=7;
else if e23450(I) in (-1, -2, -3) then degsurv=-3;
end;
/**Note: degsurv did not account for the degsurv of earlier rounds resulting in degsurv for Round 5 being less than that in degsurv for Round 4 or earlier (see hgcchkR5_deg.sas), so the following code was added. **/
prevdegsurv=degsurv4;
if degsurv4=-5 then do;
prevdegsurv=degsurv3;
if degsurv3=-5 then do;
prevdegsurv=degsurv2;
if degsurv2=-5 then do;
prevdegsurv=degsurv1;
end;
end;
end;
if degsurv ge 0 and prevdegsurv ge 0 and degsurv lt prevdegsurv then degsurv=prevdegsurv;
/** HANDEDIT (8): To take care of earlier round errors in computing degsurv as highest degree received in survey year
instead of AS OF survey year. **/
if pubid=654 then do; degsurv=3; end;
if pubid=6565 then do; degsurv=3; end;
/******* CREATED VARIABLE - HIGHEST DEGREE COMPLETED AS OF JUNE 30, 2001 (DEGJUNE) ******/
degjune=0;
/* ged */
if dtged gt 0 and dtged le 258 then degjune=1;
else if dtged in (-3, -2, -1) then degjune=-3;
/* High school diploma */
if dths gt 0 and dths le 258 then degjune=2;
else if dths in (-3, -2, -1) then degjune=-3;
/* Junior college or 2-year associate degree */
if dtaa gt 0 and dtaa le 258 then degjune=3;
else if dtaa in (-3, -2, -1) then degjune=-3;
/* Bachelor's degree */
if dtba gt 0 and dtba le 258 then degjune=4;
else if dtba in (-3, -2, -1) then degjune=-3;
/* Master's degree */
if dtma gt 0 and dtma le 258 then degjune=5;
else if dtma in (-3, -2, -1) then degjune=-3;
/* Doctoral degree */
if dtdoc gt 0 and dtdoc le 258 then degjune=6;
else if dtdoc in (-3, -2, -1) then degjune=-3;
/* Professional degree */
if dtprof gt 0 and dtprof le 258 then degjune=7;
else if dtprof in (-3, -2, -1) then degjune=-3;
if e3112 eq -5 then do;
degsurv=-5;
degjune=-5;
end;
if 0=<degsurv=degsurv4 and degjune^=degsurv4 then degjune=degsurv4;
/** HANDEDIT (9): Incorporating information from comments. **/
if pubid=6000 then do; degsurv=3; degjune=3; end;
lower=0;
higher=0;
if diffhgc=1 and ENCAT in (1,2,3,8) then do;
if maxgrade>e3112 then higher=1;
if maxgrade<e3112 then lower=1;
end;
if grjune=. then grjune=-3;
if ged=1 and dtged<=0 then dateflag=1;
if dip=1 and dths<=0 then dateflag=1;
if degsurv=3 and dtaa<=0 then dateflag=1;
if degsurv=4 and dtba<=0 then dateflag=1;
if degsurv=5 and dtma<=0 then dateflag=1;
if degsurv=6 and dtdoc<=0 then dateflag=1;
if degsurv=7 and dtprof<=0 then dateflag=1;
if dateflag=1 and degjune>=0 then degjune=-3;
if grsurv=-1 then grsurv=-3;
endsas;
Variables Created: CV_SCHOOL_TYPE
Variables Used
|
Name in Program |
Question Name on CD |
| TYPER1 | CV_SCHOOL_TYPE_1997 |
| TYPER2 | CV_SCHOOL_TYPE_1998 |
| TYPER3 | CV_SCHOOL_TYPE_1999 |
| TYPER4 | CV_SCHOOL_TYPE_2000 |
| SPERIOD1 | NEWSCHOOL_PERIODS_01_2001 |
| SPERIOD2 | NEWSCHOOL_PERIODS_02_2001 |
| SPERIOD3 | NEWSCHOOL_PERIODS_03_2001 |
| SPERIOD4 | NEWSCHOOL_PERIODS_04_2001 |
| SPERIOD5 | NEWSCHOOL_PERIODS_05_2001 |
| SPERIOD6 | NEWSCHOOL_PERIODS_06_2001 |
| SSTOP1M1 | NEWSCHOOL_STOP1_01_M_2001 |
| SSTOP1Y1 | NEWSCHOOL_STOP1_01_Y_2001 |
| SSTOP1M2 | NEWSCHOOL_STOP1_02_M_2001 |
| SSTOP1Y2 | NEWSCHOOL_STOP1_02_Y_2001 |
| SSTOP1M3 | NEWSCHOOL_STOP1_03_M_2001 |
| SSTOP1Y3 | NEWSCHOOL_STOP1_03_Y_2001 |
| SSTOP1M4 | NEWSCHOOL_STOP1_04_M_2001 |
| SSTOP1Y4 | NEWSCHOOL_STOP1_04_Y_2001 |
| SSTOP1M5 | NEWSCHOOL_STOP1_05_M_2001 |
| SSTOP1Y5 | NEWSCHOOL_STOP1_05_Y_2001 |
| SSTOP1M6 | NEWSCHOOL_STOP1_06_M_2001 |
| SSTOP1Y6 | NEWSCHOOL_STOP1_06_Y_2001 |
| SSTOP2M1 | NEWSCHOOL_STOP2_01_M_2001 |
| SSTOP2Y1 | NEWSCHOOL_STOP2_01_Y_2001 |
| SSTOP2M2 | NEWSCHOOL_STOP2_02_M_2001 |
| SSTOP2Y2 | NEWSCHOOL_STOP2_02_Y_2001 |
| SSTOP2M3 | NEWSCHOOL_STOP2_03_M_2001 |
| SSTOP2Y3 | NEWSCHOOL_STOP2_03_Y_2001 |
| SSTOP3M1 | NEWSCHOOL_STOP3_01_M_2001 |
| SSTOP3Y1 | NEWSCHOOL_STOP3_01_Y_2001 |
| SCODE1 | NEWSCHOOL_SCHCODE_01_2001 |
| SCODE2 | NEWSCHOOL_SCHCODE_02_2001 |
| SCODE3 | NEWSCHOOL_SCHCODE_03_2001 |
| SCODE4 | NEWSCHOOL_SCHCODE_04_2001 |
| SCODE5 | NEWSCHOOL_SCHCODE_05_2001 |
| SCODE6 | NEWSCHOOL_SCHCODE_06_2001 |
| STYPE1 | NEWSCHOOL_TYPE_01_2001 |
| STYPE2 | NEWSCHOOL_TYPE_02_2001 |
| STYPE3 | NEWSCHOOL_TYPE_03_2001 |
| STYPE4 | NEWSCHOOL_TYPE_04_2001 |
| STYPE5 | NEWSCHOOL_TYPE_05_2001 |
| PUBID | PUBID |
Codes for Created Variable
1 = Public school
2 = Private, not parochial
3 = Parochial
4 = Other
This program creates a variable indicating whether the respondent's current or most recent school is public, private, parochial, or other. The program first determines which school is the most recent school (non-college) by examining the end dates for different enrollment periods and then picks up the school type from rounds 1-5 for the most recent school. Users should note that school type is defined only for respondents attending grades 1-12.
/* Create the array variables.*/
* # of enrollment periods;
array speriod speriod1-speriod6;
* ending date for each period;
array sstop1m sstop1m1-sstop1m6;
array sstop1y sstop1y1-sstop1y6;
array sstop2m sstop2m1-sstop2m6;
array sstop2y sstop2y1-sstop2y6;
array sstop3m sstop3m1-sstop3m6;
array sstop3y sstop3y1-sstop3y6;
* school code, i.e. elementary school, high school or college;
array scode scode1-scode6;
*school type for round 5;
array stype stype1-stype6;
* ending time for each school;
array srecm srecm1-srecm6;
array srecy srecy1-srecy6;
* school length counting both month&year: the month length from jan. 1990 to the ending month for each school;
array mlength mlength1-mlength6;
* school length counting only year: the year length from 1990 to the ending year for each school;
* this variable is to take care of the situation where ending year is invalid;
array ylength ylength1-ylength6;
/************************* step 1).In the process to decide the most recent school. ************************/
do i=1 to 6;
srecm[i]=-4;
srecy[i]=-4;
if speriod[i]=1 and scode[i] in (1,2,3) then do;
srecm[i]=sstop1m[i];
srecy[i]=sstop1y[i];
end;
if speriod[i]=2 and scode[i] in (1,2,3) then do;
srecm[i]=sstop2m[i];
srecy[i]=sstop2y[i];
end;
if speriod[i]=3 and scode[i] in (1,2,3) then do;
srecm[i]=sstop3m[i];
srecy[i]=sstop3y[i];
end;
if srecm[i] gt 0 and srecy[i] gt 0 then mlength[i]=12*(srecy[i]-1990)+srecm[i];
else mlength[i]=-4;
if srecy[i] gt 0 then ylength[i]=srecy[i]-1990;
else ylength[i]=-4;
end;
maxmleng=max(mlength1,mlength2, mlength3, mlength4, mlength5, mlength6);
if stype1=-5 then maxmleng=-5;
maxyleng=max(ylength1,ylength2, ylength3, ylength4, ylength5, ylength6);
if stype1=-5 then maxyleng=-5;
/************** step 2). Decide the latest non-college school and its type*************/
type1=-4;
***** create the flag variables;
* flag the cases where multiple schools' ending year/month are same as "maxmleng";
maxmeq=0;
do i=1 to 6;
if maxmleng>0 and mlength[i]=maxmleng then maxmeq=maxmeq+1;
end;
* flag the cases where multiple schools' ending year are the same as "maxyleng" and ending months are invalid answer;
invalidm=0; maxyeq=0;
do i=1 to 6;
if maxyleng>0 and ylength[i]=maxyleng and srecm[i] in (-1,-2,-3) then invalidm=invalidm+1;
if maxyleng>0 and ylength[i]=maxyleng then maxyeq=maxyeq+1;
end;
***** first step to create school type;
* use only the year information first;
do i=1 to 6;
if maxyleng>0 and ylength[i]=maxyleng then type1=stype[i];
end;
* then use the month information to make it more precise;
do i=1 to 6;
if maxmleng>0 and mlength[i]=maxmleng then type1=stype[i];
end;
***** Fix the special cases where multiple schools' ending years are same as maxyleng;
/* go back to fix the case such as 97.12 and 99.-2. because if "maxmleng" cover "maxyleng", the codes above
will pick up the school ending on 97.12 as most recent school.*/
if maxyeq=1 then do;
do i=1 to 6;
if ylength[i]=maxyleng then type1=stype[i];
end;
end;
if invalidm ge 2 then type1=-3;
* flag the cases which has 98.02 and 98.-3;
flag=0;
if maxyeq ge 2 and invalidm ge 1 then flag=1;
if flag=1 then type1=-3;
* fix the case such as 99.12, 99.-2 99.-3 or 2000.12 2000.-2;
if maxyeq ge 2 then do;
do i=1 to 6;
if ylength[i]=maxyleng and srecm[i]=12 then type1=stype[i];
end;
end;
***** Fix the special cases where multiple schools ending year/months are same as maxmleng;
/*This loop assigns value of PUBLIC schools (1) to TYPE1 in cases where one reported school type=public
and one reported school type="other". In cases where one reported school type=PRIVATE and one reported
type="other", value for PRIVATE school type is assigned. Cases where one school type=PUBLIC and another
school type=PRIVATE are flagged and looked into. */
*dummy for one school is public school and the other is religious school;
pubrelg=0;
*dummy for one school is public school and the other is private school;
pubpriv=0;
*dummy for one school is private and the other is religious school;
privrelg=0;
if maxmeq ge 2 then do;
do i=1 to 6;
if mlength(i)=maxmleng and stype(i)^=type1 then do;
if stype(i) in (6,9,10,11,-1,-2,-3) and type1 in (1,2,12,13) then type1=type1;
if stype(i) in (1,2,12,13) and type1 in (6,9,10,11,-1,-2,-3) then type1=stype[i];
if stype(i) in (6,9,10,11,-1,-2,-3) and type1 in (3,4) then type1=type1;
if stype(i) in (3,4) and type1 in (6,9,10,11,-1,-2,-3) then type1=stype[i];
if stype(i) in (6,9,10,11,-1,-2,-3) and type1=5 then type1=5;
if stype(i)=5 and type1 in (6,9,10,11,-1,-2,-3) then type1=5;
if (stype(i) in (1,2,12,13) and type1 in (3,4)) or
(stype(i) in (3,4) and type1 in (1,2,12,13)) then pubrelg=1;
if (stype(i) in (1,2,12,13) and type1=5) or
(stype(i)=5 and type1 in (1,2,12,13)) then pubpriv=1;
if (stype(i)=5 and type1 in (3,4)) or
(stype(i) in (3,4) and type1=5) then privrelg=1;
end;
end;
end;
***** Invalid answers;
if scode1 in (-1,-2,-3) or scode2 in (-1,-2,-3) or scode3 in (-1,-2,-3) or scode4 in (-1,-2,-3) or
scode5 in (-1,-2,-3) or scode6 in (-1,-2,-3) then type1=-3;
if (scode1 in (1,2,3) and srecy1 in (-1,-2,-3)) or (scode2 in (1,2,3) and srecy2 in (-1,-2,-3)) or
(scode3 in (1,2,3) and srecy3 in (-1,-2,-3)) or (scode4 in (1,2,3) and srecy4 in (-1,-2,-3)) or
(scode5 in (1,2,3) and srecy5 in (-1,-2,-3)) or (scode6 in (1,2,3) and srecy6 in (-1,-2,-3)) then type1=-3;
* if the respondent only goes to one school in r4,input that school type;
if scode1 in (1,2,3) and scode2 in (-4, 4, 5) and scode3 in (-4, 4, 5) and scode4 in (-4, 4, 5) and
scode5 in (-4, 4, 5) and scode6 in (-4,4,5) then type1=stype1;
/************* recode the type variable.************/
sltype=-4;
if type1 in (1,2,12,13) then sltype=1;
if type1=5 then sltype=2;
if type1 in (3,4) then sltype=3;
if type1 in (6,9,10,11) then sltype=4;
if -4<type1<0 then sltype=-3;
if stype1=-5 then sltype=-5;
***** Hand edit;
* Hand edit for 1 case who report two schools with the same ending date but different school type;
if pubid=1749 then sltype=1;
* Hand edit other cases who got "-3" because of stopping date but have same school type for all valid schools
or the most recent school is detectable from the other information such as intervieww date;
if pubid in (2919,6686,7979,8212,8296,2264,3928) then sltype=1;
if pubid in (8301,1477) then sltype=4;
endsas;
Variables Created:
CV_GED
CV_HS_DIPLOMA
CV_AA_DEGREE
CV_BA_DEGREE
Variables Used
|
Name in Program |
Question Name on CD |
| GEDR1 | CV_GED |
| HSR1 | CV_HS_DIPLOMA |
| GEDR2 | CV_GED |
| HSR2 | CV_HS_DIPLOMA |
| GEDR3 | CV_GED |
| HSR3 | CV_HS_DIPLOMA |
| AAR3 | CV_AA_DEGREE |
| BAR3 | CV_BA_DEGREE |
| GEDR4 | CV_GED |
| HSR4 | CV_HS_DIPLOMA |
| AAR4 | CV_AA_DEGREE |
| BAR4 | CV_BA_DEGREE |
| S24685 | YSCH-24685 |
| S13900 | YSCH-13900 |
| YINT_D | SYMBOL!CURDATE~D |
| YINT_M | SYMBOL!CURDATE~M |
| YINT_Y | SYMBOL!CURDATE~Y |
| S11700 | YSCH-11700 |
| S11900M | YSCH-11900~M |
| S11900Y | YSCH-11900~Y |
| S13300 | YSCH-13300 |
| S13500M | YSCH-13500~M |
| S13500Y | YSCH-13500~Y |
| S234501 | YSCH-23450.01 |
| S234502 | YSCH-23450.02 |
| S234503 | YSCH-23450.03 |
| S234504 | YSCH-23450.04 |
| S234505 | YSCH-23450.05 |
| S234506 | YSCH-23450.06 |
| S234601M | YSCH-23460.01~M |
| S234601Y | YSCH-23460.01~Y |
| S234602M | YSCH-23460.02~M |
| S234602Y | YSCH-23460.02~Y |
| S234603M | YSCH-23460.03~M |
| S234603Y | YSCH-23460.03~Y |
| T70001 | YTRN-7000.01 |
| T70002 | YTRN-7000.02 |
| T70003 | YTRN-7000.03 |
| T70004 | YTRN-7000.04 |
| PUBID | PUBID |
This program creates several continuous month variables, identifying the month that the respondent received a GED, high school diploma, associate's degree, and bachelor's degree. In future rounds, similar variables will calculate the month a master's, doctoral, or professional degree was received; no respondents had received these degrees in rounds 1-5. For more information on the continuous month scheme, see appendix 7 in this document.
/** HANDEDIT (1) : Based on information from the comments we are handediting these dates. **/
if pubid=137 then do;
GEDR4=234;
FLAG_comm=1;
end;
if pubid=7949 then do;
GEDR4=250;
FLAG_comm=1;
end;
if pubid=5092 then do;
HSR4=210;
FLAG_comm=1;
end;
/** Stating all the array to be used in this program. **/
array VARS1 [3] MAR1 DOCR1 PROFR1;
array VARS2 [3] MAR2 DOCR2 PROFR2;
array VARS3 [3] MAR3 DOCR3 PROFR3;
array VARS4 [3] MAR4 DOCR4 PROFR4;
array CR1 [7] HSR1 GEDR1 AAR1 BAR1 MAR1 DOCR1 PROFR1;
array CR2 [7] HSR2 GEDR2 AAR2 BAR2 MAR2 DOCR2 PROFR2;
array CR3 [7] HSR3 GEDR3 AAR3 BAR3 MAR3 DOCR3 PROFR3;
array CR4 [7] HSR4 GEDR4 AAR4 BAR4 MAR4 DOCR4 PROFR4;
array CR5 [7] HSR5 GEDR5 AAR5 BAR5 MAR5 DOCR5 PROFR5;
array CR [7] HS GEDR AAR BAR MAR DOCR PROFR;
array S23450 [6] S234501-S234506;
array S23460M [6] S234601M S234602M S234603M S234604M S234605M S234606M;
array S23460Y [6] S234601Y S234602Y S234603Y S234604Y S234605Y S234606Y;
array T7000 [4] T70001 T70002 T70003 T70004;
array DT [7] DTHS DTGED DTAA DTBA DTMA DTDOC DTPROF;
array FLAG [7] FLAGHS FLAGGED FLAGAA FLAGBA FLAGMA FLAGDOC FLAGPROF;
array HANDEDIT [7] HEHS HEGED HEAA HEBA HEMA HEDOC HEPROF;
/** Merging information from previous rounds. **/
/** Setting all variables that are missing as -4 or if not interviewed as -5. **/
if GEDR1 NE -5 then do;
AAR1=-4;
BAR1=-4;
end;
if GEDR1=-5 then do;
AAR1=-5;
BAR1=-5;
end;
if GEDR2 NE -5 then do;
AAR2=-4;
BAR2=-4;
end;
if GEDR2=-5 then do;
AAR2=-5;
BAR2=-5;
end;
do I=1 to 3;
if GEDR1 NE -5 then VARS1[I]=-4;
if GEDR1=-5 then VARS1[I]=-5;
if GEDR2 NE -5 then VARS2[I]=-4;
if GEDR2=-5 then VARS2[I]=-5;
if GEDR3 NE -5 then VARS3[I]=-4;
if GEDR3=-5 then VARS3[I]=-5;
if GEDR4 NE -5 then VARS4[I]=-4;
if GEDR4=-5 then VARS4[I]=-5;
end;
/** Taking the latest information available from previous rounds. **/
do I=1 to 7;
if CR4[I] NE -5 then CR[I]=CR4[I];
if CR4[I]=-5 then do;
if CR3[I] NE -5 then CR[I]=CR3[I];
if CR3[I]=-5 then do;
if CR2[I] NE -5 then CR[I]=CR2[I];
if CR2[I]=-5 then do;
CR[I]=CR1[I];
end;
end;
end;
end;
/** First create the date variables using round 5 information only. **/
do I=1 to 7;
CR5[I]=-4;
end;
FLAGG=0;
S234604M=0; S234605M=0; S234606M=0;
S234604Y=0; S234605Y=0; S234606Y=0;
if S11700=1 and S11900M gt 0 and S11900Y gt 0 then HSR5=(S11900Y-1980)*12+S11900M;
if -4<S11700<0 then HSR5=S11700;
if -4<S11900M<0 then HSR5=S11900M;
if -4<S11900Y<0 then HSR5=S11900Y;
if S11700=1 and (S11900M=-4 and S11900Y=-4) and HSR5=-4 then do;
HSR5=-3;
QUEX_PROB=1;
end;
if S13300=1 and S13500M>0 and S13500Y>0 then GEDR5=(S13500Y-1980)*12+S13500M;
if -4<S13300<0 then GEDR5=S13300;
if -4<S13500M<0 then GEDR5=S13500M;
if -4<S13500Y<0 then GEDR5=S13500Y;
if S13300=1 and (S13500M=-4 and S13500Y=-4) and GEDR5=-4 then do;
GEDR5=-3;
QUEX_PROB=1;
end;
do I=1 to 6;
if S23450[I]=1 and S23460M[I]>0 and S23460Y[I]>0 and AAR5=-4 then AAR5=(S23460Y[I]-1980)*12+S23460M[I];
if S23450[I]=1 and -4<S23460M[I]<0 and AAR5=-4 then AAR5=S23460M[I];
if S23450[I]=1 and -4<S23460Y[I]<0 and AAR5=-4 then AAR5=S23460Y[I];
if S23450[I]=1 and (S23460M[I]=-4 and S23460Y[I]=-4) and AAR5=-4 then do;
AAR5=-3;
QUEX_PROB=1;
end;
if S23450[I]=3 and S23460M[I]>0 and S23460Y[I]>0 and BAR5=-4 then BAR5=(S23460Y[I]-1980)*12+S23460M[I];
if S23450[I]=3 and -4<S23460M[I]<0 and BAR5=-4 then BAR5=S23460M[I];
if S23450[I]=3 and -4<S23460Y[I]<0 and BAR5=-4 then BAR5=S23460Y[I];
if S23450[I]=3 and (S23460M[I]=-4 and S23460Y[I]=-4) and BAR5=-4 then do;
BAR5=-3;
QUEX_PROB=1;
end;
if S23450[I]=4 and S23460M[I]>0 and S23460Y[I]>0 and MAR5=-4 then MAR5=(S23460Y[I]-1980)*12+S23460M[I];
if S23450[I]=4 and -4<S23460M[I]<0 and MAR5=-4 then MAR5=S23460M[I];
if S23450[I]=4 and -4<S23460Y[I]<0 and MAR5=-4 then MAR5=S23460Y[I];
if S23450[I]=4 and (S23460M[I]=-4 and S23460Y[I]=-4) and MAR5=-4 then do;
MAR5=-3;
QUEX_PROB=1;
end;
if S23450[I]=5 and S23460M[I]>0 and S23460Y[I]>0 and DOCR5=-4 then DOCR5=(S23460Y[I]-1980)*12+S23460M[I];
if S23450[I]=5 and -4<S23460M[I]<0 and DOCR5=-4 then DOCR5=S23460M[I];
if S23450[I]=5 and -4<S23460Y[I]<0 and DOCR5=-4 then DOCR5=S23460Y[I];
if S23450[I]=5 and (S23460M[I]=-4 and S23460Y[I]=-4) and DOCR5=-4 then do;
DOCR5=-3;
QUEX_PROB=1;
end;
if S23450[I]=6 and S23460M[I]>0 and S23460Y[I]>0 and PROFR5=-4 then PROFR5=(S23460Y[I]-1980)*12+S23460M[I];
if S23450[I]=6 and -4<S23460M[I]<0 and PROFR5=-4 then PROFR5=S23460M[I];
if S23450[I]=6 and -4<S23460Y[I]<0 and PROFR5=-4 then PROFR5=S23460Y[I];
if S23450[I]=6 and (S23460M[I]=-4 and S23460Y[I]=-4) and PROFR5=-4 then do;
PROFR5=-3;
QUEX_PROB=1;
end;
if S23450[I]=9 and S23460M[I]>0 and S23460Y[I]>0 and GEDR5=-4 then GEDR5=(S23460Y[I]-1980)*12+S23460M[I];
if S23450[I]=9 and -4<S23460M[I]<0 and GEDR5=-4 then GEDR5=S23460M[I];
if S23450[I]=9 and -4<S23460Y[I]<0 and GEDR5=-4 then GEDR5=S23460Y[I];
if S23450[I]=9 and (S23460M[I]=-4 and S23460Y[I]=-4) and GEDR5=-4 then do;
GEDR5=-3;
QUEX_PROB=1;
end;
if S23450[I]=8 OR -4<S23450[I]<0 then FLAGG=1;
end;
do I=1 to 6;
if -4<S23450[I]<0 and AAR5=-4 then AAR5=S23450[I];
if -4<S23450[I]<0 and BAR5=-4 then BAR5=S23450[I];
if -4<S23450[I]<0 and MAR5=-4 then MAR5=S23450[I];
if -4<S23450[I]<0 and DOCR5=-4 then DOCR5=S23450[I];
if -4<S23450[I]<0 and PROFR5=-4 then PROFR5=S23450[I];
if -4<S23450[I]<0 and GEDR5=-4 then GEDR5=S23450[I];
end;
/** If respondent completes GED in a training program, setting date to -3 because we don't know completion date. **/
GED_TR=0;
do I=1 to 4;
if GEDR5=-4 and T7000[I]=4 then do;
GEDR5=-3;
GED_TR=1;
end;
end;
/** Changing -1 and -2 to -3. **/
do I=1 to 7;
if CR[I]=-1 then CR[I]=-3;
if CR[I]=-2 then CR[I]=-3;
if CR5[I]=-1 then CR5[I]=-3;
if CR5[I]=-2 then CR5[I]=-3;
end;
/** Taking care of non-interviews. **/
do I=1 to 7;
if S11700=-5 then CR5[I]=-5;
end;
/** Checking if there is some conflict between round 5 and the latest information available from previous rounds. **/
do I=1 to 7;
FLAG[I]=0;
if CR5[I] NOT in (-4,-5) and CR[I] NE -4 and CR5[I] NE CR[I] then FLAG[I]=1;
end;
/** Merging the results from previous rounds. **/
do I=1 to 7;
DT[I]=-4;
/** When there is no conflict **/
if FLAG[I] NE 1 then do;
if CR[I] NE -4 then DT[I]=CR[I];
if CR5[I] NE -4 then DT[I]=CR5[I];
end;
/** When there is conflict **/
if FLAG[I]=1 then do;
if CR[I] gt 0 and CR5[I]=-3 then HANDEDIT[I]=1;
if CR5[I] gt 0 and CR[I]=-3 then HANDEDIT[I]=2;
if CR5[I] gt 0 and CR[I] gt 0 then HANDEDIT[I]=3;
end;
end;
/** HANDEDIT (2): When Rs are asked the GED dates twice (questionnaire error), we
(1) take the date from the earlier round if both dates are valid
(2) only the valid date if only one of them is a valid date. **/
if HEGED=1 then do;
DTGED=GEDR;
QUEX_PROB=2;
end;
if HEGED=2 then do;
DTGED=GEDR5;
QUEX_PROB=2;
end;
if HEGED=3 then do;
DTGED=GEDR;
QUEX_PROB=2;
end;
/** HANDEDIT (3): **/
/* In this case the two dates for HS diploma are just one month apart. Since the memory is more likely
to be better in the earlier round we take the earlier date. */
if pubid=4454 then do;
DTHS=233;
end;
/* This R reports two AA degree dates as R received majored in two different subjects. So we are taking the
earlier date. */
if pubid=6626 then do;
DTAA=253;
end;
/** HANDEDIT (4) : These Rs reported college even though they had no GED or HS diploma. So they were asked
how this happenned in YSCH-13900. If there answer was that they had a GED or HS Diploma
and give a date we use that date as their DTGED; if they said they received sometime earlier
but we could not figure out when, we give them DTGED=-3. **/
if pubid=190 OR pubid=216 OR pubid=2136 OR pubid=2138
OR pubid=2422 OR pubid=4148 OR pubid=4220 OR pubid=4444 OR pubid=5649 OR pubid=6338
OR pubid=7064 OR pubid=7652 OR pubid=8187 OR pubid=8316 OR pubid=8754 then do;
DTGED=-3;
FLAG_13900=1;
end;
if pubid=993 then do; DTGED=241; FLAG_13900=1; end;
if pubid=1309 then do; DTGED=249; FLAG_13900=1; end;
if pubid=4259 then do; DTGED=235; FLAG_13900=1; end;
if pubid=4655 then do; DTGED=239; FLAG_13900=1; end;
if pubid=8091 then do; DTGED=244; FLAG_13900=1; end;
/** HANDEDIT (5) : Incorporating additional information from comments. **/
if pubid=1514 OR pubid=4351 OR pubid=4371 OR pubid=5387 OR pubid=5650
OR pubid=6106 OR pubid=6119 OR pubid=6557 OR pubid=7462 then do; DTGED=-3; FLAG_comm=1; end;
if pubid=72 then do; DTHS=258; FLAG_comm=1; end;
if pubid=993 then do; DTHS=245; FLAG_comm=1; end;
if pubid=1053 then do; DTHS=260; FLAG_comm=1; end;
if pubid=1749 then do; DTHS=241; FLAG_comm=1; end;
if pubid=2785 then do; DTHS=257; FLAG_comm=1; end;
if pubid=5438 then do; DTHS=258; FLAG_comm=1; end;
if pubid=6000 then do; DTAA=258; FLAG_comm=1; end;
/* HANEDITS based on interviewer comments: */
if pubid=8751 then do; DTBA=-4; end;
if pubid=72 then do; DTHS=258; DTGED=-4; end;
if pubid=1514 then do; DTGED=253; end;
if pubid=1749 then do; DTHS=252; end;
if pubid=6683 then do; DTHS=258; end;
if pubid=8151 then do; DTBA=-4; end;
if DTGED NOT in (-4,-5) then GED_x=1;
if DTHS NOT in (-4,-5) then DIP_x=1;
Variables Created:
CV_GRADES_REPEAT_EVER
CV_GRADES_REPEAT_YR
CV_GRADE_SKIPPED_EVER
CV_GRADE_SKIPPED_YR
Variables Used
|
Name in Program |
Question Name on CD |
Name in Program |
Question Name on CD |
| s3500r1 | YSCH_3500_1997 | s9793111 | YSCH_9793_01_01_01_2001 |
| s3104 | YSCH_3104_2001 | s9793112 | YSCH_9793_01_01_02_2001 |
| s2857 | YSCH_2857_2001 | s9793211 | YSCH_9793_02_01_01_2001 |
| s4846m | YSCH_4846_M_2001 | s9793212 | YSCH_9793_02_01_02_2001 |
| s4846y | YSCH_4846_Y_2001 | s9946111 | YSCH_9946_01_01_01_2001 |
| s162001m | YSCH_1620_01_M_2001 | s9946112 | YSCH_9946_01_01_02_2001 |
| s162001y | YSCH_1620_01_Y_2001 | s9946113 | YSCH_9946_01_01_03_2001 |
| s162701 | YSCH_1627_01_2001 | s9946114 | YSCH_9946_01_01_04_2001 |
| s4951 | YSCH_4951_2001 | s9946121 | YSCH_9946_01_02_01_2001 |
| s841611 | YSCH_8416_01_01_2001 | s9946122 | YSCH_9946_01_02_02_2001 |
| s841612 | YSCH_8416_01_02_2001 | s9946211 | YSCH_9946_02_01_01_2001 |
| s841621 | YSCH_8416_02_01_2001 | s9946212 | YSCH_9946_02_01_02_2001 |
| s841622 | YSCH_8416_02_02_2001 | s9946213 | YSCH_9946_02_01_03_2001 |
| s841631 | YSCH_8416_03_01_2001 | s9946311 | YSCH_9946_03_01_01_2001 |
| s841632 | YSCH_8416_03_02_2001 | s9946411 | YSCH_9946_04_01_01_2001 |
| s841641 | YSCH_8416_04_01_2001 | s9946412 | YSCH_9946_04_01_02_2001 |
| s841651 | YSCH_8416_05_01_2001 | s099111m | YSCH_10099_01_01_01_M_2001 |
| s877411m | YSCH_8774_01_01_M_2001 | s099111y | YSCH_10099_01_01_01_Y_2001 |
| s877411y | YSCH_8774_01_01_Y_2001 | s099112m | YSCH_10099_01_01_02_M_2001 |
| s877412m | YSCH_8774_01_02_M_2001 | s099112y | YSCH_10099_01_01_02_Y_2001 |
| s877412y | YSCH_8774_01_02_Y_2001 | s099113m | YSCH_10099_01_01_03_M_2001 |
| s877421m | YSCH_8774_02_01_M_2001 | s099113y | YSCH_10099_01_01_03_Y_2001 |
| s877421y | YSCH_8774_02_01_Y_2001 | s099114m | YSCH_10099_01_01_04_M_2001 |
| s877422m | YSCH_8774_02_02_M_2001 | s099114y | YSCH_10099_01_01_04_Y_2001 |
| s877422y | YSCH_8774_02_02_Y_2001 | s099121m | YSCH_10099_01_02_01_M_2001 |
| s877431m | YSCH_8774_03_01_M_2001 | s099121y | YSCH_10099_01_02_01_Y_2001 |
| s877431y | YSCH_8774_03_01_Y_2001 | s099122m | YSCH_10099_01_02_02_M_2001 |
| s877432m | YSCH_8774_03_02_M_2001 | s099122y | YSCH_10099_01_02_02_Y_2001 |
| s877432y | YSCH_8774_03_02_Y_2001 | s099211m | YSCH_10099_02_01_01_M_2001 |
| s897711 | YSCH_8977_01_01_2001 | s099211y | YSCH_10099_02_01_01_Y_2001 |
| s897712 | YSCH_8977_01_02_2001 | s099212m | YSCH_10099_02_01_02_M_2001 |
| s897721 | YSCH_8977_02_01_2001 | s099212y | YSCH_10099_02_01_02_Y_2001 |
| s897731 | YSCH_8977_03_01_2001 | s099213m | YSCH_10099_02_01_03_M_2001 |
| s897741 | YSCH_8977_04_01_2001 | s099213y | YSCH_10099_02_01_03_Y_2001 |
| s913111 | YSCH_9131_01_01_2001 | s099311m | YSCH_10099_03_01_01_M_2001 |
| s913112 | YSCH_9131_01_02_2001 | s099311y | YSCH_10099_03_01_01_Y_2001 |
| s913121 | YSCH_9131_02_01_2001 | s099411m | YSCH_10099_04_01_01_M_2001 |
| s913122 | YSCH_9131_02_02_2001 | s099411y | YSCH_10099_04_01_01_Y_2001 |
| s913131 | YSCH_9131_03_01_2001 | s099412m | YSCH_10099_04_01_02_M_2001 |
| s913132 | YSCH_9131_03_02_2001 | s099412y | YSCH_10099_04_01_02_Y_2001 |
| s913141 | YSCH_9131_04_01_2001 | strt11m | NEWSCHOOL_START1_01_M_2001 |
| s913151 | YSCH_9131_05_01_2001 | strt11y | NEWSCHOOL_START1_01_Y_2001 |
| s933511m | YSCH_9335_01_01_M_2001 | strt12m | NEWSCHOOL_START1_02_M_2001 |
| s933511y | YSCH_9335_01_01_Y_2001 | strt12y | NEWSCHOOL_START1_02_Y_2001 |
| s933512m | YSCH_9335_01_02_M_2001 | strt13m | NEWSCHOOL_START1_03_M_2001 |
| s933512y | YSCH_9335_01_02_Y_2001 | strt13y | NEWSCHOOL_START1_03_Y_2001 |
| s933521m | YSCH_9335_02_01_M_2001 | strt14m | NEWSCHOOL_START1_04_M_2001 |
| s933521y | YSCH_9335_02_01_Y_2001 | strt14y | NEWSCHOOL_START1_04_Y_2001 |
| s933531m | YSCH_9335_03_01_M_2001 | strt15m | NEWSCHOOL_START1_05_M_2001 |
| s933531y | YSCH_9335_03_01_Y_2001 | strt15y | NEWSCHOOL_START1_05_Y_2001 |
| s933541m | YSCH_9335_04_01_M_2001 | strt16m | NEWSCHOOL_START1_06_M_2001 |
| s933541y | YSCH_9335_04_01_Y_2001 | strt16y | NEWSCHOOL_START1_06_Y_2001 |
| s933551m | YSCH_9335_05_01_M_2001 | stop11m | NEWSCHOOL_STOP1_01_M_2001 |
| s933551y | YSCH_9335_05_01_Y_2001 | stop11y | NEWSCHOOL_STOP1_01_Y_2001 |
| s9589111 | YSCH_9589_01_01_01_2001 | stop12m | NEWSCHOOL_STOP1_02_M_2001 |
| s9589112 | YSCH_9589_01_01_02_2001 | stop12y | NEWSCHOOL_STOP1_02_Y_2001 |
| s9589113 | YSCH_9589_01_01_03_2001 | stop13m | NEWSCHOOL_STOP1_03_M_2001 |
| s9589114 | YSCH_9589_01_01_04_2001 | stop13y | NEWSCHOOL_STOP1_03_Y_2001 |
| s9589121 | YSCH_9589_01_02_01_2001 | stop14m | NEWSCHOOL_STOP1_04_M_2001 |
| s9589122 | YSCH_9589_01_02_02_2001 | stop14y | NEWSCHOOL_STOP1_04_Y_2001 |
| s9589211 | YSCH_9589_02_01_01_2001 | stop15m | NEWSCHOOL_STOP1_05_M_2001 |
| s9589212 | YSCH_9589_02_01_02_2001 | stop15y | NEWSCHOOL_STOP1_05_Y_2001 |
| s9589213 | YSCH_9589_02_01_03_2001 | stop16m | NEWSCHOOL_STOP1_06_M_2001 |
| s9589311 | YSCH_9589_03_01_01_2001 | stop16y | NEWSCHOOL_STOP1_06_Y_2001 |
| s9589411 | YSCH_9589_04_01_01_2001 | stop21m | NEWSCHOOL_STOP2_01_M_2001 |
| s9589412 | YSCH_9589_04_01_02_2001 | stop21y | NEWSCHOOL_STOP2_01_Y_2001 |
| s691111m | YSCH_9691_01_01_01_M_2001 | stop22m | NEWSCHOOL_STOP2_02_M_2001 |
| s691111y | YSCH_9691_01_01_01_Y_2001 | stop22y | NEWSCHOOL_STOP2_02_Y_2001 |
| s691112m | YSCH_9691_01_01_02_M_2001 | stop23m | NEWSCHOOL_STOP2_03_M_2001 |
| s691112y | YSCH_9691_01_01_02_Y_2001 | stop23y | NEWSCHOOL_STOP2_03_Y_2001 |
| s691113m | YSCH_9691_01_01_03_M_2001 | stop31m | NEWSCHOOL_STOP3_01_M_2001 |
| s691113y | YSCH_9691_01_01_03_Y_2001 | stop31y | NEWSCHOOL_STOP3_01_Y_2001 |
| s691114m | YSCH_9691_01_01_04_M_2001 | scode1 | NEWSCHOOL_SCHCODE_01_2001 |
| s691114y | YSCH_9691_01_01_04_Y_2001 | scode2 | NEWSCHOOL_SCHCODE_02_2001 |
| s691121m | YSCH_9691_01_02_01_M_2001 | scode3 | NEWSCHOOL_SCHCODE_03_2001 |
| s691121y | YSCH_9691_01_02_01_Y_2001 | scode4 | NEWSCHOOL_SCHCODE_04_2001 |
| s691122m | YSCH_9691_01_02_02_M_2001 | scode5 | NEWSCHOOL_SCHCODE_05_2001 |
| s691122y | YSCH_9691_01_02_02_Y_2001 | scode6 | NEWSCHOOL_SCHCODE_06_2001 |
| s691211m | YSCH_9691_02_01_01_M_2001 | norcid | NORCID_2001 |
| s691211y | YSCH_9691_02_01_01_Y_2001 | r5intd | SYMBOL_CURDATE_D_2001 |
| s691212m | YSCH_9691_02_01_02_M_2001 | r5intm | SYMBOL_CURDATE_M_2001 |
| s691212y | YSCH_9691_02_01_02_Y_2001 | r5inty | SYMBOL_CURDATE_Y_2001 |
| s691213m | YSCH_9691_02_01_03_M_2001 | pregrdin | SYMBOL_PREV_GRADE_IN_2001 |
| s691213y | YSCH_9691_02_01_03_Y_2001 | prehga | SYMBOL_PREV_HGA_2001 |
| s691311m | YSCH_9691_03_01_01_M_2001 | r4bfrpev | created in round 4 program |
| s691311y | YSCH_9691_03_01_01_Y_2001 | r4bfskev | created in round 4 program |
| s691411m | YSCH_9691_04_01_01_M_2001 | r4bf2857 | created in round 4 program |
| s691411y | YSCH_9691_04_01_01_Y_2001 | r4bfint | created in round 4 program |
| s691412m | YSCH_9691_04_01_02_M_2001 | r4bfat1-r4bfat15 | created in round 4 program |
| s691412y | YSCH_9691_04_01_02_Y_2001 | r4bfst1-r4bfst15 | created in round 4 program |
| r4bfed1-r4bfed15 | created in round 4 program | ||
| r4bfcp1-r4bfcp15 | created in round 4 program | ||
| r4bflag | created in round 4 program | ||
| enroll | created within current program |
This program creates variables counting the number of grades the respondent ever repeated or skipped. The first variable in each pair counts the total number of grades ever repeated/skipped through the interview date; the second variable calculates the number through June 30, 2001.
***Create new array of start dates for first school depending on whether r. corrected roster data;
array strt1xm strt11m strt12m strt13m strt14m strt15m strt16m;
array strt1xy strt11y strt12y strt13y strt14y strt15y strt16y;
array s8771m s877411M s877421M s877431M s877441M s877451M s877461M;
array s8771y s877411Y s877421Y s877431Y s877441Y s877451Y s877461Y;
array startm start1m start2m start3m start4m start5m start6m;
array starty start1y start2y start3y start4y start5y start6y;
numstart=0;
do i = 1 to 6;
if s8771m[i] gt 0 and s8771y[i] gt 0 then do;
startm[i]=s8771m[i];
starty[i]=s8771y[i];
end;
else if s8771m[i] le 0 or s8771y[i] le 0 then do;
startm[i]=strt1xm[i];
starty[i]=strt1xy[i];
numstart=numstart+1;
end;
end;
*******Create arrays of grades attended, whether they were completed, and start and completion dates;
***grade attended;
array gr_att s841611 s841612 s841621 s841622 s841631 s841632 s841641 s841651 s9589111 s9589112 s9589113 s9589114 s9589121 s9589122 s9589211 s9589212 s9589213 s9589311 s9589411 s9589412;
***Completed y/n;
array gr_comp s913111 s913112 s913121 s913122 s913131 s913132 s913141 s913151 s9946111 s9946112 s9946113 s9946114 s9946121 s9946122 s9946211 s9946212 s9946213 s9946311 s9946411 s9946412;
***When completed grade - month;
array cdate_m s933511M s933512M s933521M s933522M s933531M s933532M s933541M s933551M s099111M s099112M s099113M s099114M s099121M s099122M s099211M s099212M s099213M s099311M s099411M s099412M;
***When completed grade - year;
array cdate_y s933511Y s933512Y s933521Y s933522Y s933531Y s933532Y s933541Y s933551Y s099111Y s099112Y s099113Y s099114Y s099121Y s099122Y s099211Y s099212Y s099213Y s099311Y s099411Y s099412Y;
***When started - month;
array s_date_m start1M s877412M start2M s877422M start3M s877432M start4M start5M s691111M s691112M s691113M s691114M s691121M s691122M s691211M s691212M s691213M s691311M s691411M s691412M;
***When started - year;
array s_date_y start1Y s877412Y start2Y s877422Y start3Y s877432Y start4Y start5Y s691111Y s691112Y s691113Y s691114Y s691121Y s691122Y s691211Y s691212Y s691213Y s691311Y s691411Y s691412Y;
*****Create arrays of all grades attended and completed and their start and complete dates;
array attend attend1-attend9;
array comp comp1-comp9;
array datestm datestm1-datestm9;
array datesty datesty1-datesty9;
array datecpm datecpm1-datecpm9;
array datecpy datecpy1-datecpy9;
****Set all new array vars to -4;
do i=1 to 9;
datestm[i]=-4;
datesty[i]=-4;
datecpm[i]=-4;
datecpy[i]=-4;
comp[i]=-4;
attend[i]=-4;
end;
*****Record all grades completed and their completion dates;
j=1;
do i= 1 to 20;
if gr_comp[i] = 1 and gr_att[i] not in (-4,-5) then do;
comp(j)=gr_att[i];
datecpm(j)=cdate_m[i];
datecpy(j)=cdate_y[i];
j=j+1;
end;
end;
*****Record all grades attended and their start dates;
k=1;
flag1=0;
if s913111 not in (-4,-5) then do;
if s841611 not in (-4,-5) then do;
attend[k]=s841611;
if start1M>0 then datestm[k]=start1M;
if start1Y>0 then datesty[k]=start1Y;
if s877411m=-4 and s877411y=-4 and strt11m=-4 and strt11y=-4 then flag1=1;
*if s877411m=-4 and s877411y=-4 and strt11m=-4 and strt11y=-4 and r1intyr>0 then datesty[k]=r1intyr;
k=k+1;
end;
do i=2 to 20;
if gr_comp[i] ne -4 and gr_comp[i] ne . then do;
attend(k)=gr_att[i];
datestm(k)=s_date_m[i];
datesty(k)=s_date_y[i];
k=k+1;
end;
end;
end;
*******Create date in continuous months for each start and complete date in arrays;
array c_date c_date1 c_date2 c_date3 c_date4 c_date5 c_date6 c_date7 c_date8 c_date9;
array s_date s_date1 s_date2 s_date3 s_date4 s_date5 s_date6 s_date7 s_date8 s_date9;
do i=1 to 9;
if datecpy[i] gt 0 and datecpm[i] gt 0 then c_date[i]=((datecpy[i]-1980)*12)+datecpm[i];
else if datecpy[i] in (-1, -2, -3) or datecpm[i] in (-1, -2, -3) then c_date[i]=-3;
else if datecpy[i] eq -4 or datecpm[i] eq -4 then c_date[i]=-4;
if datesty[i] gt 0 and datestm[i] gt 0 then s_date[i]=((datesty[i]-1980)*12)+datestm[i];
else if datesty[i] in (-1, -2, -3) or datestm[i] in (-1, -2, -3) then s_date[i]=-3;
else if datesty[i] eq -4 or datestm[i] eq -4 then s_date[i]=-4;
end;
*****Create new arrays of started and completed grades that have grades listed only once and in order- report latest complete date;
array newcomp newcomp1 newcomp2 newcomp3 newcomp4;
array newcdate newcdat1 newcdat2 newcdat3 newcdat4;
newcomp1=comp1;
newcdat1=c_date1;
***First make sure that the first element in the array is the lowest grade and the latest date for that grade;
do i=2 to 4;
if comp[i] gt 0 then do;
if comp[i] eq newcomp1 and c_date[i] gt newcdat1 then newcdat1=c_date[i];
else if comp[i] lt newcomp1 then do;
newcomp1=comp[i];
newcdat1=c_date[i];
end;
end;
end;
j=2;
do i=1 to 4;
if newcomp(j-1) ne . then do;
if comp[i] eq newcomp(j-1) and c_date[i] gt newcdate(j-1) then newcdate(j-1)=c_date[i];
else if comp[i] eq newcomp(j-1) + 1 then do;
newcomp(j)=comp[i];
newcdate(j)=c_date[i];
end;
else if newcomp(j)=. and comp[i] gt newcomp(j-1) then do;
newcomp(j)=comp[i];
newcdate(j)=c_date[i];
end;
end;
end;
j=3;
do i=1 to 4;
if newcomp(j-1) ne . then do;
if comp[i] eq newcomp(j-1) and c_date[i] gt newcdate(j-1) then newcdate(j-1)=c_date[i];
else if comp[i] eq newcomp(j-1) + 1 then do;
newcomp(j)=comp[i];
newcdate(j)=c_date[i];
end;
else if newcomp(j)=. and comp[i] gt newcomp(j-1) then do;
newcomp(j)=comp[i];
newcdate(j)=c_date[i];
end;
end;
end;
j=4;
do i=1 to 4;
if newcomp(j-1) ne . then do;
if comp[i] eq newcomp(j-1) and c_date[i] gt newcdate(j-1) then newcdate(j-1)=c_date[i];
else if comp[i] eq newcomp(j-1) + 1 then do;
newcomp(j)=comp[i];
newcdate(j)=c_date[i];
end;
else if newcomp(j)=. and comp[i] gt newcomp(j-1) then do;
newcomp(j)=comp[i];
newcdate(j)=c_date[i];
end;
end;
end;
***Create a new array with all grades attended in order and an array with the earliest date each grade was started;
array tmpatt tmpatt1 tmpatt2 tmpatt3 tmpatt4 tmpatt5 tmpatt6 tmpatt7 tmpatt8 tmpatt9;
array tmpadate tmpadat1 tmpadat2 tmpadat3 tmpadat4 tmpadat5 tmpadat6 tmpadat7 tmpadat8 tmpadat9;
array newatt newatt1 newatt2 newatt3 newatt4 newatt5 newatt6 newatt7 newatt8 newatt9;
array newadate newadat1 newadat2 newadat3 newadat4 newadat5 newadat6 newadat7 newadat8 newadat9;
do i=1 to 9;
tmpatt[i]=attend[i];
tmpadate[i]=s_date[i];
end;
j=1;
i=1;
k=1;
do i=1 to 9;
do j=i+1 to 9;
if tmpatt[j] ne -4 then do;
if tmpatt[j] lt tmpatt[i] and tmpatt[i] gt 0 and tmpatt[j] gt 0 then do;
att_temp = tmpatt[i];
dat_temp = tmpadate[i];
tmpatt[i]=tmpatt[j];
tmpadate[i] = tmpadate[j];
tmpatt[j] = att_temp;
tmpadate[j] = dat_temp;
end;
end;
end;
if i eq 1 then do;
newatt[k] = tmpatt[i];
newadate[k] = tmpadate[i];
end;
if tmpatt[i] eq newatt[k] then do;
if (0 lt tmpadate[i] lt newadate[k]) or (newadate[k]=-4 and tmpadate[i]>0) then do;
newatt[k] = tmpatt[i];
newadate[k] = tmpadate[i];
end;
else if tmpadate[i] in (-1,-2,-3) or newadate[k] in (-1,-2,-3) then newadate[k]=-3;
end;
else if tmpatt[i] gt newatt[k] then do;
k=k+1;
newatt[k] = tmpatt[i];
newadate[k] = tmpadate[i];
end;
j=i+1;
end;
***Find last enrollment date;
array stopm stop11m stop21m stop31m stop12m stop22m stop13m stop23m stop14m stop15m stop16m;
array stopy stop11y stop21y stop31y stop12y stop22y stop13y stop23y stop14y stop15y stop16y;
array stopd stopd1-stopd10;
array scode scode1 scode1 scode1 scode2 scode2 scode3 scode3 scode4 scode5 scode6;
do i=1 to 10;
if stopy[i] gt 0 and stopm[i] gt 0 then stopd[i]=((stopy[i]-1980)*12)+stopm[i];
else if stopy[i]=-5 then stopd[i]=-5;
else if stopy[i] in (-1,-2,-3) or stopm[i] in (-1,-2,-3) then stopd[i]=-3;
end;
if enroll=0 then do;
stopdate=stopd1;
do i=2 to 10;
if scode[i] in (1,2,3) and stopd[i]>stopdate then stopdate=stopd[i];
end;
end;
else if enroll=1 then stopdate=-4;
***Interview dates in cumulative months;
if r5inty>0 then intdate=(r5inty-1980)*12 + r5intm;
***** Set end dates for attended grades: find the end date for each grade attended - if r. doesn't give a completion date, choose the month before they started the next grade;
array newedate newedat1 newedat2 newedat3 newedat4 newedat5 newedat6 newedat7 newedat8 newedat9;
array iscomp iscomp1 iscomp2 iscomp3 iscomp4 iscomp5 iscomp6 iscomp7 iscomp8 iscomp9;
do i=1 to 9;
iscomp(i)=0;
end;
endimp=0;
do i=1 to 9;
do j=1 to 4;
if newatt(i)=newcomp(j) and newatt(i) gt 0 then do;
newedate(i)=newcdate(j);
iscomp(i)=1;
end;
end;
if newatt(i) ne . and newedate(i)=. and newadate(i) ne r4bfint and newadate(i) ne newadate(i+1) and newadate(i+1) ne . then do;
newedate(i)=newadate(i+1)-1;
endimp=1;
*put 'set at one less than next ' pubid= r4bfint= newatt(i)= newadate(i)= newedate(i)= newatt(i+1)= newadate(i+1)= newedate(i+1)= newatt(i+2)= newadate(i+2)= newedate(i+2)=;
end;
else if newatt(i) ne . and newedate(i)=. and newatt(i+1)=. and enroll=1 then do;
newedate(i)=intdate;
endimp=1;
*put 'substitute int date ' pubid= r4bfint= intdate= newatt(i)= newadate(i)= newedate(i)= newatt(i+1)= newadate(i+1)= newedate(i+1)= newatt(i+2)= newadate(i+2)= newedate(i+2)=;
end;
else if newatt(i) ne . and newedate(i)=. and newatt(i+1)=. and enroll=0 then do;
newedate(i)=stopdate;
endimp=1;
*put 'substitute int date ' pubid= r4bfint= intdate= newatt(i)= newadate(i)= newedate(i)= newatt(i+1)= newadate(i+1)= newedate(i+1)= newatt(i+2)= newadate(i+2)= newedate(i+2)=;
end;
else if newedate(i) eq . and newadate(i) eq r4bfint then do;
endimp=1;
if newadate(i) le 210 then newedate(i)=210;
else if 211 le newadate(i) le 222 then newedate(i)=222;
else if 223 le newadate(i) le 234 then newedate(i)=234;
else if 235 le newadate(i) le 246 then newedate(i)=246;
else if 247 le newadate(i) le 258 then newedate(i)=258;
else if 259 le newadate(i) le 270 then newedate(i)=270;
end;
end;
********delete the grades whose information is repeatedly reported in round 5;
*If a grade is reported in the previous rounds and was completed, we don't repeat this grade's info. in round 5;
array r4bfat r4bfat1-r4bfat15;
array r4bfst r4bfst1-r4bfst15;
array r4bfed r4bfed1-r4bfed15;
array r4bfcp r4bfcp1-r4bfcp15;
array tmp2att tmp2att1-tmp2att9;
do i=1 to 9;
tmp2att[i]=newatt[i];
end;
BACKCUT=0;
NCUT=0;
backrep=0;
do i=1 to 9;
do j=1 to 15;
if tmp2att[i]>0 and tmp2att[i]=r4bfat[j] and r4bfcp[j]=1 then do;
j=9;BACKCUT=1;NCUT=NCUT+1;
do k=i+1-ncut to 9-ncut;
if newatt[k+1] ne . then do;
newatt[k]=newatt[k+1];
newadate[k]=newadate[k+1];
newedate[k]=newedate[k+1];
iscomp[k]=iscomp[k+1];
end;
else do;
newatt[k]=.;
newadate[k]=.;
newedate[k]=.;
iscomp[k]=0;
k=9-ncut;
end;
end;
end;
end;
end;
if NEWATT1>0 then do;
do i=1 to 15;
if (r4bfat[i] ge newatt1 and r4bfat[i+1] ne .) or (r4bfat[i] ge newatt1 and r4bfcp[i]=1) then BACKREP=1;
end;
end;
*****Substitute start dates in the previous round for first grade in loops;
badpre=0;
replace=0;
jumprep1=0;
jumprep2=0;
jumpge21=0;
jumpge22=0;
*flag the case where the reported grades are jumping;
if r4bfat1 ne . then do;
do i=1 to 14;
if r4bfat[i] ne . and r4bfat[i+1] eq . then do;
lphigh=r4bfat[i];
lphighst=r4bfst[i];
lphighed=r4bfed[i];
lphighcp=r4bfcp[i];
lpnum=i;
i=15;
end;
end;
end;
else lphigh=-5;
if (lphigh ne -5 and ((newatt1=lphigh+1 and lphighcp ne 1) or newatt1>lphigh+1)) then jumprep1=1;
if (lphigh=-5 and ((hgcr1>0 and newatt1 ge hgcr1+2) or (s3500r1>0 and newatt1 ge s3500r1+2))) then jumprep2=1;
if (lphigh ne -5 and newatt1 ge lphigh+2) then jumpge21=1;
if (lphigh=-5 and hgcr1>0 and newatt1 ge hgcr1+3) then jumpge22=1;
if newatt1 gt 0 and r4bfat1 ne . then do;
do i=1 to 14;
if (r4bfst(i) gt r4bfed(i) and r4bfed(i) gt 0) or (r4bfed(i) gt r4bfst(i+1) and r4bfst(i+1) gt 0)
or (r4bfst(i+1) gt r4bfed(i+1) and r4bfed(i+1) gt 0) then do;
newadat1=-3;
badpre=1;
end;
else if r4bfat(i)=newatt1 and r4bfat(i+1)=. and r4bfcp[i]=0 and s3104 ne -5 and badpre ne 1 then do;
newadat1=r4bfst(i);
replace=1;
end;
end;
end;
else if -4 lt newatt1 le 0 then newadat1=-3;
***Measure the length that a respondent was in each completed grade and count the number of grades skipped and repeated;
array lengtha length1 length2 length3 length4 length5 length6 length7 length8 length9;
repeat=0;
repeatj=0;
skipleng=0;
skipl_j=0;
skip=-16;
skipj=-16;
oldstrt=0;
nocomp=0;
do i=1 to 8;
if newedate[i] gt 0 and newadate[i] gt 0 then lengtha[i]=newedate[i]-newadate[i];
if newadate[i] le newedate[i] le newadate[i+1] and lengtha[i] gt 13 and newatt[i+1]-newatt[i]=1
and newatt[i] ne 95 and repeat ne -3 then do;
repeat=repeat+1;
if i=1 and newadate(i) lt r4bfint then oldstrt=1;
if newedate(i) le 258 then repeatj=repeatj+1;
end;
else if newadate[i] le newedate[i] and newatt[i+1]=. and lengtha[i] gt 13 and newatt[i] ne 95 and
repeat ne -3 and (iscomp[i]=1 or s2857=newatt[i]) then do;
repeat=repeat+1;
if i=1 and newadate(i) lt r4bfint then oldstrt=1;
if newedate(i) le 258 then repeatj=repeatj+1;
end;
else if newadate[i] le newedate[i] and newatt[i+1]=. and lengtha[i] gt 13 and newatt[i] ne 95 and
repeat ne -3 and (iscomp[i]=0 and s2857 ne newatt[i]) then do;
if i=1 and newadate(i) lt r4bfint then oldstrt=1;
repeat=-3;
repeatj=-3;
end;
end;
do i=1 to 7;
if newadate(i) lt newedate(i) lt newadate(i+1) lt newedate(i+1) then do;
if newadate(i) in (212, 213, 224, 225, 236, 237, 248, 249,260,261) and (newadate(i) ne r4bfint) and newatt(i+1)-newatt(i)=1 and iscomp(i+1)=1 and
newedate(i+1)-newadate(i) le 12 and newadate(i+2)-newedate(i+1) le 9 then do;
*put 'after second skipl statement' pubid= i= newatt(i)= newadate(i)= newedate(i)= newatt(i+1)= newadate(i+1)= newedate(i+1)= iscomp(i+1)=;
if (i eq 1 or (i ne 1 and newadate(i)-newedate(i-1) le 9)) and skipleng ne -3 then do;
*put 'mid year skip i=1 ' pubid= i= newatt(i)= newadate(i)= newedate(i)= newatt(i+1)= newadate(i+1)= newedate(i+1)= iscomp(i+1)=
newatt(i+2)= newadate(i+1)= newedate(i+2)=;
skipleng=skipleng+1;
if newedate(i+1) le 258 and skipl_j ne -3 then skipl_j=skipl_j+1;
end;
end;
end;
end;
*Take care of connection between previous round and current round;
/*conect=0;
conectok=0;
if newatt1=lphigh and iscomp1=1 and lphighcp ne 1 then do;
conect=1;
if lpnum>2 then conectok=1;
end;*/
connect=0;
if newatt1>0 and lphigh>0 and newatt1 ne lphigh then do;
if newatt1-lphigh gt 1 then connect=1;
if lphighst in (212, 213, 224, 225, 236, 237, 248, 249,260,261) and newedat1 ge lphighst
and newedat1-lphighst le 12 then connect=2;
end;
else if newatt1>0 and lphigh>0 and newatt1=lphigh and iscomp1=1 and lphighcp ne 1 and r4bfst[lpnum-1]>0 then do;
if r4bfst[lpnum-1] in (212, 213, 224, 225, 236, 237, 248, 249,260,261) and newedat1 ge r4bfst[lpnum-1]
and newedat1-r4bfst[lpnum-1] le 12 then connect=3;
end;
/*if newatt1=lphigh and lphighcp ne 1 and preatt[lpnum-1] ne . then do;
n=lpnum-1;
if (preadate[n] le preedate[n] le newadat1 le newedat1) and (preadate[n] in (212, 213, 224, 225, 236, 237, 248, 249)
newatt1-preatt[n]=1 and iscomp1=1 and newedat1-preadat[n] le 12 and badgrade ne 1 and newadat2-newedat1 le 9)
and (preadat[n]-preedat[n-1] le 9 and skipleng ne -3 then do;
skipleng=skipleng+1;
skipback=1;
if newedat1 le 246 and skipl_j ne -3 then skipl_j=skipl_j+1;
end;
end; */
***Check for respondents who completely skip (do not attend) a grade;
skipgr=0;
skipgrj=0;
skipgt2=0;
do i=1 to 8;
if newatt(i+1)-newatt(i) eq 2 and newedate(i)>0 and newadate(i+1)>0 and newadate(i+1)-newedate(i) le 9 and skipgr ne -3 then do;
skipgr=skipgr+1;
if newedate(i+1) le 258 then skipgrj=skipgrj+1;
end;
else if newatt(i+1)-newatt(i) eq 3 and newedate(i)>0 and newadate(i+1)>0 and newadate(i+1)-newedate(i) le 9 then do;
skipgr=skipgr+2;
if newedate(i+1) le 258 then skipgrj=skipgrj+2;
end;
else if newatt(i)>0 and newatt(i+1)-newatt(i) gt 3 and newedate(i)>0 and newadate(i+1)>0 and newadate(i+1)-newedate(i) le 9 then do;
skipgt2=1; /* 2 cases, created variables are already -3 for them.*/
end;
end;
***Set repeat and skip to -3 if grades out of order or if backrep=1 or jumprep=1 or if report 0 grade;
allmess=0;
do i=1 to 8;
if (newadate(i) gt newedate(i) and newedate(i) gt 0) or (newedate(i) gt newadate(i+1) and newadate(i+1) gt 0)
or (newadate(i+1) gt newedate(i+1) and newedate(i+1) gt 0) then do;
allmess=1;
end;
end;
zerograd=0;
do i=1 to 9;
if newatt[i]=0 then zerogrd=1;
end;
negdate=0;
do i=1 to 9;
if newedate[i] in (-1,-2,-3) or newadate[i] in (-1,-2,-3) then negdate=1;
end;
if allmess=1 or backrep=1 or zerograd=1 or jumprep1=1 or jumprep2=1 or negdate=1 then do;
repeat=-3;
repeatj=-3;
skip=-3;
skipj=-3;
end;
***Flag respondents who reported skipping a grade and those who say they did NOT skip grade;
array whyskip S897711 S897712 S897721 S897731 S897741 S9793111 S9793112 S9793211 S9793212;
skipques=0;
do i=1 to 9;
if whyskip[i]=1 then skipques=1;
end;
notskip=0;
do i=1 to 9;
if whyskip[i] in (-1,-2,2,999) then notskip=1;
end;
double=0;
if skipgr>0 and skipleng>0 then double=1;
if skip ne -3 then do;
if (skipques eq 0 and skipleng=0 and skipgr=0) or (notskip ge 1 and skipques=0) then skip=0;
else if skipleng eq -3 and (skipgr=0 or skipques=0) then skip=-3;
else if skipgr=-3 and skipleng=0 then skip=-3;
else if skipleng ge 1 then skip=skipleng;
else if skipques ge 1 and skipgr ge 1 then skip=skipgr;
else if skipques ge 1 and skipgr = 0 then skip=-3;
else if skipques eq 0 and skipgr ge 1 then skip=-3;
if skipques=-3 or skipgr=-3 or skipleng=-3 then skip=-3;
end;
if skipj ne -3 then do;
if (skipl_j=0 and skipgrj=0) or (notskip ge 1 and skipques=0) then skipj=0;
else if skipl_j eq -3 and (skipgrj=0 or skipques=0) then skip=-3;
else if skipgrj=-3 and skipl_j=0 then skipj=-3;
else if skipl_j ge 1 then skipj=skipl_j;
else if skipques ge 1 and skipgrj ge 1 then skipj=skipgrj;
else if skipques ge 1 and skipgrj = 0 then skipj=-3;
else if skipques eq 0 and skipgrj ge 1 then skipj=-3;
if skip=-3 then skipj=-3;
end;
***Take care of the cases whose"repeated grade" could be double counted;
if oldstrt=1 and repeat>0 and r4bfrpev>0 and r4bf2857 ne -5 then do;
do i=1 to 8;
if r4bfat[i]=newatt1 and r4bfat[i+1]=. and (r4bfed[i]-r4bfst[i]) gt 13 and r4bfat[i] ne 95 and
(r4bfcp[i]=1 or r4bf2857=r4bfat[i]) then do;
repeat=repeat-1;
if newedat1 le 258 then repeatj=repeatj-1;
end;
end;
end;
***Combine the previous and current information;
if r4bfrpev ge 0 and repeat ge 0 then numrep=r4bfrpev+repeat;
else if r4bfrpev lt 0 then numrep=r4bfrpev;
else if r4bfrpev ge 0 and repeat lt 0 then numrep=repeat;
if r4bfrpev ge 0 and repeatj ge 0 then numrepj=r4bfrpev+repeatj;
else if r4bfrpev lt 0 then numrepj=r4bfrpev;
else if r4bfrpev ge 0 and repeatj lt 0 then numrepj=repeatj;
if r4bfskev ge 0 and skip ge 0 then numskip=r4bfskev+skip;
else if r4bfskev lt 0 then numskip=r4bfskev;
else if r4bfskev ge 0 and skip lt 0 then numskip=skip;
if r4bfskev ge 0 and skip ge 0 then numskipj=r4bfskev+skipj;
else if r4bfskev lt 0 then numskipj=r4bfskev;
else if r4bfskev ge 0 and skipj lt 0 then numskipj=skipj;
if s3104=-5 then do;
numskip=-5;
numrep=-5;
numskipj=-5;
numrepj=-5;
end;
if numrep in (-1,-2) then numrep=-3;
if numrepj in (-1,-2) then numrepj=-3;
if numskip in (-1,-2) then numskip=-3;
if numskipj in (-1,-2) then numskipj=-3;
*** Hand edit after checking the cases with r4bflag=1;
if pubid=548 then do; /* use the diploma date as the comp. date for 12th grade. skip 11th grade. */
r4bfed6=258; /* diploma date */
r4bfcp6=1;
numskip=1; /* finish both 11th and 12th from 249 to 258. */
numskipj=1;
end;
if pubid=4917 then do; /* skip 11th grade.*/
numskip=1;
numskipj=1;
end;
if pubid=1600991 then do; /* Change the dates for 11th and 12th grades so they makes more sense. */
r4bfat4=.; r4bfst4=.; r4bfed4=.; r4bfcp4=.;
r4bfat5=.; r4brst5=.; r4bfed5=.; r4bfcp5=.; /* take off the info. about 11th grade and 12th grade in round 4.*/
newatt1=11; newadat1=248; /* 11th grade starts at 248 and completed at 258. */
numrep=1;
numrepj=1;
end;
endsas;
Variables Created:
CV_SCH_ATTEND_EVER
CV_SCH_ATTEND_YR
Variables Used
|
Name in Program |
Question Name on CD |
| CURGDR1 | YSCH_3500_1997 |
| NUMR1 | CV_SCH_ATTEND_EVER_1997 |
| HGAR2 | YSCH_2857_1998 |
| NORCID | NORCID_1998 |
| NUMR2 | CV_SCH_ATTEND_EVER_1998 |
| HGAR3 | YSCH_2857_1999 |
| NUMR3 | CV_SCH_ATTEND_EVER_1999 |
| HGAR4 | YSCH_2857_2000 |
| NUMR4 | CV_SCH_ATTEND_EVER_2000 |
| HGAR5 | YSCH_2857_2001 |
| S826311 | YSCH_8263_01_01_2001 |
| S826312 | YSCH_8263_01_02_2001 |
| S826321 | YSCH_8263_02_01_2001 |
| S826322 | YSCH_8263_02_02_2001 |
| S826331 | YSCH_8263_03_01_2001 |
| S826332 | YSCH_8263_03_02_2001 |
| S826341 | YSCH_8263_04_01_2001 |
| S826351 | YSCH_8263_05_01_2001 |
| S841611 | YSCH_8416_01_01_2001 |
| S841612 | YSCH_8416_01_02_2001 |
| S841621 | YSCH_8416_02_01_2001 |
| S841622 | YSCH_8416_02_02_2001 |
| S841631 | YSCH_8416_03_01_2001 |
| S841632 | YSCH_8416_03_02_2001 |
| S841641 | YSCH_8416_04_01_2001 |
| S841651 | YSCH_8416_05_01_2001 |
| S9589111 | YSCH_9589_01_01_01_2001 |
| S9589112 | YSCH_9589_01_01_02_2001 |
| S9589113 | YSCH_9589_01_01_03_2001 |
| S9589114 | YSCH_9589_01_01_04_2001 |
| S9589121 | YSCH_9589_01_02_01_2001 |
| S9589122 | YSCH_9589_01_02_02_2001 |
| S9589211 | YSCH_9589_02_01_01_2001 |
| S9589212 | YSCH_9589_02_01_02_2001 |
| S9589213 | YSCH_9589_02_01_03_2001 |
| S9589311 | YSCH_9589_03_01_01_2001 |
| S9589411 | YSCH_9589_04_01_01_2001 |
| S9589412 | YSCH_9589_04_01_02_2001 |
| START1M | NEWSCHOOL_START1_01_M_2001 |
| START1Y | NEWSCHOOL_START1_01_Y_2001 |
| START2M | NEWSCHOOL_START1_02_M_2001 |
| START2Y | NEWSCHOOL_START1_02_Y_2001 |
| START3M | NEWSCHOOL_START1_03_M_2001 |
| START3Y | NEWSCHOOL_START1_03_Y_2001 |
| START4M | NEWSCHOOL_START1_04_M_2001 |
| START4Y | NEWSCHOOL_START1_04_Y_2001 |
| START5M | NEWSCHOOL_START1_05_M_2001 |
| START5Y | NEWSCHOOL_START1_05_Y_2001 |
| START6M | NEWSCHOOL_START1_06_M_2001 |
| START6Y | NEWSCHOOL_START1_06_Y_2001 |
| ROUND1 | NEWSCHOOL_INTERVIEW_01_2001 |
| ROUND2 | NEWSCHOOL_INTERVIEW_02_2001 |
| ROUND3 | NEWSCHOOL_INTERVIEW_03_2001 |
| ROUND4 | NEWSCHOOL_INTERVIEW_04_2001 |
| ROUND5 | NEWSCHOOL_INTERVIEW_05_2001 |
| ROUND6 | NEWSCHOOL_INTERVIEW_06_2001 |
| SCHID1 | NEWSCHOOL_PUBID_01_2001 |
| SCHID2 | NEWSCHOOL_PUBID_02_2001 |
| SCHID3 | NEWSCHOOL_PUBID_03_2001 |
| SCHID4 | NEWSCHOOL_PUBID_04_2001 |
| SCHID5 | NEWSCHOOL_PUBID_05_2001 |
| SCHID6 | NEWSCHOOL_PUBID_06_2001 |
| symgrd | SYMBOL_CUR_FIRSTGRADE_01_01_2001 |
This program calculates the number of schools ever attended by the respondent as of the interview date and as of June 30, 2001. The program first counts the number of new regular schools that the youth attended since DLI to the date of survey using the first enrollment date in each new school, then adds this number to the created variable from the previous round to get the total number of regular schools that the youth has ever attended.
Users should note that the variable counts only schools at which the respondent attended grades 7-12. In addition, if a respondent did not have a parent interview in round 1 and the respondent was already in 7th grade or higher in that round, no information was collected on the number of schools attended prior to round 1. These respondents receive a -4 in round 1 and a -3 in all subsequent rounds.array STARTM START1M START2M START3M START4M START5M START6M;
array STARTY START1Y START2Y START3Y START4Y START5Y START6Y;
array START START1-START6;
array ROUND ROUND1-ROUND6;
array SCHID SCHID1-SCHID6;
array DUMGRD DUMGRD1-DUMGRD6;
array AGAIN AGAIN1-AGAIN6;
/** correct for a miscalculation in round 4 created variable **/
if pubid in (686,1607,5129,6100) then do;
numr4=(numr4-2);
numr4_fl=1;
end;
if
pubid in
(118,135,162,163,193,196,375,570,644,645,690,775,779,
875,1031,1063,1137,1202,1467,1518,1550,1570,1573,1609,1626,1702,1718,
1852,1859,1877,1892,1924,1936,1971,2123,2168,2175,2218,2232,2241,2288,
2329,2370,2436,2450,2516,2535,2539,2543,2549,2550,2774,2775,2776,2830,
2835,2890,2959,2964,2995,3007,3083,3224,3474,3525,3638,3679,3749,3824,
3859,3873,3917,3968,3972,3990,4010,4043,4228,4242,4250,4251,4271,4291,
4336,4351,4371,4616,4625,4627,4651,4705,4718,4758,4767,4794,4914,4939,
5019,5064,5254,5305,5341,5467,5767,5824,5825,5833,5845,5905,5935,5967,
6029,6035,6039,6084,6095,6126,6177,6278,6353,6446,6449,6542,6543,6654,
6934,6953,6984,7012,7079,7126,7156,7157,7214,7352,7402,7453,7608,7638,
7642,7762,7838,7883,7897,7916,7940,7953,7991,8016,8050,8189,8222,8308,
8320,8322,8458,8461,8571,8636,8650,8698,8707,8708,8730,8733,8747,8960)
then do;
numr4=(numr4-1);
end;
/*First, create the dummy variable for each school to indicate if the youth attended grade 7
through grade 12 in that school.
NOTE: The order to give dummies is very important here, That is, we should give dummy=-3 first,
then give dummy=1, this way, we won't miss the school as long as one the grades the kids attend in
that school is between 7 and 12.
DUMGRD1-DUMGRD6= dummy to indicate whether R attended grades 7-12 in schools 1-6
AGAIN1-AGAIN6=dummy to indicate whether school 1-6 is the same school as one already recorded, to avoid
overcounts
STARTM/Y=start date for a given school*/
do I=1 to 6;
DUMGRD[I]=0;
START[I]=-4;
end;
/* R5 reads-in a grade from the prior round, but no special treatment is necessary */
if (-3<=S841611<=-1 OR -3<=S9589111<=-1 OR -3<=S9589112<=-1 OR -3<=S9589113<=-1 OR -3<=S9589114<=-1)
OR (-3<=S841612<=-1 OR -3<=S9589121<=-1) then DUMGRD1=-3;
if (-3<=S841621<=-1 OR -3<=S9589211<=-1 OR -3<=S9589212<=-1 OR -3<=S9589213<=-1 ) OR
-3<=S841622<=-1 then DUMGRD2=-3;
if (-3<=S841631<=-1 OR -3<=S9589311<=-1) OR -3<=S841632<=-1 then DUMGRD3=-3;
if (-3<=S841641<=-1 OR -3<=S9589411<=-1) then DUMGRD4=-3;
if (-3<=S841651<=-1) then DUMGRD5=-3;
if (7<=s841611<=12 OR 7<=S9589111<=12 OR 7<=S9589112<=12 OR 7<=S9589113<=12 OR 7<=S9589114<=12)
OR (7<=S841612<=12 OR 7<=S9589121<=12) then DUMGRD1=1;
if (7<=S841621<=12 OR 7<=S9589211<=12 OR 7<=S9589212<=12 OR 7<=S9589213<=12 ) OR
7<=S841622<=12 then DUMGRD2=1;
if (7<=S841631<=12 OR 7<=S9589311<=12) OR 7<=S841632<=12 then DUMGRD3=1;
if (7<=S841641<=12 OR 7<=S9589411<=12) then DUMGRD4=1;
if (7<=S841651<=12) then DUMGRD5=1;
/*create a flag (again 1-6) for schools that are reported more than once for a grade 7-12 in the
same round, using pubid for the school. THis will be used to avoid double counting schools.*/
do i=1 to 6;
again(i)=0;
end;
do i=1 to 6;
if i=6 and schid(i)>0 and dumgrd(i)=1 and dumgrd(i-5)=1 and schid(i)=schid(i-5) then again(i)=1;
if i>=5 and schid(i)>0 and dumgrd(i)=1 and dumgrd(i-4)=1 and schid(i)=schid(i-4) then again(i)=1;
if i>=4 and schid(i)>0 and dumgrd(i)=1 and dumgrd(i-3)=1 and schid(i)=schid(i-3) then again(i)=1;
if i>=3 and schid(i)>0 and dumgrd(i)=1 and dumgrd(i-2)=1 and schid(i)=schid(i-2) then again(i)=1;
if i>=2 and schid(i)>0 and dumgrd(i)=1 and dumgrd(i-1)=1 and schid(i)=schid(i-1) then again(i)=1;
end;
array startdm startdm1-startdm6;
do i=1 to 6;
if starty[i]>0 or starty[i] in (-1,-2,-3) then startdm[i]=1;
else startdm[i]=0;
end;
/*Next, calculate NUMJR5 and NUMR5.*/
/* Calculate the accumulated month of the start date. */
do I=1 to 6;
if STARTY[I]>0 and STARTM[I]>0 then START[I]=12*(STARTY[I]-1990)+STARTM[I];
end;
NUMJR5=0;
NUMR5=0;
/**** count the new schools for all the cases.*****/
do I=1 to 6;
if ROUND[I]=5 and again(i)=0 then do;
if DUMGRD[I]=1 then NUMR5=NUMR5+1;
if DUMGRD[I]=1 and (0<START[I]<=126 OR 0<STARTY[I]<2000) then NUMJR5=NUMJR5+1;
end;
end;
if -3<=round1<=-1 or -3<=round2<=-1 or -3<=round3<=-1 or -3<=round4<=-1 or -3<=round5<=-1 or -3<=round6<=1
then do;
numr5=-3;
numjr5=-3;
end;
/**** If the respondent is not interviewed in round 4 and has no number of schools info. in
previous rounds, or if number of school info. in round 4 is in (0,-4), then count all the schools.
That is, for these people, the above count will be overwritten.****/
flagprev=0;
flagprev=0;
if (numr4=-5 and numr3 in (0,-4,-5) and numr2 in (0,-4,-5) and numr1 in (0,-4)) or numr4 in (0, -4) then do;
numr5=0;
numjr5=0;
flagprev=1;
do i=1 to 6;
if DUMGRD[I]=1 and again(i)=0 then NUMR5=NUMR5+1;
if DUMGRD[I]=1 and again(i)=0 and (0<START[I]<=126 OR 0<STARTY[I]<2000 or (round[i] in (1,2,3,4) and
again(i)=0)) then NUMJR5=NUMJR5+1;
end;
end;
if DUMGRD1=-3 OR DUMGRD2=-3 OR DUMGRD3=-3 OR DUMGRD4=-3 OR DUMGRD5=-3 OR DUMGRD6=-3 then do;
NUMR5=-3;
NUMJR5=-3;
end;
if (ROUND1=5 and AGAIN1 =0 and DUMGRD1=1 and ((START1Y=2000 and -4<START1M<0) OR -4<START1Y<0)) OR
(ROUND2=5 and AGAIN2 =0 and DUMGRD2=1 and ((START2Y=2000 and -4<START2M<0) OR -4<START2Y<0)) OR
(ROUND3=5 and AGAIN3 =0 and DUMGRD3=1 and ((START3Y=2000 and -4<START3M<0) OR -4<START3Y<0)) OR
(ROUND4=5 and AGAIN4 =0 and DUMGRD4=1 and ((START4Y=2000 and -4<START4M<0) OR -4<START4Y<0)) OR
(ROUND5=5 and AGAIN5 =0 and DUMGRD5=1 and ((START5Y=2000 and -4<START5M<0) OR -4<START5Y<0)) OR
(ROUND6=5 and AGAIN6 =0 and DUMGRD6=1 and ((START6Y=2000 and -4<START6M<0) OR -4<START6Y<0))
then NUMJR5=-3;
/*We then add the above two numbers to the correponding variables from round 4 to round 1.*/
if NUMR4>=0 then do;
if NUMJR5>=0 then NUMJ=NUMJR5+NUMR4;
if NUMR5>=0 then NUMS=NUMR5+NUMR4;
end;
if NUMR4=-4 and HGAR4<7 then do;
if NUMJR5>=0 then NUMJ=NUMJR5;
if NUMR5>=0 then NUMS=NUMR5;
end;
if NUMR4=-5 then do;
if NUMR3>=0 then do;
if NUMJR5>=0 then NUMJ=NUMJR5+NUMR3;
if NUMR5>=0 then NUMS=NUMR5+NUMR3;
end;
else if NUMR2>=0 then do;
if NUMJR5>=0 then NUMJ=NUMJR5+NUMR2;
if NUMR5>=0 then NUMS=NUMR5+NUMR2;
end;
else if NUMR1>=0 and NUMR2<0 then do;
if NUMJR5>=0 then NUMJ=NUMJR5+NUMR1;
if NUMR5>=0 then NUMS=NUMR5+NUMR1;
end;
/*For the youth who didn't answer the number of schools in round 1, we distinguish them into
three cases 1)If the 'grade currently attended' in round 1 is <=7 and the 'highest grade attended'
in round 3 >= 7, we use the number from round 3 as the total number. 2)If the 'grade currently
attended' in round 1 >7, we use -3 for the total number. 3)If both the 'grade currently attended'
in round 1 and the 'highest grade attended' in round 3 are <7, we use -4 for the total number.*/
if NUMR1 in (0,-4) then do;
if CURGDR1<=7 then do;
NUMJ=NUMJR5;
NUMS=NUMR5;
end;
if CURGDR1>7 or NUMR1 in (-1,-2,-3) then do;
NUMJ=-3;
NUMS=-3;
end;
if CURGDR1<7 and HGAR5<7 then do;
NUMJ=-4;
NUMS=-4;
end;
end;
end;
if NUMR1 in (-4,0) and CURGDR1>7 then do;
nums=-4;
numj=-4;
end;
if -3<=NUMR1<=-1 OR -3<=NUMR2<=-1 OR NUMR3=-3 OR NUMR4=-3 OR NUMJR5=-3 then NUMJ=-3;
if -3<=NUMR1<=-1 OR -3<=NUMR2<=-1 OR NUMR3=-3 OR NUMR4=-3 OR NUMR5=-3 then NUMS=-3;
if HGAR5<7 then do;
numj=-4;
nums=-4;
end;
if S826311=-5 then do;
NUMJR5=-5;
NUMR5=-5;
NUMJ=-5;
NUMS=-5;
end;
endsas;
Variables Created:
CV_BA_CREDITS.01-.05
CV_ASSOC_CREDITS.01-.05
Variables Used
|
Name in Program |
Question Name on CD |
Name in Program |
Question Name on CD |
| norcid | NORCID | r1_asct | CV_ASSOC_CREDITS |
| e16200 | YSCH-16200.01 | r1_bact | CV_BA_CREDITS |
| e17200 | YSCH-17200.01 | r1_int | CV_INTERVIEW_CMONTH |
| e265211 | YSCH-26521.01 | r2273371 | YSCH-27337.01 |
| e265212 | YSCH-26521.02 | r2273372 | YSCH-27337.02 |
| e265213 | YSCH-26521.03 | r2273373 | YSCH-27337.03 |
| e265214 | YSCH-26521.04 | r2273374 | YSCH-27337.04 |
| e265215 | YSCH-26521.05 | r2273375 | YSCH-27337.05 |
| e265216 | YSCH-26521.06 | r2273881 | YSCH-27388.01 |
| xcred1 | YSCH-26827.01 | r2273882 | YSCH-27388.02 |
| xcred2 | YSCH-26827.02 | r2273883 | YSCH-27388.03 |
| xcred3 | YSCH-26827.03 | r2273884 | YSCH-27388.04 |
| xcred4 | YSCH-26827.04 | r2273885 | YSCH-27388.05 |
| apcred1 | YSCH-26878.01 | r2pubid1 | NEWSCHOOL_PUBID.01 |
| apcred2 | YSCH-26878.02 | r2pubid2 | NEWSCHOOL_PUBID.02 |
| apcred3 | YSCH-26878.03 | r2pubid3 | NEWSCHOOL_PUBID.03 |
| apcred4 | YSCH-26878.04 | r2pubid4 | NEWSCHOOL_PUBID.04 |
| hscred1 | YSCH-26929.01 | r2pubid5 | NEWSCHOOL_PUBID.05 |
| hscred2 | YSCH-26929.02 | r2pubid6 | NEWSCHOOL_PUBID.06 |
| hscred3 | YSCH-26929.03 | r2_asct1 | CV_ASSOC_CREDITS.01 |
| hscred4 | YSCH-26929.04 | r2_asct2 | CV_ASSOC_CREDITS.02 |
| e273371 | YSCH-27337.01 | r2_asct3 | CV_ASSOC_CREDITS.03 |
| e273372 | YSCH-27337.02 | r2_asct4 | CV_ASSOC_CREDITS.04 |
| e273373 | YSCH-27337.03 | r2_asct5 | CV_ASSOC_CREDITS.05 |
| e273374 | YSCH-27337.04 | r2_bact1 | CV_BA_CREDITS.01 |
| e273375 | YSCH-27337.05 | r2_bact2 | CV_BA_CREDITS.02 |
| e273376 | YSCH-27337.06 | r2_bact3 | CV_BA_CREDITS.03 |
| e273881 | YSCH-27388.01 | r2_bact4 | CV_BA_CREDITS.04 |
| e273882 | YSCH-27388.02 | r2_bact5 | CV_BA_CREDITS.05 |
| e273883 | YSCH-27388.03 | r2_int | CV_INTERVIEW_CMONTH |
| e273884 | YSCH-27388.04 | r3273371 | YSCH-27337.01 |
| e273885 | YSCH-27388.05 | r3273372 | YSCH-27337.02 |
| e273886 | YSCH-27388.06 | r3273373 | YSCH-27337.03 |
| e2070011 | YSCH-20700.01.01 | r3273374 | YSCH-27337.04 |
| e2070012 | YSCH-20700.01.02 | r3273375 | YSCH-27337.05 |
| e2070013 | YSCH-20700.01.03 | r3273881 | YSCH-27388.01 |
| e2070014 | YSCH-20700.01.04 | r3273882 | YSCH-27388.02 |
| e2070015 | YSCH-20700.01.05 | r3273883 | YSCH-27388.03 |
| e2070016 | YSCH-20700.01.06 | r3273884 | YSCH-27388.04 |
| e2070017 | YSCH-20700.01.07 | r3273885 | YSCH-27388.05 |
| e2070021 | YSCH-20700.02.01 | r3pubid1 | NEWSCHOOL_PUBID.01 |
| e2070022 | YSCH-20700.02.02 | r3pubid2 | NEWSCHOOL_PUBID.02 |
| e2070023 | YSCH-20700.02.03 | r3pubid3 | NEWSCHOOL_PUBID.03 |
| e2070024 | YSCH-20700.02.04 | r3pubid4 | NEWSCHOOL_PUBID.04 |
| e2070025 | YSCH-20700.02.05 | r3pubid5 | NEWSCHOOL_PUBID.05 |
| e2070026 | YSCH-20700.02.06 | r3pubid6 | NEWSCHOOL_PUBID.06 |
| e2070027 | YSCH-20700.02.07 | r3pubid7 | NEWSCHOOL_PUBID.07 |
| e2070031 | YSCH-20700.03.01 | r3_asct1 | CV_ASSOC_CREDITS.01 |
| e2070032 | YSCH-20700.03.02 | r3_asct2 | CV_ASSOC_CREDITS.02 |
| e2070033 | YSCH-20700.03.03 | r3_asct3 | CV_ASSOC_CREDITS.03 |
| e2070041 | YSCH-20700.04.01 | r3_asct5 | CV_ASSOC_CREDITS.05 |
| e2070051 | YSCH-20700.05.01 | r3_bact1 | CV_BA_CREDITS.01 |
| e2070052 | YSCH-20700.05.02 | r3_bact2 | CV_BA_CREDITS.02 |
| e2070061 | YSCH-20700.06.01 | r3_bact3 | CV_BA_CREDITS.03 |
| e228001 | YSCH-22800.01 | r3_bact4 | CV_BA_CREDITS.04 |
| e228002 | YSCH-22800.02 | r3_bact5 | CV_BA_CREDITS.05 |
| e228003 | YSCH-22800.03 | r3_int | CV_INTERVIEW_CMONTH |
| e228004 | YSCH-22800.04 | r4273371 | YSCH-27337.01 |
| e228005 | YSCH-22800.05 | r4273372 | YSCH-27337.02 |
| e228006 | YSCH-22800.06 | r4273373 | YSCH-27337.03 |
| e230001 | YSCH-23000.01 | r4273374 | YSCH-27337.04 |
| e230002 | YSCH-23000.02 | r4273881 | YSCH-27388.01 |
| e230003 | YSCH-23000.03 | r4273882 | YSCH-27388.02 |
| e231001 | YSCH-23100.01 | r4273883 | YSCH-27388.03 |
| e231002 | YSCH-23100.02 | r4273884 | YSCH-27388.04 |
| e231003 | YSCH-23100.03 | r4pubid1 | NEWSCHOOL_PUBID.01 |
| e231004 | YSCH-23100.04 | r4pubid2 | NEWSCHOOL_PUBID.02 |
| e231005 | YSCH-23100.05 | r4pubid3 | NEWSCHOOL_PUBID.03 |
| e232001 | YSCH-23200.01 | r4pubid4 | NEWSCHOOL_PUBID.04 |
| e232002 | YSCH-23200.02 | r4pubid5 | NEWSCHOOL_PUBID.05 |
| e232003 | YSCH-23200.03 | r4_asct1 | CV_ASSOC_CREDITS.01 |
| e232004 | YSCH-23200.04 | r4_asct2 | CV_ASSOC_CREDITS.02 |
| e232005 | YSCH-23200.05 | r4_asct3 | CV_ASSOC_CREDITS.03 |
| e232006 | YSCH-23200.06 | r4_asct4 | CV_ASSOC_CREDITS.04 |
| e233001 | YSCH-23300.01 | r4_bact1 | CV_BA_CREDITS.01 |
| e233002 | YSCH-23300.02 | r4_bact2 | CV_BA_CREDITS.02 |
| e233003 | YSCH-23300.03 | r4_bact3 | CV_BA_CREDITS.03 |
| e233004 | YSCH-23300.04 | r4_bact4 | CV_BA_CREDITS.04 |
| e233005 | YSCH-23300.05 | r4_int | CV_INTERVIEW_CMONTH |
| e234001 | YSCH-23400.01 | r1231001 | YSCH-23100.01 |
| e234002 | YSCH-23400.02 | r1232001 | YSCH-23200.01 |
| e234003 | YSCH-23400.03 | r1233001 | YSCH-23300.01 |
| r5pubid1 | NEWSCHOOL_PUBID.01 | r1234001 | YSCH-23400.01 |
| r5pubid2 | NEWSCHOOL_PUBID.02 | r2231001 | YSCH-23100.01 |
| r5pubid3 | NEWSCHOOL_PUBID.03 | r2231002 | YSCH-23100.02 |
| r5pubid4 | NEWSCHOOL_PUBID.04 | r2231003 | YSCH-23100.03 |
| r5pubid5 | NEWSCHOOL_PUBID.05 | r2231004 | YSCH-23100.04 |
| r5pubid6 | NEWSCHOOL_PUBID.06 | r2232001 | YSCH-23200.01 |
| r1229001 | YSCH-22900.01 | r2232002 | YSCH-23200.02 |
| r2229001 | YSCH-22900.01 | r2232003 | YSCH-23200.03 |
| r2229002 | YSCH-22900.02 | r2232004 | YSCH-23200.04 |
| r2229003 | YSCH-22900.03 | r2232005 | YSCH-23200.05 |
| r2229004 | YSCH-22900.04 | r2233001 | YSCH-23300.01 |
| r2229005 | YSCH-22900.05 | r2233002 | YSCH-23300.02 |
| r2234501 | YSCH-23450.01 | r2233003 | YSCH-23300.03 |
| r2234502 | YSCH-23450.02 | r2234001 | YSCH-23400.01 |
| r2234503 | YSCH-23450.03 | r2234002 | YSCH-23400.02 |
| r2234504 | YSCH-23450.04 | r2234003 | YSCH-23400.03 |
| r3229001 | YSCH-22900.01 | r2234004 | YSCH-23400.04 |
| r3229002 | YSCH-22900.02 | r3231001 | YSCH-23100.01 |
| r3229003 | YSCH-22900.03 | r3231002 | YSCH-23100.02 |
| r3229004 | YSCH-22900.04 | r3231003 | YSCH-23100.03 |
| r3234501 | YSCH-23450.01 | r3232001 | YSCH-23200.01 |
| r3234502 | YSCH-23450.02 | r3232002 | YSCH-23200.02 |
| r3234503 | YSCH-23450.03 | r3232003 | YSCH-23200.03 |
| r4229001 | YSCH-22900.01 | r3232004 | YSCH-23200.04 |
| r4229002 | YSCH-22900.02 | r3233001 | YSCH-23300.01 |
| r4229003 | YSCH-22900.03 | r3233002 | YSCH-23300.02 |
| r4229004 | YSCH-22900.04 | r3233003 | YSCH-23300.03 |
| r4234501 | YSCH-23450.01 | r3234001 | YSCH-23400.01 |
| r4234502 | YSCH-23450.02 | r3234002 | YSCH-23400.02 |
| r4234503 | YSCH-23450.03 | r3234003 | YSCH-23400.03 |
| r5229001 | YSCH-22900.01 | r3234004 | YSCH-23400.04 |
| r5229002 | YSCH-22900.02 | r4231001 | YSCH-23100.01 |
| r5229003 | YSCH-22900.03 | r4231002 | YSCH-23100.02 |
| r5229004 | YSCH-22900.04 | r4231003 | YSCH-23100.03 |
| r5229005 | YSCH-22900.05 | r4231004 | YSCH-23100.04 |
| r5229006 | YSCH-22900.06 | r4232001 | YSCH-23200.01 |
| r5234501 | YSCH-23450.01 | r4232002 | YSCH-23200.02 |
| r5234502 | YSCH-23450.02 | r4232003 | YSCH-23200.03 |
| r5234503 | YSCH-23450.03 | r4232004 | YSCH-23200.04 |
| r5234504 | YSCH-23450.04 | r4233001 | YSCH-23300.01 |
| r5234505 | YSCH-23450.05 | r4233002 | YSCH-23300.02 |
| r5234506 | YSCH-23450.06 | r4233003 | YSCH-23300.03 |
| r4233004 | YSCH-23300.04 | ||
| r4234001 | YSCH-23400.01 | ||
| r4234002 | YSCH-23400.02 | ||
| r4234003 | YSCH-23400.03 | ||
| r4234004 | YSCH-23400.04 |
Codes for Created Variable
These variables are created on a continuous scale. They have 2 implied decimal places.
This program calculates the fraction of credits the respondent has completed toward an associate's degree or a bachelor's degree.
/* arrays for Rounds 1-4 */
array r2_asct (i) r2_asct1-r2_asct5 ; /* fraction of credits earned for round2*/
array r2_bact (i) r2_bact1-r2_bact5 ; /* fraction of credits earned for round2*/
array r3_asct (i) r3_asct1-r3_asct5 ; /* fraction of credits earned for round3*/
array r3_bact (i) r3_bact1-r3_bact5 ; /* fraction of credits earned for round3*/
array r4_asct (i) r4_asct1-r4_asct4 ; /* fraction of credits earned for round4*/
array r4_bact (i) r4_bact1-r4_bact4 ; /* fraction of credits earned for round4*/
array r227388 (i) r2273881-r2273885 ; /* total credits needed for graduation */
array r327388 (i) r3273881-r3273885 ; /* total credits needed for graduation */
array r427388 (i) r4273881-r4273884 ; /* total credits needed for graduation */
array r2tasct (i) r2tasct1-r2tasct5 ; /* total credits (not the fraction) earned with DLI scholls */
array r2tbact (i) r2tbact1-r2tbact5 ; /* total credits (not the fraction) earned with DLI scholls */
array r3tasct (i) r3tasct1-r3tasct5 ; /* total credits (not the fraction) earned with DLI scholls */
array r3tbact (i) r3tbact1-r3tbact5 ; /* total credits (not the fraction) earned with DLI scholls */
array r4tasct (i) r4tasct1-r4tasct4 ; /* total credits (not the fraction) earned with DLI scholls */
array r4tbact (i) r4tbact1-r4tbact4 ; /* total credits (not the fraction) earned with DLI scholls */
/* arrarys for Round 5 */
array e23000 (i) e230001-e230006 ; /* refer to case 1 notes below*/ /* 4 */
array e22800 (i) e228001-e228006 ; /* refer to case 1 notes below */
array e27337 (i) e273371-e273376 ; /* what type of diploma */
array e27388 (i) e273881-e273886 ; /* total credits required to earn the degree */
array e26521 (i) e265211-e265216 ; /* refer to case 2 notes below*/
array xcred (i) xcred1-xcred6 ; /* transfer credits */ /* 4 */
array apcred (i) apcred1-apcred6 ; /* test credits */ /* 4 */
array hscred (i) hscred1-hscred6 ; /* credits from highschool */ /* 4 */
array tcred (i) tcred1-tcred6 ; /* total credits (not fraction) earned */
array r5tbac (i) r5tbac1-r5tbac6 ; /* total credits (not fraction) earned towards BA degree */
array r5tasc (i) r5tasc1-r5tasc6 ; /* total credits (not fraction) earned towards assoc degree */
array asfrac (i) asfrac1-asfrac6 ; /* Created variable fraction credits earned for associate credits */
array bafrac (i) bafrac1-bafrac6 ; /* Created variable fraction credits earned for bachelor credits */
array e23200 (i) e232001-e232006 ; /* respondent needs no more credits if 1, more credits are needed if 0 */
array e23400 (i) e234001-e234003 ; /* how many credits still needed */
/* Rob 12-20-00 If a respondent completed at least one term, CAPI verifies the total credits for each school at YSCH-22800.
Due to a design error, the check question YSCH-22800 does not include Round 2 college credits even when the PUBID's
from both rounds match. However, if a respondent see this incorrect count and tells us it is correct, we will use it.
Respondents who have yet to complete a term at a given school will not be asked YSCH-22800. The only
credits possible for these people are incoming credits at YSCH-26521, or the dli Round c.v. for a matching school. */
/*
There are 3 ways to get credits in this program,
which are all exclusive (except for 1 case mentioned below).
Case 1: If the respondent completed any terms, we use YSCH-22800 or YSCH-23000.
Case 2: If the respondent has not completed any terms and reported a new school,
then we use the incoming credits (YSCH-26521).For school #1 use YSCH-16200.
Case 3: If the respondent has not completed any terms and reported a dli school,
then we use the total credit from the dli round
(through the PUBID match variable described below).
*/
array r5cred (i) r5cred1-r5cred6; /* credits earned with Case 1 */
do i=1 to 6;
if E22800>-4 then do;
TCRED=E22800;
r5cred=1;
end;
if E23000>-4 then do;
TCRED=E23000;
r5cred=1;
end;
end;
/* Check for people who attended college but were skipped out of
YSCH-22800 and YSCH-23000 (because of no completed terms). */
array noterm (i) noterm1-noterm6;
do i=1 to 6;
if e27337 in (1,3) and e22800=-4 and e23000=-4 then noterm=1;
end;
/* For people who did not complete any terms,
the only data available is the incoming credits count (that is CASE 2)
and the created variable from their DLI round (that is CASE 3).
These two pieces of data are exclusive. */
do i=1 to 4;
if noterm=1 and (r4_bact>0 or r4_asct>0) then do;
back4=1;
end;
end;
do i=1 to 5;
if noterm=1 and (r3_bact>0 or r3_asct>0) and r4_int=-5 then do;
back3=1;
end;
end;
do i=1 to 5;
if noterm=1 and (r2_bact>0 or r2_asct>0) and r3_int=-5 and r4_int=-5 then do;
back2=1;
end;
end;
array flag (i) flag1-flag6;
/* The flag variable checks for inconsistency of incoming credits answers.
When reporting a new college, we ask the respondent for total incoming credits (YSCH-26521)
and then to break them up into transfer credits, college credits earned in high school,
and AP credits. When the sum of the three components doesn't equal the answer in YSCH-26521, flag=1.
*/
/* In round 5, 23 at loop 1, 131 at loop 2, 10 at loop 3, 1 at loop 4 and 0 at loops 5 and 6 have flag=1. */
do i=1 to 6;
if E26521=>0 and XCRED=>0 and HSCRED=>0 and APCRED=>0 then do;
if E26521 ne XCRED+HSCRED+APCRED then do;
flag=1;
end;
end;
end;
/* Case 2: The following are people who reported a new school
and have no completed terms (and thus no answer to YSCH-22800). */
array incred (i) incred1-incred6; /* credits earned with Case 2 */
do i=1 to 6;
if e26521>-4 and e22800=-4 and e23000=-4 then do;
tcred=e26521;
incred=1;
end;
end;
/* YSCH-16200 only applies to school #1. It is an incoming credits question,
and is only used when YSCH-22800 and YSCH-23000 are valid skipped. */
if e16200>-4 and e228001=-4 and e230001=-4 then do;
tcred1=e16200;
end;
/* Case 3: The last data source for credits are from previous rounds.
Begin by matching Round 5 colleges to dli colleges using the schools' pubid.
Note that this is only used when there are no completed terms in Round 5 (and thus no answer to YSCH-22800)
and this school is a dli school (thus no answer to YSCH-26521). */
/* Define r45m13 as the dummy variable that equals one when the 1st college
on the Round4 school roster and 3rd college on the Round5 roster have the same PUBID.
Define r35m14 as the dummy variable that equals one when the 1st college on the Round3
school roster and the 4th college on the Round5 roster have the same PUBID.
The "35" match variables require that R missed the Round 4 interview.
Any college from Round1 is represented in the "first" position in the Round 2
created variables; i.e. ASFRAC1 (Round 2) is a school from Round 1. */
array r45m1 (i) r45m11-r45m16;
array r45m2 (i) r45m21-r45m26;
array r45m3 (i) r45m31-r45m36;
array r45m4 (i) r45m41-r45m46;
array r45m5 (i) r45m51-r45m56;
array r35m1 (i) r35m11-r35m16;
array r35m2 (i) r35m21-r35m26;
array r35m3 (i) r35m31-r35m36;
array r35m4 (i) r35m41-r35m46;
array r35m5 (i) r35m51-r35m56;
array r35m6 (i) r35m61-r35m66;
array r25m1 (i) r25m11-r25m16;
array r25m2 (i) r25m21-r25m26;
array r25m3 (i) r25m31-r25m36;
array r25m4 (i) r25m41-r25m46;
array r25m5 (i) r25m51-r25m56;
array r25m6 (i) r25m61-r25m66;
array r2pub (i) r2pubid1-r2pubid6; /*school pubic id for round 2*/
array r3pub (i) r3pubid1-r3pubid6; /*school pubic id for round 3*/
array r4pub (i) r4pubid1-r4pubid5; /*school pubic id for round 4*/
array r5pub (i) r5pubid1-r5pubid6; /*school pubic id for round 5*/
do i=1 to 6;
r45m1=0; r45m2=0; r45m3=0; r45m4=0; r45m5=0;
r35m1=0; r35m2=0; r35m3=0; r35m4=0; r35m5=0; r35m6=0;
r25m1=0; r25m2=0; r25m3=0; r25m4=0; r25m5=0; r25m6=0;
end;
/* If any PUBID from the 1st position in Round 2/3/4 matches with any PUBID in Round 5 */
do over r5pub;
if r4pubid1>0 and r5pub>0 and r4_int>0 then do;
if r4pubid1=r5pub then do;
r45m1=1;
end;
end;
if r3pubid1>0 and r5pub>0 and r4_int=-5 and r3_int>0 then do;
if r3pubid1=r5pub then do;
r35m1=1;
end;
end;
if r2pubid1>0 and r5pub>0 and r4_int=-5 and r3_int=-5 and r2_int>0 then do;
if r2pubid1=r5pub then do;
r25m1=1;
end;
end;
end;
/* If any PUBID from the 2nd position in Round 2/3/4 matches with any PUBID in Round 5 */
do over r5pub;
if r4pubid2>0 and r5pub>0 and r4_int>0 then do;
if r4pubid2=r5pub then do;
r45m2=1;
end;
end;
if r3pubid2>0 and r5pub>0 and r4_int=-5 and r3_int>0 then do;
if r3pubid2=r5pub then do;
r35m2=1;
end;
end;
if r2pubid2>0 and r5pub>0 and r4_int=-5 and r3_int=-5 and r2_int>0 then do;
if r2pubid2=r5pub then do;
r25m2=1;
end;
end;
end;
/*If any PUBID from the 3rd position in Round 2/3/4 matches with any PUBID in Round 5 */
do over r5pub;
if r4pubid3>0 and r5pub>0 and r4_int>0 then do;
if r4pubid3=r5pub then do;
r45m3=1;
end;
end;
if r3pubid3>0 and r5pub>0 and r4_int=-5 and r3_int>0 then do;
if r3pubid3=r5pub then do;
r35m3=1;
end;
end;
if r2pubid3>0 and r5pub>0 and r4_int=-5 and r3_int=-5 and r2_int>0 then do;
if r2pubid3=r5pub then do;
r25m3=1;
end;
end;
end;
/* If any PUBID from the 4th position in Round 2/3/4 matches with any PUBID in Round 5 */
do over r5pub;
if r4pubid4>0 and r5pub>0 and r4_int>0 then do;
if r4pubid4=r5pub then do;
r45m4=1;
end;
end;
if r3pubid4>0 and r5pub>0 and r4_int=-5 and r3_int>0 then do;
if r3pubid4=r5pub then do;
r35m4=1;
end;
end;
if r2pubid4>0 and r5pub>0 and r4_int=-5 and r3_int=-5 and r2_int>0 then do;
if r2pubid4=r5pub then do;
r25m4=1;
end;
end;
end;
/* If any PUBID from the 5th position in Round 2/3/4 matches with any PUBID in Round 5 */
do over r5pub;
if r4pubid5>0 and r5pub>0 and r4_int>0 then do;
if r4pubid5=r5pub then do;
r45m5=1;
end;
end;
if r3pubid5>0 and r5pub>0 and r4_int=-5 and r3_int>0 then do;
if r3pubid5=r5pub then do;
r35m5=1;
end;
end;
if r2pubid5>0 and r5pub>0 and r4_int=-5 and r3_int=-5 and r2_int>0 then do;
if r2pubid5=r5pub then do;
r25m5=1;
end;
end;
end;
/* If any PUBID from the 6th position in Round 2/3/4 matches with any PUBID in Round 5 */
/* For round 4, we only have public ids for school #1 - #5. */
do over r5pub;
if r3pubid6>0 and r5pub>0 and r4_int=-5 and r3_int>0 then do;
if r3pubid6=r5pub then do;
r35m6=1;
end;
end;
if r2pubid6>0 and r5pub>0 and r4_int=-5 and r3_int=-5 and r2_int>0 then do;
if r2pubid6=r5pub then do;
r25m6=1;
end;
end;
end;
/* Create a dummy that equals one if any of the "match" varaibles
above equal one. This is just a shortcut, so don't have to keep writing
"or match11=1 or match12=1..." to look at people with
identical Round2 and Round3 colleges. */
do i=1 to 6;
if r45m1=1 or r45m2=1 or r45m3=1 or r45m4=1 or r45m5=1 or
r35m1=1 or r35m2=1 or r35m3=1 or r35m4=1 or r35m5=1 or r35m6=1 or
r25m1=1 or r25m2=1 or r25m3=1 or r25m4=1 or r25m5=1 or r25m6=1 then do;
same=1;
end;
end;
/* Calculating the total credits have earned towards BA/Assoc degrees
for previous rounds, that is r2tasct r3tasct r4tasct and r2tbact r3tbact r4tbact */
do i=1 to 5; /* for round 2 */
if r2_asct ge 0 then do;
r2tasct=round(r2_asct*r227388/100,1);
end;
if r2_asct lt 0 then do;
r2tasct=r2_asct;
end;
if r2_bact ge 0 then do;
r2tbact=round(r2_bact*r227388/100, 1);
end;
if r2_bact lt 0 then do;
r2tbact=r2_bact;
end;
end;
do i=1 to 5; /* for round 3 */
if r3_asct ge 0 then do;
r3tasct=round(r3_asct*r327388/100, 1);
end;
if r3_asct lt 0 then do;
r3tasct=r3_asct;
end;
if r3_bact ge 0 then do;
r3tbact=round(r3_bact*r327388/100, 1);
end;
if r3_bact lt 0 then do;
r3tbact=r3_bact;
end;
end;
do i=1 to 4; /* for round 4 */
if r4_asct ge 0 then do;
r4tasct=round(r4_asct*r427388/100, 1);
end;
if r4_asct lt 0 then do;
r4tasct=r4_asct;
end;
if r4_bact ge 0 then do;
r4tbact=round(r4_bact*r427388/100, 1);
end;
if r4_bact lt 0 then do;
r4tbact=r4_bact;
end;
end;
/* Case 3: credits from DLI schools */
array dlicred (i) dlicred1-dlicred6;
do i=1 to 6;
if r2tasct1=>0 and r25m1=1 and e22800=-4 then do;
TCRED=r2tasct1;
dlicred=1;
end;
if r2tbact1=>0 and r25m1=1 and e22800=-4 then do;
TCRED=r2tbact1;
dlicred=1;
end;
if r2tasct2=>0 and r25m2=1 and e22800=-4 then do;
TCRED=r2tasct2;
dlicred=1;
end;
if r2tbact2=>0 and r25m2=1 and e22800=-4 then do;
TCRED=r2tbact2;
dlicred=1;
end;
if r2tasct3=>0 and r25m3=1 and e22800=-4 then do;
TCRED=r2tasct3;
dlicred=1;
end;
if r2tbact3=>0 and r25m3=1 and e22800=-4 then do;
TCRED=r2tbact3;
dlicred=1;
end;
if r2tasct4=>0 and r25m4=1 and e22800=-4 then do;
TCRED=r2tasct4;
dlicred=1;
end;
if r2tbact4=>0 and r25m4=1 and e22800=-4 then do;
TCRED=r2tbact4;
dlicred=1;
end;
if r2tasct5=>0 and r25m5=1 and e22800=-4 then do;
TCRED=r2tasct5;
dlicred=1;
end;
if r2tbact5=>0 and r25m5=1 and e22800=-4 then do;
TCRED=r2tbact5;
dlicred=1;
end;
if r2tasct6=>0 and r25m6=1 and e22800=-4 then do;
TCRED=r2tasct6;
dlicred=1;
end;
if r2tbact6=>0 and r25m6=1 and e22800=-4 then do;
TCRED=r2tbact6;
dlicred=1;
end;
end;
do i=1 to 6;
if r3tasct1=>0 and r35m1=1 and e22800=-4 then do;
TCRED=r3tasct1;
dlicred=1;
end;
if r3tbact1=>0 and r35m1=1 and e22800=-4 then do;
TCRED=r3tbact1;
dlicred=1;
end;
if r3tasct2=>0 and r35m2=1 and e22800=-4 then do;
TCRED=r3tasct2;
dlicred=1;
end;
if r3tbact2=>0 and r35m2=1 and e22800=-4 then do;
TCRED=r3tbact2;
dlicred=1;
end;
if r3tasct3=>0 and r35m3=1 and e22800=-4 then do;
TCRED=r3tasct3;
dlicred=1;
end;
if r3tbact3=>0 and r35m3=1 and e22800=-4 then do;
TCRED=r3tbact3;
dlicred=1;
end;
if r3tasct4=>0 and r35m4=1 and e22800=-4 then do;
TCRED=r3tasct4;
dlicred=1;
end;
if r3tbact4=>0 and r35m4=1 and e22800=-4 then do;
TCRED=r3tbact4;
dlicred=1;
end;
if r3tasct5=>0 and r35m5=1 and e22800=-4 then do;
TCRED=r3tasct5;
dlicred=1;
end;
if r3tbact5=>0 and r35m5=1 and e22800=-4 then do;
TCRED=r3tbact5;
dlicred=1;
end;
if r3tasct6=>0 and r35m6=1 and e22800=-4 then do;
TCRED=r3tasct6;
dlicred=1;
end;
if r3tbact6=>0 and r35m6=1 and e22800=-4 then do;
TCRED=r3tbact6;
dlicred=1;
end;
end;
do i=1 to 6;
if r4tasct1=>0 and r45m1=1 and e22800=-4 then do;
TCRED=r4tasct1;
dlicred=1;
end;
if r4tbact1=>0 and r45m1=1 and e22800=-4 then do;
TCRED=r4tbact1;
dlicred=1;
end;
if r4tasct2=>0 and r45m2=1 and e22800=-4 then do;
TCRED=r4tasct2;
dlicred=1;
end;
if r4tbact2=>0 and r45m2=1 and e22800=-4 then do;
TCRED=r4tbact2;
dlicred=1;
end;
if r4tasct3=>0 and r45m3=1 and e22800=-4 then do;
TCRED=r4tasct3;
dlicred=1;
end;
if r4tbact3=>0 and r45m3=1 and e22800=-4 then do;
TCRED=r4tbact3;
dlicred=1;
end;
if r4tasct4=>0 and r45m4=1 and e22800=-4 then do;
TCRED=r4tasct4;
dlicred=1;
end;
if r4tbact4=>0 and r45m4=1 and e22800=-4 then do;
TCRED=r4tbact4;
dlicred=1;
end;
if r4tasct5=>0 and r45m5=1 and e22800=-4 then do;
TCRED=r4tasct5;
dlicred=1;
end;
if r4tbact5=>0 and r45m5=1 and e22800=-4 then do;
TCRED=r4tbact5;
dlicred=1;
end;
end;
array r5inerr (i) r5inerr1 - r5inerr6 ;
array r5dlierr (i) r5dlierr1 - r5dlierr6;
array indlierr (i) indlierr1 - indlierr6;
/* Check to make sure the 3 methods of collecting credits do not intersect. */
do i=1 to 6;
if r5cred=1 and incred =1 then r5inerr =1;
if r5cred=1 and dlicred=1 then r5dlierr=1;
if incred=1 and dlicred=1 then indlierr=1;
end;
/* Initialize both created variables. */
do i=1 to 6;
asfrac=0;
bafrac=0;
end;
/* Associates Degree */
do i=1 to 6;
if E27337=1 and TCRED=>0 then do;
r5tasc=TCRED;
end;
if -4<E27388<0 and E27337=1 then do;
asfrac=E27388;
end;
if -4<TCRED<0 and E27337=1 then do;
asfrac=TCRED;
end;
if r5tasc=>0 and E27388>0 then do;
asfrac=(r5tasc/E27388)*100;
end;
asfrac=round(asfrac,1);
if e23200=1 and e27337=1 then asfrac=100; /* Respondents who say they have graduated */
end;
/* Bachelors Degree */
do i=1 to 6;
if E27337=3 and TCRED=>0 then do;
r5tbac=TCRED;
end;
if -4<E27388<0 and E27337=3 then do;
bafrac=E27388;
end;
if -4<TCRED<0 and E27337=3 then do;
bafrac=TCRED;
end;
if r5tbac=>0 and E27388>0 then do;
bafrac=(r5tbac/E27388)*100;
end;
bafrac=round(bafrac,1);
if e23200=1 and e27337=3 then bafrac=100; /* Respondents who say they have graduated */
end;
/* Non-interview cases */
do i=1 to 6;
if E16200=-5 then do;
bafrac=-5;
asfrac=-5;
end;
end;
/* invalid data cases */
do i=1 to 6;
if asfrac in (-2,-1) then do;
asfrac=-3;
end;
if bafrac in (-2,-1) then do;
bafrac=-3;
end;
end;
do over E27337;
if E27337=-4 then do;
asfrac=-4;
bafrac=-4;
end;
end;
do over E27337;
if E27337=1 then do;
bafrac=-4;
end;
end;
do over E27337;
if E27337=3 then do;
asfrac=-4;
end;
end;
/* hand edit special cases */
/* need to go through some special cases as below,
1. created variable is larger than 100 ;
2. e27388=0;
3. we have inconsistent information from incoming credits for a new school (case 2) and DLI credits (case 3)
if e27388 (at round 5) is -2 then respondents are assigned -3. */
/* (1) */
if pubid=386 | pubid=976 | pubid=2414 then asfrac1=-3 ;
/* (2) */
if acheck11=1 & e234001>0 then asfrac1=round(100*r5tasc1/(r5tasc1+e234001), 1);
if acheck12=1 & e234002>0 then asfrac2=round(100*r5tasc2/(r5tasc2+e234002), 1);
if bcheck11=1 & e234001>0 then bafrac1=round(100*r5tbac1/(r5tbac1+e234001), 1);
if bcheck12=1 & e234002>0 then bafrac2=round(100*r5tbac2/(r5tbac2+e234002), 1);
/* (3) */
if pubid=2962 then asfrac1=-3;
/* hand edits for observations that asfrac or bafrac ge 100 and they haven't completed any term so we don't have information about e23200 and e23400
(1) two observations credits are from DLI school (hasn't completed any term, thus don't have information on e23400 and e23200). Use the same fraction as at round 4.
(2) two observations credits are from a new school 26521. (hasn't completed any term, thus don't have information on e23400 and e23200) It is a new school, give -3. */
/* (1) */
if pubid=7037 | pubid=8014 then asfrac1=r4_asct1;
/* (2) */
if pubid=7579 then asfrac1=-3;
if pubid=617 then asfrac2=-3;
/* observations that have zero for e23788 are handled as follows:
(1) one observation, the respondent hasn't got the degree (e234501=7), so set the value of CV as 0.
(2) three observations have e234001/1/2 equal to -2, so set their CV to -3.
(3) one observation, both e232002 and e234002 equal 0. set the CV to -3;
(4) three observations, both e233002 and e234002 equal -4, and e265212 equal 0, set their CV to 0; note: do not hand-edit these three, since cv is 0.
(5) one observation, the e234003 equal 60, though e232003 equal 0, we add up e234003 and the credits the observations have earned as the total credits required for the degree, and use it I/O e27388 to calculate the cv. */
/* 1 */ if pubid= 4722 then asfrac1=0;
/* 2 */ if pubid= 5030 | pubid= 6030011 then asfrac1=-3;
if pubid= 3408 then bafrac2=-3;
/* 3 */ if pubid= 2658 then asfrac2=-3;
/* 5 */ if pubid= 4465 then asfrac3=round(100*11/(11+60),1);
/* For observations that (a) we have both incoming credits (e26521) and DLI credits (the school is a DLI school),
and (b) credits from the two source are not consistent, we do as follows,
(1) if round 5 reports e26521>0 and e26521 is larger than DLI credits, we use e26521. (six observations)
(2) if round 5 reports e26521=0 and DLI credit is positive, we use DLI credits. (four observations)
(3) if e26521 ne 0, and e26521 is smaller than DLI credit, we set CV to -3. (four observations) */
/* (1) */
if pubid=7170 then bafrac1=round(100*e265211/e273881, 1);
if pubid=599 then asfrac2=round(100*e265212/e273882, 1);
if pubid=498 then bafrac3=round(100*e265213/e273883, 1);
if pubid=1661 then bafrac3=round(100*e265213/e273883, 1);
if pubid=3754 then bafrac3=round(100*e265213/e273883, 1);
if pubid=4583 then asfrac3=round(100*e265213/e273883, 1);
/* (2) do not need to make changes, since the program uses the DLI credits to overwrite the e26521 credits. */
/* (3) */
if pubid=6079 then asfrac2= -3;
if pubid=2493 then bafrac3= -3;
if pubid=2986 then bafrac3= -3;
if pubid=7689 then bafrac3= -3;
endsas;
Variables Created:
CV_PIAT_STANDARD_SCORE
CV_PIAT_PERCENTILE_SCORE
Variables Used
|
Name in Program |
Question Name on CD |
|
bdate_d, m, y |
KEY!BDATE_D, _M, _Y (round 1) |
|
intdated, m, y |
CV_INTERVIEW_DATE~D, ~M, ~Y |
|
piat_r00 |
PIAT_RAW_SCORE |
This program calculates the respondent's age utilizing the interview date information and the respondent's date of birth information. It then uses the age data and the raw PIAT score to create a standard PIAT score and percentile rank for each respondent.
/*******interview date section: calculate the interview date in continuous months format*******/
if int_d ge 0 and int_m ge 0 then int_cm=((int_y-1990)*12)+int_m;
else if int_y eq -5 then int_cm=-5;
if int_cm=. then do;
put 'PROBLEM: Unexpected value for interview date variable ' pubid= intdated= intdatem= intdatey=;
end;
/****************respondent age section****************/
*ensure all respondents have an in range value;
if bdate_y lt 1980 or bdate_y gt 1984 then do;
put 'PROBLEM: Unexpected value for birthdate year ' pubid= bdate_d= bdate_m= bdate_y=;
end;
/**calculate the youth's age in continuous months**/
if int_cm ne . then do;
age_cmon=((int_y-bdate_y)*12)+(int_m-bdate_m);
if int_d-bdate_d<0 then age_cm=age_cm-1;
end;
if int_cm=-5 then age_cm=-5;
/********************piat standard score section************/
if PIATR00 lt 0 then piat_s00=PIATR00;
else if PIATR00 ge 0 then do;
/* At this point the program loops through each three-month age range and assigns appropriate standard scores based on the respondent's raw score. This code is quite lengthy and is not reproduced here; instead, we include a table that provides the standard score and percentile rank associated with each raw score in each age range. Users who need the precise programming code should contact NLS User Services. */
********************piat percentile rank section************;
if piat_s00 lt 0 then piat_p00=piat_s00;
else if piat_s00 ge 0 then do;
/* At this point the program assigns percentile scores based on the standard scores. These are also shown in the table below. */
endsas;
|
Standard |
Percentile |
Raw Score by Age Range (Years-Months) |
||||||
|
16-9 |
17-0 |
17-3 to 17-5 |
17-6 to 17-8 |
17-9 to 17-11 |
18-0 to 18-2 |
18-3 to 18-5 |
||
|
55 |
0 |
<=28 |
<=28 |
<=29 | <=29 | <=29 | <=29 | <=29 |
|
56 |
0 |
29 |
29 |
30 | 30 | |||
|
57 |
0 |
|
30 |
30 | 30 | 30 | 31 | 31 |
|
58 |
0 |
30 |
31 |
31 | 31 | 31 | 32 | 32 |
|
59 |
0 |
31 |
32 |
32 | 32 | 33 | 33 | 33 |
|
60 |
0 |
32 |
33 |
33 | 33 | 34 | 34 | 34 |
|
61 |
0 |
33 |
34 |
34 | 35 | 36 | 36 | 36 |
|
62 |
1 |
34 |
36 |
36 | 37 | 37 | 37 | 37 |
|
63 |
1 |
36 |
37 |
37 | 38 | 38 | 38 | 38 |
|
64 |
1 |
38 |
38 |
38 | 39 | 39 | 39 | 40 |
|
65 |
1 |
39 |
39 |
40 | 40 | 40 | 40 | 41 |
|
66 |
1 |
40 |
40 |
41 | 41 | 41 | 42 | 42 |
|
67 |
1 |
41 |
41 |
43 | 43 | 43 | 44 | 44 |
|
68 |
2 |
43 |
43 |
44 | 44 | 44 | 45 | 45 |
|
69 |
2 |
44 |
44 |
45 | 45 | 45 | 47 | 47 |
|
70 |
2 |
45 |
45 |
47 | 47 | 48 | 49 | 49 |
|
71 |
3 |
47 |
48 |
49 | 49 | 50 | 50 | 50 |
|
72 |
3 |
49 |
50 |
50 | 50 | 52 | 52 | 52 |
|
73 |
4 |
50 |
52 |
52 | 52 | 53 | 53 | 53 |
|
74 |
4 |
52 |
53 |
53 | 53 | 54 | 54 | 56 |
|
75 |
5 |
53 |
54 |
54 | 56 | 56 | 56 | 58 |
|
76 |
5 |
54 |
56 |
56 | 58 | 58 | 58 | 59 |
|
77 |
6 |
56 |
58 |
58 | 59 | 59 | 59 | 61 |
|
78 |
7 |
58 |
59 |
59 | 61 | 61 | 61 | 62 |
|
79 |
8 |
60 |
61 |
61 | 62 | 62 | 64 | 64 |
|
80 |
9 |
62 |
62 |
62 | 64 | 64 | 66 | 66 |
|
81 |
10 |
64 |
64 |
64 | 66 | 66 | 68 | 68 |
|
82 |
12 |
66 |
66 |
67 | 68 | 68 | 69 | 69 |
|
83 |
13 |
68 |
68 |
69 | 69 | 69 | 70 | 70 |
|
84 |
14 |
69 |
69 |
70 | 70 | 70 | 71 | 71 |
|
85 |
16 |
70 |
70 |
71 | 71 | 71 | 72 | 72 |
|
86 |
18 |
71 |
71 |
72 | 72 | 72 | 74 | 74 |
|
87 |
19 |
72 |
72 |
74 | 74 | 75 | 75 | 75 |
|
88 |
21 |
74 |
74 |
75 | 75 | 76 | 76 | 76 |
|
89 |
23 |
75 |
75 |
76 | 76 | 77 | 77 | 77 |
|
90 |
25 |
76 |
76 |
77 | 77 | 78 | 78 | 78 |
|
91 |
27 |
77 |
77 |
78 | 78 | 79 | 79 | 79 |
|
92 |
30 |
78 |
79 |
79 | 79 | 81 | 81 | 81 |
|
93 |
32 |
79 |
81 |
81 | 81 | 82 | 82 | 82 |
|
94 |
34 |
81 |
82 |
82 | 82 | 83 | 83 | 83 |
|
95 |
37 |
82 |
83 |
83 | 83 | 84 | 84 | 84 |
|
96 |
39 |
83 |
84 |
84 | 84 | 85 | 85 | 86 |
|
97 |
42 |
84 |
85 |
85 | 85 | 86 | 86 | 87 |
|
98 |
45 |
85 |
86 |
86 | 86 | 87 | 87 | 88 |
|
99 |
47 |
86 |
87 |
87 | 87 | 88 | 88 | |
|
100 |
50 |
87 |
88 |
88 | 88 | 89 | ||
|
101 |
53 |
88 |
|
89 | 89 | 90 | ||
|
102 |
55 |
|
89 |
89 | 89 | 90 | 90 | |
|
103 |
58 |
89 |
90 |
90 | 91 | |||
|
104 |
61 |
|
|
91 | 91 | 91 | 92 | |
|
105 |
63 |
91 |
91 |
91 | 92 | 92 | 92 | |
|
106 |
66 |
92 |
92 |
92 | 93 | |||
|
107 |
68 |
|
|
93 | 93 | 93 | ||
|
108 |
70 |
93 |
93 |
93 | 94 | 94 | ||
|
109 |
73 |
|
|
94 | 94 | 94 | ||
|
110 |
75 |
94 |
94 |
|||||
|
111 |
77 |
|
|
|||||
|
112 |
79 |
|
|
95 | 95 | 95 | 95 | 95 |
|
113 |
81 |
95 |
95 |
|||||
|
114 |
82 |
|
|
96 | 96 | 96 | 96 | |
|
115 |
84 |
|
96 |
96 | ||||
|
116 |
86 |
96 |
|
97 | ||||
|
117 |
87 |
|
|
97 | 97 | 97 | 97 | |
|
118 |
88 |
97 |
97 |
|||||
|
119 |
90 |
|
|
98 | 98 | 98 | ||
|
120 |
91 |
|
98 |
98 | 98 | |||
|
121 |
92 |
98 |
|
|||||
|
122 |
93 |
|
|
|||||
|
123 |
94 |
|
|
|||||
|
124 |
95 |
|
|
|||||
|
125 |
95 |
|
|
|||||
|
126 |
96 |
|
|
|||||
|
127 |
96 |
|
|
|||||
|
128 |
97 |
|
|
|||||
|
129 |
97 |
|
|
99 | 99 | |||
|
130 |
98 |
99 |
99 |
99 | 99 | 99 | ||
|
131 |
98 |
|
|
|||||
|
132 |
98 |
|
|
|||||
|
133 |
99 |
|
|
|||||
|
134 |
99 |
|
|
|||||
|
135 |
99 |
|
|
|||||
|
136 |
99 |
|
|
|||||
|
137 |
99 |
|
|
|||||
|
138 |
99 |
|
|
|||||
|
139 |
100 |
|
|
100 | 100 | 100 | 100 | 100 |
|
140 |
100 |
100 |
100 |
|||||
|
141 |
100 |
|
|
|||||
|
142 |
100 |
|
|
|||||
Note: This table of PIAT scores is based on the information provided by the testing company. Users interested in more information about the PIAT-Math Assessment may wish to consult the following reference:
Markwardt, Frederick C. Jr. Peabody Individual Achievement Test-Revised. Circle Pines, Minn.: American Guidance Service, Inc., 1989.
Variables Created:
CV_SCHOOL_SIZE
CV_STUDENT_TEACHER_RATIO
Variables Used
|
Name in Program |
Question Name on CD |
| NORCID | NORCID_2001 |
| AGE | SYMBOL_KEY_AGE_2001 |
| RACE | SYMBOL_KEY_RACE_2001 |
| SEX | SYMBOL_KEY_SEX_2001 |
| CENSUS | CV_CENSUS_REGION |
| e2857 | YSCH_2857_2001 |
| e21625 | YSCH_21625_2001 |
| pin1 | NEWSCHOOL_ID_01_2001 |
| pin2 | NEWSCHOOL_ID_02_2001 |
| pin3 | NEWSCHOOL_ID_03_2001 |
| pin4 | NEWSCHOOL_ID_04_2001 |
| pin5 | NEWSCHOOL_ID_05_2001 |
| pin6 | NEWSCHOOL_ID_06_2001 |
| STARTM11 | NEWSCHOOL_START1_01_M_2001 |
| STARTY11 | NEWSCHOOL_START1_01_Y_2001 |
| STARTM21 | NEWSCHOOL_START1_02_M_2001 |
| STARTY21 | NEWSCHOOL_START1_02_Y_2001 |
| STARTM31 | NEWSCHOOL_START1_03_M_2001 |
| STARTY31 | NEWSCHOOL_START1_03_Y_2001 |
| STARTM41 | NEWSCHOOL_START1_04_M_2001 |
| STARTY41 | NEWSCHOOL_START1_04_Y_2001 |
| STARTM51 | NEWSCHOOL_START1_05_M_2001 |
| STARTY51 | NEWSCHOOL_START1_05_Y_2001 |
| STARTM61 | NEWSCHOOL_START1_06_M_2001 |
| STARTY61 | NEWSCHOOL_START1_06_Y_2001 |
| STARTM12 | NEWSCHOOL_START2_01_M_2001 |
| STARTY12 | NEWSCHOOL_START2_01_Y_2001 |
| STARTM22 | NEWSCHOOL_START2_02_M_2001 |
| STARTY22 | NEWSCHOOL_START2_02_Y_2001 |
| STARTM32 | NEWSCHOOL_START2_03_M_2001 |
| STARTY32 | NEWSCHOOL_START2_03_Y_2001 |
| STARTM13 | NEWSCHOOL_START3_01_M_2001 |
| STARTY13 | NEWSCHOOL_START3_01_Y_2001 |
| STOPM11 | NEWSCHOOL_STOP1_01_M_2001 |
| STOPY11 | NEWSCHOOL_STOP1_01_Y_2001 |
| STOPM21 | NEWSCHOOL_STOP1_02_M_2001 |
| STOPY21 | NEWSCHOOL_STOP1_02_Y_2001 |
| STOPM31 | NEWSCHOOL_STOP1_03_M_2001 |
| STOPY31 | NEWSCHOOL_STOP1_03_Y_2001 |
| STOPM41 | NEWSCHOOL_STOP1_04_M_2001 |
| STOPY41 | NEWSCHOOL_STOP1_04_Y_2001 |
| STOPM51 | NEWSCHOOL_STOP1_05_M_2001 |
| STOPY51 | NEWSCHOOL_STOP1_05_Y_2001 |
| STOPM61 | NEWSCHOOL_STOP1_06_M_2001 |
| STOPY61 | NEWSCHOOL_STOP1_06_Y_2001 |
| STOPM12 | NEWSCHOOL_STOP2_01_M_2001 |
| STOPY12 | NEWSCHOOL_STOP2_01_Y_2001 |
| STOPM22 | NEWSCHOOL_STOP2_02_M_2001 |
| STOPY22 | NEWSCHOOL_STOP2_02_Y_2001 |
| STOPM32 | NEWSCHOOL_STOP2_03_M_2001 |
| STOPY32 | NEWSCHOOL_STOP2_03_Y_2001 |
| STOPM13 | NEWSCHOOL_STOP3_01_M_2001 |
| STOPY13 | NEWSCHOOL_STOP3_01_Y_2001 |
| type1 | NEWSCHOOL_SCHCODE_01_2001 |
| type2 | NEWSCHOOL_SCHCODE_02_2001 |
| type3 | NEWSCHOOL_SCHCODE_03_2001 |
| type4 | NEWSCHOOL_SCHCODE_04_2001 |
| type5 | NEWSCHOOL_SCHCODE_05_2001 |
| type6 | NEWSCHOOL_SCHCODE_06_2001 |
Codes for Created Variable
|
School Size |
Student-teacher ratio |
|
1
= <100 |
1
= <14 |
This program merges school identification information from the NLSY97 data with data from the "National Education Database," provided under copyright by Quality Education Data (QED), Inc. It then creates two variables that provide information about the respondent's most recent K-12 school.
/* Before creating the QED variables, survey staff used dates of enrollment data to identify the respondent's current or most recent school and then merged that information with the QED data. The process for identifying the most recent school is the same as that used in the creation of the CV_SCHOOL_TYPE variable, which appears earlier in this section. This information is excluded here due to length and confidentiality restrictions. Researchers needing more information about this process should contact NLS User Services. */
if E21625=999 then E21625=9;
SCHSIZE=-4;
STUDTEAC=-4;
/* Now, create SCHSIZE and STUDTEAC while checking that the grade reported in the QED coincides with that being reported in the NLSY97 */
if GRADSPAN='"2"' then GRADSPAN='"3"';
if GRADSPAN='"A"' then GRADSPAN='"9"';
if GRADSPAN='"B"' or GRADSPAN='"C"' or GRADSPAN='"D"' or GRADSPAN='"E"' or GRADSPAN='"*"' then do;
flag2=gradspan;
GRADSPAN='"0"';
end;
/* Redefine each GRADSPAN to GRADSPN to eliminate character value problems */
if GRADSPAN='"0"' then GRADSPN=0;
if GRADSPAN='"1"' then GRADSPN=1;
if GRADSPAN='"2"' then GRADSPN=2;
if GRADSPAN='"3"' then GRADSPN=3;
if GRADSPAN='"4"' then GRADSPN=4;
if GRADSPAN='"5"' then GRADSPN=5;
if GRADSPAN='"6"' then GRADSPN=6;
if GRADSPAN='"7"' then GRADSPN=7;
if GRADSPAN='"8"' then GRADSPN=8;
if GRADSPAN='"9"' then GRADSPN=9;
/* For respondents with E2857>12 but have a matching PIN number we will use the school with the matching pin instead of the college. Even though the college is the most recent school in these cases, the QED c.v.'s refer to the most recent high school (or middle, elementary, etc.). */
if e2857>12 and pin>100 and typesch=3 then do;
e2857=12;
hgaflag=1;
end;
dummy1=0;
dummy4=0;
dummy5=0;
dummy6=0;
dummy7=0;
dummy8=0;
dummy9=0;
dummy10=0;
if E2857 ge 1 and E2857 le 3 then do;
dummy1=1;
dummy4=1;
dummy5=1;
dummy6=0;
dummy7=0;
dummy8=0;
dummy9=0;
dummy10=0;
end;
if E2857 ge 4 and E2857 le 6 then do;
dummy1=1;
dummy4=1;
dummy5=1;
dummy6=1;
dummy7=0;
dummy8=0;
dummy9=0;
dummy10=0;
end;
if E2857 ge 7 and E2857 le 8 then do;
dummy1=1;
dummy4=0;
dummy5=1;
dummy6=1;
dummy7=1;
dummy8=1;
dummy9=0;
dummy10=0;
end;
if E2857 eq 9 then do;
dummy1=1;
dummy4=0;
dummy5=0;
dummy6=0;
dummy7=1;
dummy8=1;
dummy9=1;
dummy10=0;
end;
if E2857 ge 10 and E2857 le 12 then do;
dummy1=1;
dummy4=0;
dummy5=0;
dummy6=0;
dummy7=0;
dummy8=1;
dummy9=1;
dummy10=1;
end;
correct=0;
if GRADSPN=1 and dummy1=1 then correct=1;
if GRADSPN=4 and dummy4=1 then correct=1;
if GRADSPN=5 and dummy5=1 then correct=1;
if GRADSPN=6 and dummy6=1 then correct=1;
if GRADSPN=7 and dummy7=1 then correct=1;
if GRADSPN=8 and dummy8=1 then correct=1;
if GRADSPN=9 and dummy9=1 then correct=1;
if GRADSPN=2 and dummy10=1 then correct=1;
typeck=0;
if type1=1 or type2=1 or type3=1 or type4=1 or type5=1 or type6=1 or
type1=2 or type2=2 or type3=2 or type4=2 or type5=2 or type6=2 or
type1=3 or type2=3 or type3=3 or type4=3 or type5=3 or type6=3 then do;
typeck=1;
end;
/* If the grades reported in the QED and the NLSY97 do not coincide, we make both created variables equal to -3; otherwise, we proceed to create them according to the definition provided at the top of the program */
if STUDRANG=0 or STUDRANG=1 then SCHSIZE=1;
if STUDRANG=2 then SCHSIZE=2;
if STUDRANG=3 then SCHSIZE=3;
if STUDRANG=4 then SCHSIZE=4;
if STUDRANG=5 then SCHSIZE=5;
if STUDRANG=6 or STUDRANG=7 then SCHSIZE=6;
if STUDRANG=. then SCHSIZE=-3;
if NOSTUD gt 0 and NOTEACH gt 0 then STUDTEA1=NOSTUD/NOTEACH;
if STUDTEA1 lt 14 then STUDTEAC=1;
if STUDTEA1 ge 14 and STUDTEA1 lt 18 then STUDTEAC=2;
if STUDTEA1 ge 18 and STUDTEA1 lt 22 then STUDTEAC=3;
if STUDTEA1 ge 22 then STUDTEAC=4;
if STUDTEA1 eq . then STUDTEAC=-3;
if correct=0 then SCHSIZE=-3;
if correct=0 then STUDTEAC=-3;
if e2857=-5 then schsize=-5;
if e2857=-5 then studteac=-5;
/* We also make sure that there are not five or less schools in each cell determined by the region/census, type of school, control, school size and the student-teacher ratio to avoid any possibilities of identifying the schools. We first run the tabulations, then assign -3 to the created
variables for schools that fall in cells of five or less schools. */
INDEX=CENSUS||TYPESCH||E21625||SCHSIZE|| STUDTEAC;
proc freq;
tables CENSUS*TYPESCH*E21625*SCHSIZE* STUDTEAC / OUT=A;
proc freq data=A noprint;
tables COUNT;
data A;
set A;
INDEX=CENSUS||TYPESCH||E21625||SCHSIZE|| STUDTEAC;
if COUNT le 5 then SCHSIZE=-3;
if COUNT le 5 then STUDTEAC=-3;
if e2857=-5 then do;
studteac=-5; schsize=-5;
end;
endsas;
Variables Created:
CV_TRN_CERT
CV_TRN_CERT_DATE~M, ~Y
Variables Used
|
Name in Program |
Question Name on CD |
| PUBID | PUBID_1997 |
| trncmo97 | CV_TRN_CERT_DATE_M_1997 |
| trncy97 | CV_TRN_CERT_DATE_Y_1997 |
| trncrt97 | CV_TRN_CERT_1997 |
| trncmo98 | CV_TRN_CERT_DATE_M_1998 |
| trncy98 | CV_TRN_CERT_DATE_Y_1998 |
| trncrt98 | CV_TRN_CERT_1998 |
| trncmo99 | CV_TRN_CERT_DATE_M_1999 |
| trncy99 | CV_TRN_CERT_DATE_Y_1999 |
| trncrt99 | CV_TRN_CERT_1999 |
| trncmo00 | CV_TRN_CERT_DATE_M_2000 |
| trncy00 | CV_TRN_CERT_DATE_Y_2000 |
| trncrt00 | CV_TRN_CERT_2000 |
| t6400m1 | YTRN_640_01_M_2001 |
| t6400y1 | YTRN_640_01_Y_2001 |
| t6400m2 | YTRN_640_02_M_2001 |
| t6400y2 | YTRN_640_02_Y_2001 |
| t1500m1 | YTRN_1500_01_M_2001 |
| t1500y1 | YTRN_1500_01_Y_2001 |
| t1500m2 | YTRN_1500_02_M_2001 |
| t1500y2 | YTRN_1500_02_Y_2001 |
| t1500m3 | YTRN_1500_03_M_2001 |
| t1500y3 | YTRN_1500_03_Y_2001 |
| t1500m4 | YTRN_1500_04_M_2001 |
| t1500y4 | YTRN_1500_04_Y_2001 |
| t1500m5 | YTRN_1500_05_M_2001 |
| t1500y5 | YTRN_1500_05_Y_2001 |
| t69001 | YTRN_6900_01_2001 |
| t69002 | YTRN_6900_02_2001 |
| t69003 | YTRN_6900_03_2001 |
| t69004 | YTRN_6900_04_2001 |
| t69005 | YTRN_6900_05_2001 |
| t70001 | YTRN_7000_01_2001 |
| t70002 | YTRN_7000_02_2001 |
| t70003 | YTRN_7000_03_2001 |
| t70004 | YTRN_7000_04_2001 |
Codes for Created Variable
|
Ever Received Vocational/Completion Certificate or State License (TRNCERT) |
|
0
Condition Does Not Apply (no)--R took a training, but didn't earn
cert. |
This program creates a variable that reports whether the respondent has ever received a certificate or license other than a GED through a training program. If so, a pair of variables provide the month and year that the most recent certificate or license was obtained.
/*Initialize variables*/
TRNCERT=.; /*Ever received vocational/completion certificate or state license*/
TRNCMTH=.; /*Month of most recent certificate/license--based on date of completion
of most recent cert/lic granting training program*/
TRNCYR=.; /*Year of most recent certificate/license--based on date of completion
of most recent cert/lic granting training program*/
reccert=0; /* a counting variable for use in programming to check do loops*/
/*Defining arrays*/
array t69000{5} t69001 - t69005;
array t70000{5} t70001 - t70005;
array t1500m{5} t1500m1 - t1500m5;
array t1500y{5} t1500y1 - t1500y5;
array t6400m{5} t6400m1 - t6400m5;
array t6400y{5} t6400y1 - t6400y5;
array trncrt{4} trncrt97 - trncrt99 trncrt00;
array trncmo{4} trncmo97 - trncmo99 trncmo00;
array trncy{4} trncy97 - trncy99 trncy00;
do i=1 to 5;
if reccert=0 and t69000{i}=1 and 1<=t70000{i}<=3 and t6400y{i}>1 then do;
TRNCERT=1;
TRNCYR=t6400y{i};
TRNCMTH=t6400m{i};
reccert=1;
end;
if reccert=0 and t69000{i}=1 and 1<=t70000{i}<=3 and t1500y{i}>1 then do;
TRNCERT=1;
TRNCYR=t1500y{i};
TRNCMTH=t1500m{i};
reccert=1;
end;
if reccert>=1 and t69000{i}=1 and 1<=t70000{i}<=3 and t1500y{i}=TRNCYR and
t1500m{i}>TRNCMTH then do;
TRNCMTH=t1500m{i};
reccert=reccert+1;
end;
if reccert>=1 and t69000{i}=1 and 1<=t70000{i}<=3 and t6400y{i}=TRNCYR and
t6400m{i}>TRNCMTH then do;
TRNCMTH=t6400m{i};
reccert=reccert+1;
end;
if reccert>=1 and t69000{i}=1 and 1<=t70000{i}<=3 and t1500y{i}>TRNCYR then do;
TRNCYR=t1500y{i};
TRNCMTH=t1500m{i};
reccert=reccert+1;
end;
if reccert>=1 and t69000{i}=1 and 1<=t70000{i}<=3 and t6400y{i}>TRNCYR then do;
TRNCYR=t6400y{i};
TRNCMTH=t6400m{i};
reccert=reccert+1;
end;
if TRNCERT^=1 then do;
if t69000{i}=0 then TRNCERT=0;
if t69000{i}=1 and t70000{i}>3 then TRNCERT=0;
if t69000{i}=1 and t70000{i}<1 then TRNCERT=0;
end;
end;
/*code non-interviews*/
if t69001=-5 then do;
TRNCERT=-5;
TRNCYR=-5;
TRNCMTH=-5;
end;
/*This part compares values for current round to created vars for previous round(s) to obtain the most recent date of cert/lic receipt*/
do i=1 to 4;
if trncert=. and trncrt{i}=1 then do;
TRNCERT=TRNCRT{i};
TRNCYR=TRNCY{i};
TRNCMTH=TRNCMO{i};
end;
if trncert=0 and trncrt{i}=1 then do;
TRNCERT=TRNCRT{i};
TRNCYR=TRNCY{i};
TRNCMTH=TRNCMO{i};
end;
if TRNCERT=1 and TRNCRT{i}=1 and TRNCY{i}>TRNCYR then do;
TRNCYR=TRNCY{i};
TRNCMTH=TRNCMO{i};
end;
if TRNCERT=1 and TRNCRT{i}=1 and TRNCY{i}=TRNCYR and TRNCMO{i}>TRNCMTH then do;
TRNCMTH=TRNCMO{i};
end;
if TRNCERT=. and TRNCRT{i}=0 then do;
TRNCERT=TRNCRT{i};
TRNCYR=TRNCY{i};
TRNCMTH=TRNCMO{i};
end;
end;
if TRNCYR=-2 or TRNCYR=-1 then TRNCYR=-3;
if TRNCMTH=-2 or TRNCMTH=-1 then TRNCMTH=-3;
if TRNCERT=. and t69001=-4 then TRNCERT=-4;
if TRNCERT=. and t69001=-5 then TRNCERT=-5;
if TRNCERT=. and t69001=-2 then TRNCERT=-3;
if TRNCERT=. and t69001=-1 then TRNCERT=-3;
if TRNCERT=. and t69001=-3 then TRNCERT=-3;
if TRNCERT=. then TRNCERT=0;
if TRNCERT=1 and TRNCMTH<1 then TRNCMTH=-3;
if TRNCERT=1 and TRNCYR<1 then TRNCYR=-3;
/*if R received training cert but there is no date, then date variables = invalid skip*/
if TRNCERT=0 then TRNCMTH=-4;
if TRNCERT=0 then TRNCYR=-4;
/*if R took training but did not receive training cert then the date variables= valid skip */
if TRNCERT=-3 then TRNCMTH=-3;
if TRNCERT=-3 then TRNCYR=-3;
if TRNCERT=-4 then TRNCMTH=-4;
if TRNCERT=-4 then TRNCYR=-4;
if TRNCERT=-5 then TRNCMTH=-5;
if TRNCERT=-5 then TRNCYR=-5;
endsas;