Appendix 1: Education Variable Creation

Return to Table of Contents


Enrollment Status, Highest Grade Completed, and Highest Degree Received

Variables Created:

Variables Used

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

Round 1   Round 7     Round 7 (con't)  
intd_r1 YINF-900_D   e3103 YSCH-3103   e234503 YSCH-23450.03
intm_r1 YINF-900_M   e3104 YSCH-3104   t70001 YTRN-7000.01
inty_r1 YINF-900_Y   e2806 YSCH-2806   t70002 YTRN-7000.02
e3500_r1 YSCH-3500   e2857 YSCH-2857   t70003 YTRN-7000.03
e5000_r1 YSCH-5000   e2908 YSCH-2908   t70004 YTRN-7000.04
e11700_r1 YSCH-11700   e3010 YSCH-3010   t70005 YTRN-7000.05
e26700_r1 YSCH-26700   e3061 YSCH-3061   t70006 YTRN-7000.06
e28200_r1 YSCH-28200   e3112 YSCH-3112   t70007 YTRN-7000.07
t70001_r1 YTRN-7000.01   e3877 YSCH-3877   PUBID PUBID
t70002_r1 YTRN-7000.02   e3877B YSCH-3877B   intd SYMBOL!CURDATE~D
t70003_r1 YTRN-7000.03   e3878 YSCH-3878   intm SYMBOL!CURDATE~M
encat_r1 CV_ENROLLSTAT   e4793 YSCH-4793   inty SYMBOL!CURDATE~Y
GRSURV_r1 CV_HGC_EVER   e4795 YSCH-4795      
DEGSURV_r1 CV_HIGHEST_DEGREE_EVER   e1605 YSCH-1605   Round 7 roster data
      e16151 YSCH-1615.01   scode1 NEWSCHOOL_SCHCODE.01
Round 2     e16152 YSCH-1615.02   scode2 NEWSCHOOL_SCHCODE.02
e2857_r2 YSCH-2857   e16241 YSCH-1624.01   scode3 NEWSCHOOL_SCHCODE.03
e3112_r2 YSCH-3112   e16271 YSCH-1627.01   scode4 NEWSCHOOL_SCHCODE.04
e3878_r2 YSCH-3878   e4951 YSCH-4951   scode5 NEWSCHOOL_SCHCODE.05
e11700_r2 YSCH-11700   e54581 YSCH-5458.01      
t70001_r2 YTRN-7000.01   e54582 YSCH-5458.02   strt11m NEWSCHOOL_START1.01~M
t70002_r2 YTRN-7000.02   e54583 YSCH-5458.03   strt11y NEWSCHOOL_START1.01~Y
intd_r2 SYMBOL!CURDATE~D   e54584 YSCH-5458.04   strt12m NEWSCHOOL_START1.02~M
intm_r2 SYMBOL!CURDATE~M   e67841 YSCH-6784.01   strt12y NEWSCHOOL_START1.02~Y
inty_r2 SYMBOL!CURDATE~Y   e67842 YSCH-6784.02   strt13m NEWSCHOOL_START1.03~M
encat_r2 CV_ENROLLSTAT   e67843 YSCH-6784.03   strt13y NEWSCHOOL_START1.03~Y
GRSURV_r2 CV_HGC_EVER   e67844 YSCH-6784.04   strt14m NEWSCHOOL_START1.04~M
GRJUNE_r2 CV_HGC_YR   e69381 YSCH-6938.01   strt14y NEWSCHOOL_START1.04~Y
DEGSURV_r2 CV_HIGHEST_DEGREE_EVER   e69382 YSCH-6938.02   strt15m NEWSCHOOL_START1.05~M
DEGJUNE_r2 CV_HIGHEST_DEGREE_YR   e69383 YSCH-6938.03   strt15y NEWSCHOOL_START1.05~Y
      e694311 YSCH-6943.01.01   strt21m NEWSCHOOL_START2.01~M
Round 3     e694312 YSCH-6943.01.02   strt21y NEWSCHOOL_START2.01~Y
e2857_r3 YSCH-2857   e694321 YSCH-6943.02.01   strt22m NEWSCHOOL_START2.02~M
e3112_r3 YSCH-3112   e714211 YSCH-7142.01.01   strt22y NEWSCHOOL_START2.02~Y
e3878_r3 YSCH-3878   e714212 YSCH-7142.01.02   strt31m NEWSCHOOL_START3.01~M
e11700_r3 YSCH-11700   e714221 YSCH-7142.02.01   strt31y NEWSCHOOL_START3.01~Y
t70001_r3 YTRN-7000.01   e714241 YSCH-7142.04.01      
t70002_r3 YTRN-7000.02   e71921 YSCH-7192.01   stop11m NEWSCHOOL_STOP1.01~M
t70003_r3 YTRN-7000.03   e71922 YSCH-7192.02   stop11y NEWSCHOOL_STOP1.01~Y
t70004_r3 YTRN-7000.04   e71923 YSCH-7192.03   stop12m NEWSCHOOL_STOP1.02~M
intd_r3 SYMBOL!CURDATE~D   e71924 YSCH-7192.04   stop12y NEWSCHOOL_STOP1.02~Y
intm_r3 SYMBOL!CURDATE~M   e841611 YSCH-8416.01.01   stop13m NEWSCHOOL_STOP1.03~M
inty_r3 SYMBOL!CURDATE~Y   e841612 YSCH-8416.01.02   stop13y NEWSCHOOL_STOP1.03~Y
encat_r3 CV_ENROLLSTAT   e841621 YSCH-8416.02.01   stop14m NEWSCHOOL_STOP1.04~M
GRSURV_r3 CV_HGC_EVER   e841622 YSCH-8416.02.02   stop14y NEWSCHOOL_STOP1.04~Y
GRJUNE_r3 CV_HGC_YR   e841631 YSCH-8416.03.01   stop15m NEWSCHOOL_STOP1.05~M
DEGSURV_r3 CV_HIGHEST_DEGREE_EVER   e913111 YSCH-9131.01.01   stop15y NEWSCHOOL_STOP1.05~Y
DEGJUNE_r3 CV_HIGHEST_DEGREE_YR   e913112 YSCH-9131.01.02   stop21m NEWSCHOOL_STOP2.01~M
      e913121 YSCH-9131.02.01   stop21y NEWSCHOOL_STOP2.01~Y
Round 4     e913122 YSCH-9131.02.02   stop22m NEWSCHOOL_STOP2.02~M
e2857_r4 YSCH-2857   e913131 YSCH-9131.03.01   stop22y NEWSCHOOL_STOP2.02~Y
e3112_r4 YSCH-3112   e933511m YSCH-9335.01.01~M   stop31m NEWSCHOOL_STOP3.01~M
e3878_r4 YSCH-3878   e933511y YSCH-9335.01.01~Y   stop31y NEWSCHOOL_STOP3.01~Y
e11700_r4 YSCH-11700   e933512m YSCH-9335.01.02~M      
t70001_r4 YTRN-7000.01   e933512y YSCH-9335.01.02~Y      
t70002_r4 YTRN-7000.02   e933521m YSCH-9335.02.01~M      
t70003_r4 YTRN-7000.03   e933521y YSCH-9335.02.01~Y      
t70004_r4 YTRN-7000.04   e933522m YSCH-9335.02.02~M      
intd_r4 SYMBOL!CURDATE~D   e933522y YSCH-9335.02.02~Y      
intm_r4 SYMBOL!CURDATE~M   e933531m YSCH-9335.03.01~M      
inty_r4 SYMBOL!CURDATE~Y   e933531y YSCH-9335.03.01~Y      
encat_r4 CV_ENROLLSTAT   e938511 YSCH-9385.01.01      
GRSURV_r4 CV_HGC_EVER   e938512 YSCH-9385.01.02      
GRJUNE_r4 CV_HGC_YR   e938521 YSCH-9385.02.01      
DEGSURV_r4 CV_HIGHEST_DEGREE_EVER   e938522 YSCH-9385.02.02      
DEGJUNE_r4 CV_HIGHEST_DEGREE_YR   e938531 YSCH-9385.03.01      
      e9589111 YSCH-9589.01.01.01      
Round 5     e9589112 YSCH-9589.01.01.02      
e2857_r5 YSCH-2857   e9589113 YSCH-9589.01.01.03      
e3112_r5 YSCH-3112   e9589114 YSCH-9589.01.01.04      
e3878_r5 YSCH-3878   e9589211 YSCH-9589.02.01.01      
e11700_r5 YSCH-11700   e9589212 YSCH-9589.02.01.02      
t70001_r5 YTRN-7000.01   e9589213 YSCH-9589.02.01.03      
t70002_r5 YTRN-7000.02   e9946111 YSCH-9946.01.01.01      
t70003_r5 YTRN-7000.03   e9946112 YSCH-9946.01.01.02      
t70004_r5 YTRN-7000.04   e9946113 YSCH-9946.01.01.03      
intd_r5 SYMBOL!CURDATE~D   e9946114 YSCH-9946.01.01.04      
intm_r5 SYMBOL!CURDATE~M   e9946211 YSCH-9946.02.01.01      
inty_r5 SYMBOL!CURDATE~Y   e9946212 YSCH-9946.02.01.02      
encat_r5 CV_ENROLLSTAT   e9946213 YSCH-9946.02.01.03      
GRSURV_r5 CV_HGC_EVER   e10099111m YSCH-10099.01.01.01~M      
GRJUNE_r5 CV_HGC_YR   e10099111y YSCH-10099.01.01.01~Y      
DEGSURV_r5 CV_HIGHEST_DEGREE_EVER   e10099112m YSCH-10099.01.01.02~M      
DEGJUNE_r5 CV_HIGHEST_DEGREE_YR   e10099112y YSCH-10099.01.01.02~Y      
      e10099113m YSCH-10099.01.01.03~M      
Round 6   e10099113y YSCH-10099.01.01.03~Y      
e2857_r6 YSCH-2857   e10099114m YSCH-10099.01.01.04~M      
e3112_r6 YSCH-3112   e10099114y YSCH-10099.01.01.04~Y      
e3878_r6 YSCH-3878   e10099211m YSCH-10099.02.01.01~M      
e11700_r6 YSCH-11700   e10099211y YSCH-10099.02.01.01~Y      
t70001_r6 YTRN-7000.01   e10099212m YSCH-10099.02.01.02~M      
t70002_r6 YTRN-7000.02   e10099212y YSCH-10099.02.01.02~Y      
t70003_r6 YTRN-7000.03   e10099213m YSCH-10099.02.01.03~M      
t70004_r6 YTRN-7000.04   e10099213y YSCH-10099.02.01.03~Y      
t70005_r6 YTRN-7000.05   e11700 YSCH-11700      
intd_r6 SYMBOL!CURDATE~D   e13300 YSCH-13300      
intm_r6 SYMBOL!CURDATE~M   e273371 YSCH-27337.01      
inty_r6 SYMBOL!CURDATE~Y   e273372 YSCH-27337.02      
encat_r6 CV_ENROLLSTAT   e273373 YSCH-27337.03      
GRSURV_r6 CV_HGC_EVER   e273374 YSCH-27337.04      
GRJUNE_r6 CV_HGC_YR   e273375 YSCH-27337.05      
DEGSURV_r6 CV_HIGHEST_DEGREE_EVER   e234501 YSCH-23450.01      
DEGJUNE_r6 CV_HIGHEST_DEGREE_YR   e234502 YSCH-23450.02      

Codes for Created Variables

Enrollment Status (CV_ENROLLSTAT

1. not enrolled, no high school degree, no GED
2. not enrolled, GED, but no high school degree
3. not enrolled, a high school degree, no GED
4. not enrolled, some college
5. not enrolled, 2 year college graduate
6. not enrolled, 4 year college graduate

7. not enrolled, graduate degree
8. enrolled in grades 1-12
9. enrolled in a 2 year college
10. enrolled in a 4 year program
11. enrolled in a graduate program

 

Highest Grade Completed (CV_HGC_EVER, CV_HGC_YR)

0.  none
1.  first
2.  second
3.  third
4.  fourth
5.  fifth

6.  sixth
7.  seventh
8.  eighth
9.  ninth
10. tenth
11. eleventh

12. twelfth
13. first year college
14. second year college
15. third year college
16. fourth year college

17. fifth year college
18. sixth year college
19. seventh year college
20. eighth year college
95. ungraded                

 

Highest Degree Received (CV_HIGHEST_DEGREE_EVER, CV_HIGHEST_DEGREE_YR)

0. none
1. GED
2. high school diploma
3. junior college or 2-year associate degree

4. bachelor's degree (B.A., B.S., or unspecified)
5. master's degree
6. doctoral degree
7. professional degree (M.D., L.L.D., D.D.S., J.D.)

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 7 interview date and as of June 30, 2003.  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.


** Initialize and define variables;


ENROLL=-3; * 1-0: Indicates whether a Respondent is currently enrolled;
ENCAT=-3; * 1 to 11: Current enrollment status variable (including educational attainment);
HSD=0; * 1-0: Indicates whether a Respondent has a H.S. Diploma;
GED=0; * 1-0: Indicates whether a Respondent has a GED;
hgsch=0; * 1-0: Indicates whether a Respondent is currently attending grades 1-12 & no HSD or GED;
college=0; * 1-0: Indicates whether a Respondent is in college and working towards an undergraduate (=1) or a graduate degree (=2);
flagcoll=0; * 1-0: Indicates whether a Respondent is currently attending grades 1-12, no HSD or GED but enrolled in college and working towards a graduate or undergraduate degree;
flaghs=0; * 1-0: Indicates whether a Respondent who has a H.S. Diploma and HGC=12 reports enrollment in high school;
flagloop=0; * 1-0: Indicates whether a Respondent is going through old school re-enrollment loop twice;
somecoll=0; * 1-0: Indicates whether a Respondent reports current or past enrollment in a degree program at a college in the current or previous rounds;
prevcoll=0; * 1-0: Indicates whether a Respondent reports current or past enrollment in a degree program at a college in a previous round.;
currcoll=0; * 1-0: Indicates whether a Respondent reports current or past enrollment in a degree program at a college in the current round.;
clg_ok=-4; * 1-0: Indicates whether a Respondent who reports current or past enrollment in a degree program at a college in this round w/o GED/HSD is actually enrolled in a degree program at a college. This pertains to "currcoll" and not "prevcoll.";
last_enr=0; * 1-6: Identifies the last round when the Respondent was enrolled;
ungraded=0; * 1-0: Indicates whether a Respondent with no H.S. Diploma or GED has HGA=95 (ungraded);
same_mth=0; * 1-0: Indicates whether a Respondent reports receiving a degree in the same month as the current interview.;
both=0; * 1-0: Indicates whether a Respondent reports receiving both a GED and a H.S. Diploma;
enr_deg=0; * 1-0: Indicates whether a Respondent reports as being "currently" enrolled in a degree program but in a subsequent school loop reports enrollment in a non-degree program.;
rosprb1=0; * 1-0: Indicates whether a Respondent who reports attending a 2-year or 4-year college is not asked the degree working towards question.;
rosprb2=0; * 1-0: Indicates whether a Respondent who does not report attending a 2-year or 4-year college is asked the degree working towards question.;
fill=-4; * These are filler variables, used in arrays to match the number of elements.;
chk_comm=0; * 1-0: Indicates whether a Respondent reports being enrolled in a degree program at a college in this round although he/she does not report receiving GED or H. S. Diploma, by this round. [In such cases the comments from the current round need to be checked to see whether he/she was actually enrolled in a degree program at a college or was just enrolled in a school and college simultaneously to earn some extra college credits which may be used in future when he/she actually enrolls in a degree program at a college];
chk_commP=0; * 1-0: Indicates whether ENCAT in any prior rounds show college enrollment although the Respondent does not report receiving GED or H.S. Diploma, by those rounds. [In such cases the comments in current and earlier rounds need to be checked to see whether he/she was actually enrolled in a degree program at a college or was just enrolled in a school and college simultaneously to earn some extra college credits which may be used in the future when he/she actually enrolls in a degree program at a college];
hgc_hga=0; * 1-0: Indicates if the Respondent reports single item HGC greater than single item HGA;
hgc_hga_n=-4; * 1-0: Indicates if the Respondent reported single item HGC is greater than the single item HGA, even after these HGC and HGA are modified and set equal to the HGC and HGA at DLI, in cases where the Respondent reports never being enrolled since DLI.;
maxgrade=-16; * The HGC computed from the loops. It is identical to hgcloop;
comp_mo=-16; * Month of HGC from loops.;
comp_yr=-16; * Year of HGC from loops.;
evrloop=0; * 1-0: Indicates whether a Respondent goes through a grade loop at least once;
subsitm=0; * 1-0: Indicates whether a single item HGC is being used to compute GRSURV;
subhgam=0; * 1-0: Indicates whether hgaloop (HGA from loop) minus 1 is being used to compute GRSURV;
subprev=0; * 1-0: Indicates whether grade at DLI is being used to compute GRSURV;
setto12=0; * 1-0: Indicates whether GRSURV is being set to 12;
dateitm=0; * 1-0: Indicates whether date of grade completion missing;
disagre=0; * 1-0: Indicates whether GRSURV from previous rounds is greater than from the current round;
datedeg=0; * 1-0: Indicates whether date of degree received is invalid;
mxg_inv=0; * 1-0: Indicates whether the completed grade from loops is 0 or invalid;

assign='unassigned';

******************************************************************************
** dlicm: DLI in continuous month scheme **
** dli_rnd: Identified the last round that the Respondent was interviewed **
** doicm: date of current interview **
** encatP: encat at DLI **
** hgaloop: HGA from loops **
** hgcloop: HGC from loops **
** hgcdt: date of completion of hgcloop **
******************************************************************************;

*** Define arrays to be used in the program;

** e6784X - Is the Respondent continuously enrolled in new school X?;
array e6784 (4) e67841 e67842 e67843 e67844 ;

** e6983X - Did the Respondent re-enroll in new school X?;
array e6938 (4) e69381 e69382 e69383 fill;

** e6943XY - Is the Respondent continuously re-enrolled in new school X after enrollment period Y?;
array e6943 (4,2) e694311 e694312
e694321 fill
fill fill
fill fill;

** e7142XY - Is there another enrollment period after enrollment period Y in new school X?;
array e7142 (4,2) e714211 e714212
e714221 fill
fill fill
e714241 fill;

** Has the Respondent been enrolled in any other school since DLI?;
array e7192 (4) e71921 e71922 e71923 e71924;

** scodeX - Is the Xth school that the Respondent reported being enrolled in an elementary school,
middle school, high school, 2-year or 4-year college?;
array scode (5) scode1-scode5;

** e27337X - What degree is the Respondent working towards at school X?;
array e27337 (5) e273371-e273375;

** e23450X - What degree received upon graduation from school X?;
array e23450 (*) e234501-e234503;

** stopXYy - Year that the Respondent stopped being enrolled at school X during enrollment period Y;
array stopy (*) stop11y stop12y stop13y stop14y stop15y stop21y stop22y stop31y;

** stopXYm - Month that the Respondent stopped being enrolled at school X during enrollment period Y;
array stopm (*) stop11m stop12m stop13m stop14m stop15m stop21m stop22m stop31m;

** stopXYd - Day that the Respondent stopped being enrolled at school X during enrollment period Y;
array stopd (*) stopd11 stopd12 stopd13 stopd14 stopd15 stopd21 stopd22 stopd31;


array degre (*) e273371 e273372 e273373 e273374 e273375 e273371 e273372 e273371;
array codes (*) scode1 scode2 scode3 scode4 scode5 scode1 scode2 scode1;


** Grade Attended;
array grade (*) e841611 e841612 e841621 e841622 e841631
e9589111 e9589112 e9589113 e9589114
e9589211 e9589212 e9589213;

** Whether Completed the Grade Attended;
array grcomp (*) e913111 e913112 e913121 e913122 e913131
e9946111 e9946112 e9946113 e9946114
e9946211 e9946212 e9946213;

** Year of Grade Completion;
array yrcomp (*) e933511y e933512y e933521y e933522y e933531y
e10099111y e10099112y e10099113y e10099114y
e10099211y e10099212y e10099213y;

** Month of Grade Completion;
array mcomp (*) e933511m e933512m e933521m e933522m e933531m
e10099111m e10099112m e10099113m e10099114m
e10099211m e10099212m e10099213m;

** t7000X_rY - Type of certificate/license/degree the Respondent received from program X in Round Y?;
array t7000A (*) t70001 t70002 t70003 t70004 t70005 t70006 t70007
t70001_r1 t70002_r1 t70003_r1
t70001_r2 t70002_r2
t70001_r3 t70002_r3 t70003_r3 t70004_r3
t70001_r4 t70002_r4 t70003_r4 t70004_r4
t70001_r5 t70002_r5 t70003_r5 t70004_r5
t70001_r6 t70002_r6 t70003_r6 t70004_r6 t70004_r6 t70004_r6;

** intm_rX - Month of interview of Round X;
array intmR (*) intm_r1-intm_r6;

** inty_rX - Year of interview of Round X;
array intyR (*) inty_r1-inty_r6;

** encat_rX - Detailed enrollment status as of interview date in Round X;
array encatR (*) encat_r1-encat_r6;

** enroll_rX - 1-0: Whether enrolled as of interview date in Round X (created below);
array enrollR (*) enroll_r1-enroll_r6;

** degsurv_rX - Highest degree received as of interview date in Round X;
array degsurvR (*) degsurv_r1-degsurv_r6;

** _rX - single item HGA as of interview date in Round X;
array hgaR (*) e3500_r1 e2857_r2-e2857_r6;

** _rX - single item HGC as of interview date in Round X;
array hgcR (*) e5000_r1 e3112_r2-e3112_r6;

** hsrX - Date of receipt of High School Diploma (received by interview date in Round X);
array hsrR (*) hsr1-hsr6;

** gdrX - Date of receipt of GED (received by interview date in Round X);
array gdrR (*) gdr1-gdr6;


*** HANDEDITS (1) STARTS;

** In Round 5, this Respondent reported going to a 2-year college but was not enrolled in a degree program. The Respondent earned some credits at that college. Then the Respondent went to a 4-year college and was enrolled in a degree program where the earlier credits were transfered. The Respondent reported the single item HGC to be 13 and single item HGA to be 14. In Round 6, although the Respondent reported going to the 4-year college and being enrolled in a degree program, he/she reported single item HGC to be 12 and single item HGA to be 12. In Round 7, the Respondent reported going to another 2-year college but was (wrongfully) skipped out of the degree working towards question and so it cannot be ascertained whether the Respondent was enrolled in a degree program. He/she reported the single item HGC to be 12 and the single item HGA to be 12. In Round 8, however, the Respondent corrected the HGC and HGA at DLI to 13. He/she reported attending the same college as in Round 7 but reported not being enrolled in any degree program in that round.;
if PUBID=5745 then do;
grsurv_r5=-3;
grsurv_r6=12;
handedit=1;
end;

** Wrong input information.;
if PUBID=406 then do;
intm=1;
inty=2004;
e3112=14;
e4795=0;
e4951=1;
e54581=5;
e67841=1;
e71921=0;
e273371=1; scode1=4; strt11m=12; strt12y=2002; stop11m=12; stop12y=2002;
e273372=3; scode2=5; strt12m=1; strt12y=2003; stop12m=1; stop12y=2004;
handedit=1;
end;

** This Respondent commented that the enrollment dates for this school are in 2002 and not 2003.;
if PUBID=6697 then do;
strt12y=2002;
stop12y=2002;
e933521m=6;
FLG_COMM=1;
handedit=1;
end;

** This Respondent reported being continuously enrolled in DLI school, then reported being enrolled in a new school and commented that he/she was enrolled continuously only in one school. The school code for the second school is a valid skip but the degree working towards is BA/BS. It is most likely that the degree working towards report is wrong and should be -4. This would be consistent with the Respondent's comments of being enrolled in one school only.;
if PUBID=7200 then do;
e273372=-4;
FLG_COMM=1;
handedit=1;
end;

** This Respondent reported being continuously enrolled since DLI at college. But he/she also reported receiving an AA degree in September, 2003 and leaving college. He/she also commented that he/she was enrolled in a community college from 8/99 to 8/00 and in college from 5/02 to 9/03. The Respondent most likely misinterpreted the continuously enrolled question to mean whether he took breaks while being enrolled.;
if PUBID=8055 then do;
stop11m=9;
FLG_COMM=1;
handedit=1;
end;

** This Respondent commented that he/she was enrolled in Nov. but didn't start the term until Jan. 2003. The start date recorded is Nov 2003. What may have happened is that because DLI is Dec 2002, Nov 2002 could not be recorded and so Nov 2003 had to be recorded instead.;
if PUBID=8112 then do;
strt11m=1;
strt11y=2003;
FLG_COMM=1;
handedit=1;
end;

** The start year is recorded as -2, but the Respondent commented that it was 2001. It is most likely that because this date is before DLI, the computer would not let the correct date be recorded.;
if PUBID=8938 then do;
strt11y=2001;
FLG_COMM=1;
handedit=1;
end;

** This Respondent reported completing grade 12 & getting a H.S. Diploma in June 2002. He/she then commented that he/she was enrolled in college in Fall of 2001 and stopped going there in December of 2001.;
if PUBID=2435 then do;
strt12m=8;
strt12y=2001;
stop12y=2001;
FLG_COMM=1;
handedit=1;
end;

** Wrong input information;
if PUBID=6063 then do; stop11m=8; FLG_COMM=1; handedit=1; end;
if PUBID=7202 then do; e933511m=5; FLG_COMM=1; handedit=1; end;
if PUBID=5499 then do; e273371=2; FLG_COMM=1; handedit=1; end;
if PUBID=3543 then do; scode1=3; FLG_COMM=1; handedit=1; end;
if PUBID=2649 then do; e933511m=5; FLG_COMM=1; handedit=1; end;
if PUBID=4573 then do; e933511y=2001; FLG_COMM=1; handedit=1; end;
if PUBID=4848 then do; e933511y=1999; FLG_COMM=1; handedit=1; end;

** This Respondent reported that he/she was not enrolled in that school after Nov 2002 (DLI=Jan 2003).;
if PUBID=4310 then do;
e3877=0;
e3878=0;
e933511m=-4;
e933511y=-4;
e841611=-4;
e913111=-4;
scode1=-4;
strt11m=-4; strt11y=-4;
stop11m=-4; stop11y=-4;
FLG_COMM=1;
handedit=1;
end;

** When asked in which country the school was located, this Respondent reported that he/she did not attend.;
if PUBID=446 then do;
scode1=-4;
strt11m=-4;
strt11y=-4;
stop11m=-4;
stop11y=-4;
e841611=-4;
e3878=0;
FLG_COMM=1;
handedit=1;
end;

* The first two Respondents in this list below were initially erroneously coded with encat_r5=3 instead of 9 and 4, respectively. Subsequently, encat_r6 was also erroneously coded as 3. Later, encat_r5 was corrected but not encat_r6. The last Respondent in the list below was erroneously coded as encat_r6=3 instead of 4.;
if PUBID in (4223 6723 5118) then do;
encat_r6=4;
handedit=1;
end;

** This Respondent went to college for 4 months in Fall 2003 (Aug to Dec 2003) and was working towards an AA degree. He/she received a H.S. Diploma in May 2003. He/she was enrolled at DLI and said he/she had been continuously enrolled in that school. That was the High School. Then he/she reported being enrolled in college. Because he/she reported enrolling in college after receiving H.S. Diploma, it is most likely that the Respondent stopped being enrolled in that school in May 2003 and what he/she meant when he/she said that he/she was continously enrolled in high school, was that he/she did not take any breaks while enrolled in that school.;
if PUBID=895 then do;
stop11m=6;
stop11y=2003;
handedit=1;
end;

*** HANDEDITS (1) ENDS;


*** Intermediate variables to be used in the program later.;

** dlicm, doicm and dli_rnd;
do j=1 to dim(intmR);
if intmR(j)~=-5 then do;
dlicm=((intyR(j)-1980)*12)+intmR(j);
dli_rnd=j;
end;
end;
if intm~=-5 then doicm=((inty-1980)*12)+intm;

rosprb1=0; rosprb2=0;
do i=1 to dim(scode);
if (scode(i)=4|scode(i)=5) & e27337(i)=-4 then rosprb1=1;
if scode(i)=-4 & e27337(i)>-4 then rosprb2=1;
end;

** Enrollment status at each interview and at DLI;
do i=1 to dim(intmR);
if encatR(i) in (8,9,10,11) then enrollR(i)=1;
if encatR(i) in (1,2,3,4,5,6,7) then enrollR(i)=0;
if -5<encatR(i)<0 then enrollR(i)=encatR(i);
if encatR(i)~=-5 then encatP=encatR(i);
if enrollR(i)~=-5 then enrollP=enrollR(i);
if enrollR(i)=1 then last_enr=i;
if hgaR(i)~=-5 then hgaP=hgaR(i);
end;

** Stop date for the last school enrolled in (STOP), what type of school it was (LASTSCH) and the degree working towards (DEG), if any, at that school.;
STOP=-4;
do i=1 to dim(degre);
if stopm(i)>0 & stopy(i)>0 then stopd(i)=((stopy(i)-1980)*12)+stopm(i);
if -4<stopm(i)<0|-4<stopy(i)<0 then stopd(i)=-3;
end;
do i=1 to dim(degre);
if stopd(i)>STOP
|(stopd(i)=STOP & degre(i) in (1,3,4,5,6) & deg not in (1,3,4,5,6))
|(stopd(i)=STOP & codes(i)=5 & sch=4 & degre(i) in (1,3,4,5,6) & deg in (1,3,4,5,6))
|(stopd(i)=STOP & codes(i)=5 & sch=5 & degre(i) in (4,5,6) & deg in (1,3))
then do;
STOP=stopd(i);
sch=codes(i);
deg=degre(i);
end;
end;
if STOP>0 then diff=doicm-STOP;

if sch in (-1,-2,-3) then lastsch=-3;
if sch in (1,2,3) then lastsch=1;
if sch in (4,5) and deg in (1,3,4,5,6) then lastsch=2;
if sch in (4,5) and deg in (2,7,8) then lastsch=2.1;
if sch in (4,5) and deg=9 then lastsch=2.2;
if sch in (4,5) and deg in (-1,-2,-3) then lastsch=2.3;
if sch in (4,5) and deg=-4 then lastsch=2.4;


** Received a GED;
if CDTGD>-4 then GED=1;
** Received a H.S. Diploma;
if CDTHS>-4 then HSD=1;
** Received both a GED and a H.S. Diploma;
if HSD=1 & GED=1 then both=1;

** Respondents who attended college (enrolled in a degree program) in a previous round;
do i=1 to dim(encatR);
if encatR(i) in (4,5,6,7,9,10,11) & degsurvR(i)>=1 then prevcoll=1;
if encatR(i) in (4,5,6,7,9,10,11) & degsurvR(i)<1 then chk_commP=1;
end;

** Respondents who were enrolled in a degree program at a college in a previous round and did not correct the single item HGA as of DLI (e2806) to <13 i.e., they accepted being in college by DLI;
do i=1 to dim(encatR);
if (e2806=-4|e2806>=13) & encatR(i) in (4,5,6,7,9,10,11) & (hsrR(i)=1|gdrR(i)=1) then prevcoll=1;
if (e2806=-4|e2806>=13) & encatR(i) in (4,5,6,7,9,10,11) & hsrR(i)=0 & gdrR(i)=0 then chk_commP=1;
end;

** Respondents who were enrolled in a degree program at a college in this round;
do i=1 to dim(scode);
if scode(i) in (4,5) & e27337(i) in (1,3,4,5,6) then currcoll=1;
end;
if hsd=0 & ged=0 & currcoll=1 then chk_comm=1;
if hsd=0 & ged=0 & currcoll=1 & clg_ok=-4 then clg_ok=0;
if (hsd=1|ged=1) & currcoll=1 then clg_ok=1;

** Respondents who were enrolled in a degree program at a college sometime;
if prevcoll=1|currcoll=1 then somecoll=1;


*** HANDEDITS (2) STARTS:
As a general rule PREVCOLL, CURRCOLL and SOMECOLL are coded ZERO for all Respondents who report being enrolled in a degree program at a college but do not report ever receiving a GED or a H.S. Diploma. However, there are some special cases where the Respondents received special permission to enroll in
a degree program at a college without a GED or H.S. Diploma. Additional information from the comments is used to ascertain these cases.;

** This Respondent was enrolled in college courses but was supposed to get a GED from some other program and so should not be coded as being currently enrolled in college.;
if PUBID=2295 then do;
clg_ok=0;
currcoll=0;
handedit=1;
FLG_13900=1;
end;

** This Respondent was enrolled in college courses but was expected to get a GED at the end of the first semester and so should not be coded as having attended some college.;
if PUBID=6982 then do;
clg_ok=0;
currcoll=0;
handedit=1;
FLG_13900=1;
end;

** 589 & 6826: were pursuing GED type courses.
2295: was enrolled in college courses and was supposed to get GED from some other program.
6982: was enrolled in college courses and will get GED at the end of first semester.
None of them seem to be enrolled in a degree program at the college and so should not be coded as having attended some college.;
if PUBID in (589 6826 6982 2295) then do;
clg_ok=0;
currcoll=0;
somecoll=0;
handedit=1;
FLG_13900=1;
end;

** In this case encat_r6 was coded as 4 although the Respondent did not have a GED or a H.S. Diploma. This was because he/she had confirmed in round 6 (in YSCH-13900) that he/she had been accepted in the degree program without a GED or a H.S. Diploma and should be coded as having attended some college.;
if PUBID=440 then do;
prevcoll=1;
somecoll=1;
FLG_13900=1;
handedit=1;
end;
** When asked how did he/she enroll in college without a GED or H.S. Diploma the Respondent reported taking the { } test in 2001 and should be coded as having attended some college.;
if PUBID=607 then do;
clg_ok=1;
currcoll=1;
somecoll=1;
handedit=1;
FLG_13900=1;
end;
** The Respondent was allowed to enroll in college w/o a GED or H.S. Diploma and should be coded as having attended some college.;
if PUBID=6646 then do;
clg_ok=1;
currcoll=1;
somecoll=1;
handedit=1;
FLG_13900=1;
end;

*** HANDEDITS (2) ENDS;


** hgaloop;
hgaloop=e841611;
do i=2 to dim(grade);
if grade(i)>hgaloop then do;
hgaloop=grade(i);
end;
end;

** hgcloop;
hgcloop=-16;
do i=1 to dim(grade);
if grade(i)>=0 & grade(i)>hgcloop then do;
if grcomp(i)=1 then do;
hgcloop=grade(i);
if mcomp(i)>0 & yrcomp(i)>0 then hgcdt=((yrcomp(i)-1980)*12)+mcomp(i);
if mcomp(i)>0 & yrcomp(i)>0 then hgcdt=-3;
end;
else if grcomp(i) in (-1,-2,-3) then do;
hgcloop=grcomp(i);
end;
end;
if grade(i) in (0,-1, -2, -3,-4) & grcomp(i)>-4 then do;
hgcloop=-55;
end;
end;

** hgsch;
if (1<=e2857<=12) & HSD=0 & GED=0 then hgsch=1;

** college;
do i=1 to dim(e27337);
if e27337(i) in (1,3) then college=1;
if e27337(i) in (4,5,6) then college=2;
if e27337(i) in (-1,-2,-3) then college=-3;
end;

** hgc_hga;
if 0<=e2857<e3112<95 then hgc_hga=1;
if (0<=e2857<12) & e3112=12 then hgc_hga=2;
if 0<=e2857<=12<e3112<95 & hsd=0 & ged=0 then hgc_hga=3.1;
if 0<=e2857<=12<e3112<95 & (hsd=1|ged=1) then hgc_hga=3.2;
if 12<e2857<e3112<95 then hgc_hga=4;

** NOTE: If a Respondent was not enrolled at DLI and has not been enrolled since DLI, the single item HGA and the single item HGC are modified to that reported at DLI unless corrected (in YSCH-3041 and in YSCH-3061, respectively).;
if e3878=0 & hgc_hga>=1 then do;
hgc_hga_n=0;
if e3103~=0 then e2857=hgaR(dli_rnd);
if e3103=0 then e2857=e3104;
if e3010~=0 then e3112=hgcR(dli_rnd);
if e3010=0 then e3112=e3061;
if 0<=e2857<e3112<95 then hgc_hga_n=1;
end;


*** (I) CREATED VARIABLE - ENROLLMENT STATUS (ENCAT) ***

*** [IA] Determining whether enrolled or not?
Note: Summer vacations are included as part of the enrollment period;

if diff=0 then enroll=1;
if diff>0 then enroll=0;
if -3<=STOP<=-1 then enroll=0;
if e3878=0 then enroll=0;

** If currently enrolled, already received a H.S. Diploma, HGC from loop is 12 with a valid date of completion then coded as not enrolled. If enrolled in a 2-year or 4-year college then coded as enrolled no matter what type of degree working towards. Later this criterion is modified and the degree working towards information is used to ascertain the enrollment status.;

if HSD=1 & hgcloop=12 & hgcdt>0 & ENROLL=1 then do;
chk_enr2=1;
ENROLL=0;
do i=1 to dim(scode);
if scode(i) in (4,5) then ENROLL=1;
end;
end;

*** (IB) Determining the sub-categories of not enrolled;

if ENROLL=0 then do;

** No H.S. Diploma, no GED - ENCAT=1;
if (GED<=0) & (HSD<=0) then ENCAT=1;

** GED - ENCAT=2;
if GED=1 then ENCAT=2;

** High school degree - ENCAT=3;
if HSD=1 then ENCAT=3;

** Now not enrolled, attended some college & was enrolled in a degree program - ENCAT=4.
Note: those who indicated attending a college and working toward a "vocational or technical certificate" are coded as not having attended college because these credits typically won't transfer for a Bachelors or an Associates Degree.;
if prevcoll=1 then ENCAT=4;
if currcoll=1 & ((13<=e2857<=20)|e3112>=12|HSD=1|GED=1|hgcloop=12|clg_ok=1) then ENCAT=4;

** Received junior college or 2 year associate degree - ENCAT=5;
if CDTAA>-4 then ENCAT=5;

** Received bachelor's degree - ENCAT=6;
if CDTBA>-4 then ENCAT=6;

** Received master's, doctoral or professional degree - ENCAT=7;
if CDTMA>-4|CDTDC>-4|CDTPF>-4 then ENCAT=7;

end;

*** (IC) Determining the sub-categories of currently enrolled;

if ENROLL=1 then do;

* If the last school attended was an elementary, middle or high school;
if lastsch=1 then do;
if CDTHS>0 & (e3112=12|hgcloop=12) then flaghs=1;
if (1<=e2857<=12) & HSD<=0 & GED<=0 then ENCAT=8;
if e2857=13 & HSD=0 & GED=0 then ENCAT=8;
if e2857=95 & HSD=0 & GED=0 then do;
ENCAT=8;
ungraded=1;
end;
end;

* If the last school attended was a 2-year or 4-year college and Respondent was enrolled in a degree program at that college.;
if lastsch=2 then do;
if sch=4 & deg in (1,3,4,5,6) & ((13<=e2857<95)|e3112>=12|GED=1|HSD=1|hgcloop=12|clg_ok=1)
then ENCAT=9;
if sch=5 & deg in (1,3,4,5,6) & ((13<=e2857<95)|e3112>=12|GED=1|HSD=1|hgcloop=12|clg_ok=1)
then ENCAT=10;
if sch=5 & deg in (4,5,6) & ((16<e2857<95)|e3112>=16) then ENCAT=11;
if (1<=e2857<=12) & HSD=0 & GED=0 & clg_ok~=1 then do;
ENCAT=8;
flagcoll=1;
end;
end;

* If the last school attended was a 2-year or 4-year college but Respondent was NOT enrolled in a degree program at that college.;
if lastsch>2 then do;
if GED=0 & HSD=0 & somecoll=0 then ENCAT=1;
if currcoll=0 & prevcoll=1 then do;
if HSD=1|GED=1 then ENCAT=4;
if CDTAA>-4 then ENCAT=5;
if CDTBA>-4 then ENCAT=6;
if CDTMA>-4|CDTDC>-4|CDTPF>-4 then ENCAT=7;
end;
if currcoll=1 & (HSD=1|GED=1|clg_ok=1) then ENCAT=4;
end;
if GED=1 & HSD=0 & somecoll=0 then ENCAT=2;
if HSD=1 & somecoll=0 then ENCAT=3;
if (HSD=1|GED=1|clg_ok=1) & currcoll=1 & lastsch=-3 then ENCAT=4;
if (HSD=1|GED=1) & prevcoll=1 & lastsch=-3 then ENCAT=4;

end;


** If Respondent received a bachelor's degree degree in or around the month of the interview, then this program incorrectly codes him/her as being enrolled. Change enrollment status from enrolled to not enrolled.;

if CDTHS>0 & doicm=CDTHS & ENCAT in (-3,1,2,8) then do;
ENCAT=3;
same_mth=1;
end;

if CDTGD>0 & doicm=CDTGD & ENCAT in (-3,1,8) then do;
ENCAT=2;
same_mth=1;
end;

if CDTAA>0 & doicm=CDTAA & ENCAT in (-3,1,2,8,3,4,9) then do;
ENCAT=5;
same_mth=1;
end;

if CDTBA>0 & doicm=CDTBA & ENCAT in (-3,1,2,8,3,4,5,10) then do;
ENCAT=6;
same_mth=1;
end;

if ((CDTMA>0 & doicm=CDTMA)|(CDTDC>0 & doicm=CDTDC)) & ENCAT~=7 then do;
ENCAT=7;
same_mth=1;
end;


** Enrolled since DLI (although may not be currently enrolled);

if ENROLL=1|(ENROLL=0 & e3878~=0) then do;

* MISSING VALUES: When type of school enrolled in or the degree working towards cannot be ascertained and no prior enrollment in a degree program at any college is reported.;
do i=1 to dim(scode);
if INV1~=0 & scode(i) in (-2,-3) then INV1=1;
if scode(i) not in (-2,-3) then INV1=0;
end;
do i=1 to dim(scode);
if INV2~=0 & scode(i) in (4,5) & e27337(i) in (-2,-3) then INV2=1;
if scode(i) in (4,5) & e27337(i)>0 then INV2=0;
end;
if INV1=1 then do;
flagcoll=-3;
college=-3;
ENCAT=-3;
reason=1;
end;
if INV2=1 then do;
flagcoll=-3;
college=-3;
if enroll=1 & lastsch=2.3 then do;
encat=-3;
reason=2.1;
end;
if enroll=0 & somecoll=0 & lastsch=2.3 then do;
encat=-3;
reason=2.2;
end;
end;

** Received a H.S. Diploma or a GED, single item HGC>12, single item HGA>12 but not enrolled in a college. Then it cannot be ascertained what type of educational program the Respondent is enrolled in.;
if (HSD=1|GED=1) & (13<=e2857<95) & (13<=e3112<95)
& scode1 in (-4,1,2,3) & scode2 in (-4,1,2,3) & scode3 in (-4,1,2,3)
& scode4 in (-4,1,2,3) & scode5 in (-4,1,2,3) then do;
ENCAT=-3;
reason=3;
end;

** Received a H.S. Diploma, but HGA<=12 & HGC<12. Then it cannot be ascertained whether the Respondent received a H.S. Diploma or whether the HGC information is wrong.;
if HSD=1 & e2857<=12 & e3112<12 & hgcloop<12 & handedit=0 then do;
hgc_chk=1;
if hsrP=-4 then do;
ENCAT=-3;
reason=4;
end;
end;

** Never received a GED or a H.S. Diploma but is enrolled in a degree program at a college and HGA>=13 and there are no clarifications available in the comments. Then the educational program enrolled in cannot be ascertained.;
do i=1 to dim(scode);
if (13<=e2857<=20) & GED=0 & HSD=0 & clg_ok~=1 & currcoll=1 then do;
ENCAT=-3;
reason=5;
end;
end;

** Enrolled in a 2-year or a 4-year college but skipped out of the degree working towards question. Then the degree program enrolled in cannot be ascertained.;
if rosprb1=1 & ENCAT=-3 & reason=. then reason=6;

end;


*** HANDEDITS (3) STARTS;

** This Respondent reported having a GED, being enrolled in the 9th grade and then attending the first year of college at a university. After that, he/she reported being enrolled at a high school to get a diploma to be eligible for financial aid. It is most likely that the Respondent was not currently enrolled but was previously enrolled in a degree program at a college, ENCAT=4.;
if PUBID=1284 then do;
encat=4;
FLG_COMM=1;
handedit=1;
end;

** PUBID=5183. This Respondent reported that he/she was working towards an MA degree and expected to complete it in January of 2004. However, that question commented "completed aug2003". Then terms required to complete the program commented "fall of 1999 to spring 2003." Again whether has been enrolled continuously in that school commented yes "but not currently." Also reported that the highest degree received was BA but did not report any date of receipt. It is most likely that the Respondent received BA degree in Aug 2003 and as of the current interview date i.e., Dec 2003, was not currently enrolled - basically no more classes to take and waiting for MA degree (in January 2004). Perhaps this was some kind of an integrated BA & MA program.;
if PUBID=5183 then do;
ENCAT=6;
FLAG_COMM=1;
handedit=1;
end;

** This Respondent commented being enrolled in a technical school but also reports being enrolled in a 4-year college trying for AA degree.;
if PUBID=1779 then do;
ENCAT=-3;
FLAG_COMM=1;
handedit=1;
end;

** This Respondent commented being enrolled in a technical school.;
if PUBID=1906 then do;
ENCAT=-3;
FLAG_COMM=1;
handedit=1;
end;

** Although these Respondents reported being enrolled in college, they were skipped out of the degree working towards questions (YSCH-27337.). Before handedits their ENCATs were the following:

PUBID ENCAT HSD grsurvP STOP DOICM
579 4 1 16 287 287
1612 4 1 14 -3 286
5438 4 1 12 288 288
2537 4 1 13 288 288
5745 4 1 13 288 288
8313 4 1 13 292 292
3506 1 0 10 287 287
4396 1 0 9 287 287
7315 1 0 9 287 287
1706 1 0 7 288 288
7737 1 0 6 287 287
8277 1 0 7 279 287


Those with ENCAT=1, grsurvP<=12 but currently enrolled are coded as ENCAT=8.
The one with ENCAT=1, grsurvP<=12 but currently not enrolled are OK.
Those WITH with ENCAT=4, grsurvP>=12 may not be OK. All but one are currently enrolled. They are enrolled in the same college as in the last round when they had reported being enrolled in a degree program at those colleges. Assuming they are still enrolled in those degree programs they are coded ENCAT=9. The one that is not currently enrolled because there is no valid stop date is OK.
PUBID=5745 is also OK (see handedit earlier).;
if PUBID in (3506 4396 7315 1706 7737) then do;
ENCAT=8;
FLAG_COMM=1;
handedit=1;
end;
if PUBID in (579 5438 2537 8313) then do;
ENCAT=9;
FLAG_COMM=1;
handedit=1;
end;

*** HANDEDITS (3) ENDS;


** Making ENROLL compatible with ENCAT, which were changed based on new information.;
oldENCAT=ENCAT;
if ENCAT in (1,2,3,4,5,6,7) & ENROLL~=0 then do;
ENROLL=0;
enr_chg=1;
end;
if ENCAT in (8,9,10,11) & ENROLL~=1 then do;
ENROLL=1;
enr_chg=2;
end;


*** [II] CREATED VARIABLE - HIGHEST GRADE COMPLETED AS OF THE SURVEY DATE (GRSURV) ***

*** [IIA] Enrolled or not enrolled;

** Maximum grade completed using information in this round (grade loops);
do i=1 to dim(grade);
if grade(i)>=0 & grade(i)>maxgrade then do;
if grcomp(i)=1 then do;
assign='FROM LOOP';
maxgrade=grade(i);
comp_mo=mcomp(i);
comp_yr=yrcomp(i);
if (0<yrcomp(i)<2003)|(yrcomp(i)=2003 & 0<mcomp(i)<=6) then do;
CJUMON=mcomp(i);
CJUYR=yrcomp(i);
GRJUNE=grade(i);
LOC=1;
end;
end;
else if grcomp(i) in (-1,-2,-3) then do;
maxgrade=grcomp(i);
assign='GRCOMP MISSING ';
end;
end;
if grade(i) in (0,-1,-2,-3,-4) & grcomp(i)>-4 then do;
maxgrade=-55;
assign='GRADE INVALID';
end;
if grade(i) in (0,-1,-2,-3,-4) & grcomp(i)=1 then mxg_inv=1;
if grcomp(i)>-4 then evrloop=1;
end;

** HGC by DLI (incorporating any corrections made by the Respondent in this round);
grsurvP=GRSURV_r6;
if GRSURV_r6=-5 then do;
grsurvP=GRSURV_r5;
if GRSURV_r5=-5 then do;
grsurvP=GRSURV_r4;
if GRSURV_r4=-5 then do;
grsurvP=GRSURV_r3;
if GRSURV_r3=-5 then do;
grsurvP=GRSURV_r2;
if GRSURV_r2=-5 then do;
grsurvP=GRSURV_r1;
end;
end;
end;
end;
end;
if e3061>=0 then grsurvP=e3061;

** GRSURV;
GRSURV=maxgrade;
LOCATOR=1;

** If invalid or incorrect grade data was read into the loop or if a Respondent never went through the loops (usually because they had started attending 2-year or 4-year colleges but sometimes because of infosheet mistakes) but had attended school either at DLI or since DLI, then GRSURV replaced with the single item HGC.;
** Note: This single item HGC must be checked against the roster data: if the Respondent completed high school, never reported attending a college in the loop/roster information, but indicated enrollment in a grade > 12 in the single item HGC, then GRSURV variable is set to 12 since no college degree program has been reported.;

if (((e841611<=0) & e913111~=-4)|GRSURV=-55|evrloop=0) & e3878~=0 & e3112~=-4 then do;
subsitm=1;
do i=1 to dim(scode);
if e3112<12 & HSD=0 & GED=0 & clg_ok~=1 then do;
GRSURV=e3112;
GRJUNE=-3;
LOCATOR=2;
LOC=2;
end;
if e841611<=0 & e913111~=-4 then assign='ENROLLED, BAD GRADE: SUBS. ITEM';
else if evrloop=0 then assign='ENROLLED, NOT THRU LOOPS: SUBS. ITEM';
else if maxgrade=-55 then assign='ENROLLED, BAD GRADE: SUBS. ITEM';
end;
end;

** Enrolled since DLI but grade completion not confirmed, then a value equal to one less than HGA from loop using a conservative approach is substituted.:
if the HGA from loop, hgaloop, is equal to the single item HGA then it is assumed that the Respondent must have completed hgaloop-1 and so hgaloop-1 is substituted.
else if hgaloop is one or more grades higher than the single item HGC then the single item HGC seems more appropriate and so the single item HGC is substituted.
else if hgaloop is equal to or less than the single item HGC which is greater than the HGC at DLI then the single item HGC becomes suspect and so HGC at DLI is substituted;

if GRSURV=-16 & e3878~=0 then do;
if (hgaloop=e2857) & (e2857>=0) then do;
subhgam=1;
GRSURV=hgaloop-1;
GRJUNE=-3;
LOCATOR=3.1;
LOC=3.1;
assign='ENROLLED-NO LOOP HGC-hgaloop=2857: SUBS hgaloop-1';
end;
else if (hgaloop-1)=e3112 & e3112>=0 then do;
subsitm=1;
subhgam=1;
GRSURV=e3112;
GRJUNE=-3;
LOCATOR=3.2;
LOC=3.2;
assign='ENROLLED-NO LOOP HGC-hgaloop-1=e3112: SUBS hgaloop-1';
end;
else if (hgaloop-1)>e3112 & e3112>=0 then do;
subsitm=1;
GRSURV=e3112;
GRJUNE=-3;
LOCATOR=3.3;
LOC=3.3;
assign='ENROLLED-NO LOOP HGC-hgaloop-1=e3112: SUBS hgaloop-1';
end;
else if e3112>(hgaloop-1) & e3112>=grsurvP>=0 & hgaloop>=0 then do;
subprev=1;
GRSURV=grsurvP;
GRJUNE=grsurvP;
LOCATOR=3.4;
LOC=3.4;
assign='ENROLLED-NO LOOP HGC-SAID NO to GRADE: SUBS PREV';
end;
end;

** Confirmed completing a grade in the loop but didn't know the year of completion, then HGC from loop or the single item HGC, whichever is lower, is used.;

if maxgrade=GRSURV & comp_yr=-2 then do;
if maxgrade>e3112 & e3112>=0 then do;
dateitm=1;
subsitm=1;
GRSURV=e3112;
GRJUNE=-3;
LOCATOR=4;
LOC=4.1;
assign='SUBS. ITEM: NO DATE ITEM lower';
end;
end;

if maxgrade=GRSURV & comp_yr~=-2 & comp_mo=-2 then do;
if comp_yr<2003 then do;
GRJUNE=GRSURV;
LOC=4.21;
end;
if comp_yr>=2003 then do;
GRJUNE=-3;
LOC=4.22;
end;
end;

else if (comp_yr~=-2 & comp_mo~=-2) then do;
dateitm=.;
end;


** Received a GED or H.S. Diploma, but GRSURV<12 then set GRSURV=12. If date of receipt of GED or H. S. Diploma is on or before June 2003 then GRJUNE is also set to 12. If not then GRJUNE is set to HGC at DLI if HGC from loop is invalid. If HGC from loops is valid then do nothing here as GRJUNE has
already been set to it (by the code above). If dates of receipt of GED or H.S. Diploma are invalid then set GRJUNE to -3.;

setto12=0;
if (HSD=1|GED=1) & GRSURV<=12 then do;
setto12=1;
GRSURV=12;
LOCATOR=5;
if 0<=GRJUNE<grsurvP<95 then do;
GRJUNE=grsurvP;
LOC=5.10;
end;
if CDTGD=-3|CDTHS=-3 then do;
GRJUNE=-3;
LOC=5.11;
end;
if CDTGD>282 & maxgrade<=0 then do;
GRJUNE=grsurvP;
LOC=5.12;
end;
if CDTHS>282 & maxgrade<=0 then do;
GRJUNE=grsurvP;
LOC=5.13;
end;
if 0<CDTGD<=282 then do;
GRJUNE=12;
LOC=5.14;
end;
if 0<CDTHS<=282 then do;
GRJUNE=12;
LOC=5.15;
end;
assign='set to 12: HSD or GED';
end;

** If Respondent currently enrolled was was enrolled at sometime prior to the current interview in a degree program at a college (ese ENCAT to determine whether Respondent was ever in college) then use single item HGC, to determine GRSURV as grades completed in college are typically not asked in loops.
Given that Respondent attends college:
(a) if single item HGC>=12 then use single item HGC
(b) if single item HGC<12 and Respondent reports completing a grade>12 by DLI and also attending college by DLI then use HGC at DLI
(c) otherwise if single item HGC<12 and Respondent reports completing a H.S. Diploma or GED then GRSURV is set equal to 12.
(d) otherwise if single item HGC<12 and none of the above conditions hold then it is unclear what HGC is so GRSURV=-3. Check these cases (locator=6.1) carefully, using comments to see whether theRespondent was actually enrolled in a degree program in college (clg_ok~=1). If so, then leave those cases out.;

if ENCAT in (4,5,6,7,9,10,11) then do;
if e3112<12 & clg_ok~=1 then do;
GRSURV=-3;
LOCATOR=6.1;
assign='college, UNCLEAR';
end;
if e3112<12 & (HSD=1|GED=1|clg_ok=1) then do;
setto12=1;
GRSURV=12;
LOCATOR=6.2;
assign='college, SET to 12';
end;
if e3112<12 & grsurvP>12 & encatP in (4,5,6,7,9,10,11) then do;
subprev=1;
GRSURV=grsurvP;
LOCATOR=6.3;
assign='college, PREVIOUS round';
end;
if 12<=e3112<95 then do;
subsitm=1;
GRSURV=e3112;
LOCATOR=6.4;
assign='college';
end;
end;

** HGC at DLI is greater than GRSURV and the single item HGC provides a more consistent grade, then the single item HGC is used. If the single item HGC is also inconsistent, then HGC at DLI is used.
Note: don't use single item HGC if it is greater than 12 and no college is reported;

if 0<grsurvP<95 & 0<GRSURV<grsurvP then disagre=1;

if disagre=1 then do;

rnd_dif=7-dli_rnd+1;
sitm_pr=e3112-grsurvP;

if 0<=e3112<=12 then do;
subprev=1;
GRSURV=grsurvP;
GRJUNE=grsurvP;
LOCATOR=7.1;
LOC=7.1;
assign='disagre: REPLACE WITH SINGLE ITEM or PREV';
if (0<=sitm_pr<=rnd_dif)|grsurvP=95 then do;
subsitm=1;
GRSURV=e3112;
LOCATOR=7.2;
GRJUNE=-3;
LOC=7.2;
if grsurvP=e3112 then do;
GRJUNE=grsurvP;
LOC=7.21;
end;
end;
end;

if ((12<e3112<95)|(12<grsurvP<95)) & ENCAT in (4,5,6,7,9,10,11) then do;
GRSURV=grsurvP;
subprev=1;
LOCATOR=7.3;
assign='disagre: college REPORTED, SINGLE ITEM or PRIOR round';
if 0<=sitm_pr<=rnd_dif then do;
subsitm=1;
GRSURV=e3112;
LOCATOR=7.4;
end;
end;

if ((12<e3112<95)|(12<grsurvP<95)) & ENCAT in (1,8,-3) then do;
GRSURV=-3;
GRJUNE=-3;
LOCATOR=7.5;
LOC=7.5;
assign='disagre: NO college REPORTED';
end;

if ((12<e3112<95)|(12<grsurvP<95)) & ENCAT in (2,3) then do;
GRSURV=12;
GRJUNE=-3;
if 12<=grsurvP<95 then do;
GRJUNE=12;
LOC=7.61;
end;
LOCATOR=7.6;
if setto12~=1 then loc=7.62;
end;
end;


*** [IIB] If not enrolled SDLI;

** Assign previous HGC. If previous HGC is missing, then assign single item HGC.;

** Note for USER'S GUIDE: every Respondent who reports not being enrolled since DLI is given the HGC at DLI except for those who report receiving a GED or H.S. Diploma during the interim. The latter are assigned a GRSURV of 12. When respondents not enrolled since DLI report a HGC higher than the HGC at DLI, then this new information is not used for the computation of GRSURV as this information is suspect.;

if e3878=0 & grsurvP>=0 & locator~=5 then do;
subprev=1;
GRSURV=grsurvP;
GRJUNE=grsurvP;
LOCATOR=8.1;
LOC=8.1;
end;
if e3878=0 & grsurvP<=0 & locator~=5 then do;
subsitm=1;
GRSURV=e3112;
GRJUNE=-3;
LOCATOR=8.2;
LOC=8.2;
end;

** No college reported but HGC>12 is reported, then GRSURV is coded as 12 as long as the Respondent received a GED or a H.S. Diploma. If not code -3. Anyone reporting going to a 2/4-yr college for a vocational training but reporting a HGC of more than 12 would also fall in this category. If date of receipt of GED or H.S. Diploma is on or before June 2003 then GRJUNE is also set to 12. If not and HGC from loop is invalid then GRJUNE is set to HGC at DLI. If HGC from loop is valid then GRJUNE has already been set to HGC from loop (by above code). If dates are invalid then GRJUNE is set to -3.;

if 12<GRSURV<95 & ENCAT not in (-3,4,5,6,7,9,10,11) then do;
if GED=1|HSD=1 then do;
setto12=1;
GRSURV=12;
LOCATOR=9.1;
if CDTGD=-3|CDTHS=-3 then do;
GRJUNE=-3;
LOC=9.11;
end;
if CDTGD>282 & maxgrade<=0 then do;
GRJUNE=grsurvP;
LOC=9.12;
end;
if CDTHS>282 & maxgrade<=0 then do;
GRJUNE=grsurvP;
LOC=9.13;
end;
if 0<CDTGD<=282 then do;
GRJUNE=12;
LOC=9.14;
end;
if 0<CDTHS<=282 then do;
GRJUNE=12;
LOC=9.15;
end;
end;
if GED=0 & HSD=0 then do;
GRSURV=-3;
GRJUNE=-3;
LOCATOR=9.2;
LOC=9.2;
end;
end;


if GRSURV in (-55,-2,-16,0) then do;
GRSURV=-3;
LOCATOR=10;
end;
if GRSURV=-3 then do;
GRJUNE=-3;
LOC=10;
end;

if GRJUNE=. then do;
if e3878=0 then do;
GRJUNE=GRSURV;
LOC=11;
end;
if maxgrade=GRSURV & ((comp_yr=2003 & comp_mo>6)|comp_yr>2003) then do;
GRJUNE=grsurvP;
LOC=12;
end;
if maxgrade=GRSURV & 0<comp_yr<2003 & comp_mo=-2 then do;
GRJUNE=grsurv;
LOC=13;
end;
if comp_yr=-2 & comp_mo=-2 then do;
GRJUNE=-3;
LOC=14;
end;
end;

** If highest grade completed by the current round is equal to that by DLI then highest grade completedby June of 2003 must necessarily be equal to HGC by DLI.;
if grsurvP=GRSURV & GRJUNE~=grsurvP then do;
GRJUNE=grsurvP;
LOC=15;
end;
if GRJUNE=. then do;
GRJUNE=-3;
LOC=16;
end;
** Those in college are not asked grades completed information in the loops and so the dates of gradecompletion for grades in college cannot be ascertained. Hence, all those reporting some college attendance (enrolled in a degree program) are coded -4 on GRJUNE.;
if ENCAT in (4,5,6,7,9,10,11) then do;
GRJUNE=-4;
LOC=17;
end;


** Not enrolled at or since DLI, but single item HGC is higher than HGC at DLI, single item HGA is at least two grades higher than HGC at DLI - the enrollment status or grades completed cannot be ascertained for such cases.;
if e3878=0 & (GRSURV=grsurvP<e3112<=12) & e2857-2>=GRSURV>0 & e2857~=hgaP then do;
GRSURV=-3;
GRJUNE=-3;
LOCATOR=11;
LOC=18;
ENCAT=-3;
assign='CONFLICTING INFORMATION';
reason=8;
end;


*** [IV] CREATED VARIABLE - HIGHEST DEGREE RECEIVED AS OF THE SURVEY DATE (DEGSURV) ***

DEGSURV=0;

** Received a GED.;
if GED=1 then DEGSURV=1;
if GED=-3 then DEGSURV=-3;

** Received a H.S. Diploma.;
if HSD=1 then DEGSURV=2;
if HSD=-3 then DEGSURV=-3;

** Received a Junior College or two-year Associate Degree.;
if CDTAA>-4 then DEGSURV=3;

** Received a Bachelor's Degree.;
if CDTBA>-4 then DEGSURV=4;

** Received a Master's Degree.;
if CDTMA>-4 then DEGSURV=5;

** Received a Doctoral Degree.;
if CDTDC>-4 then DEGSURV=6;

** Received a Professional Degree.;
if CDTPF>-4 then DEGSURV=7;

** Degree received cannot be determined.;
do i=1 to dim(e23450);
if e23450(i) in (-1, -2, -3) then DEGSURV=-3;
end;


** Highest degree received as of DLI: degsurvP;
degsurvP=DEGSURV_r6;
if DEGSURV_r6=-5 then do;
degsurvP=DEGSURV_r5;
if DEGSURV_r5=-5 then do;
degsurvP=DEGSURV_r4;
if DEGSURV_r4=-5 then do;
degsurvP=DEGSURV_r3;
if DEGSURV_r3=-5 then do;
degsurvP=DEGSURV_r2;
if DEGSURV_r2=-5 then do;
degsurvP=DEGSURV_r1;
end;
end;
end;
end;
end;

** These following cases should not exist.;
if 0<=DEGSURV<degsurvP then prev_deg=1;


*** [V] CREATED VARIABLE - HIGHEST DEGREE COMPLETED AS OF JUNE 30, 2001 (DEGJUNE) ***

DEGJUNE=0;

** Received a GED.;
if 0<CDTGD<=282 then DEGJUNE=1;
if CDTGD in (-3, -2, -1) then DEGJUNE=-3;

** Received a H.S. Diploma.;
if 0<CDTHS<=282 then DEGJUNE=2;
if CDTHS in (-3, -2, -1) then DEGJUNE=-3;

** Received a Junior College or two-year Associate Degree.;
if 0<CDTAA<=282 then DEGJUNE=3;
if CDTAA in (-3, -2, -1) then DEGJUNE=-3;

** Received a Bachelor's Degree.;
if 0<CDTBA<=282 then DEGJUNE=4;
if CDTBA in (-3, -2, -1) then DEGJUNE=-3;

** Received a Master's Degree.;
if 0<CDTMA<=282 then DEGJUNE=5;
if CDTMA in (-3, -2, -1) then DEGJUNE=-3;

** Received a Doctoral Degree.;
if 0<CDTDC<=282 then DEGJUNE=6;
if CDTDC in (-3, -2, -1) then DEGJUNE=-3;

** Received a Professional Degree.;
if 0<CDTPF<=282 then DEGJUNE=7;
if CDTPF in (-3, -2, -1) then DEGJUNE=-3;


** Highest degree received by June of 2003 cannot be higher than highest degree received by DLI, which is sometime during or before 2002.;
if DEGJUNE~=DEGSURV & DEGSURV=degsurvP & DEGSURV>=0 & DEGJUNE>=0 then do;
DEGJUNE=degsurvP;
end;

** If highest degree ever received is invalid then highest degree received by June of 2003 is also invalid.;
if DEGSURV=-3 then DEGJUNE=-3;

** If date of degree received cannot be determined then the highest degree by June of 2003 cannot be computed.;
if (DEGSURV=1 & -4<CDTGD<=0)|(DEGSURV=2 & -4<CDTHS<=0)|(DEGSURV=3 & -4<CDTAA<=0)
|(DEGSURV=4 & -4<CDTBA<=0)|(DEGSURV=5 & -4<CDTMA<=0)|(DEGSURV=6 & -4<CDTDC<=0)
|(DEGSURV=7 & -4<CDTPF<=0) then datedeg=1;

if datedeg=1 then DEGJUNE=-3;

** Convert all -1 and -2 codes to -3.;
if ENCAT in (-1,-2) then ENCAT=-3;
if GRSURV in (-1,-2) then GRSURV=-3;
if GRJUNE in (-1,-2) then GRJUNE=-3;
if DEGSURV in (-1,-2) then DEGSURV=-3;
if DEGJUNE in (-1,-2) then DEGJUNE=-3;

** Code all created variables for non-interviewers as -5.;
if e3112=-5 then do;
ENROLL=-5;
ENCAT=-5;
GRSURV=-5;
GRJUNE=-5;
DEGSURV=-5;
DEGJUNE=-5;
assign ='NON-INTERVIEW';
GED=-5;
HSD=-5;
LOCATOR=-5;
LOC=-5;
end;


ENDSAS;

 

Return to top


Current or Most Recent School Private or Parochial

Variables Created:  CV_SCHOOL_TYPE

Variables Used

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

TYPER1 CV_SCHOOL_TYPE_1997   SSTOP1M2 NEWSCHOOL_STOP1.02~M
TYPER2 CV_SCHOOL_TYPE_1998   SSTOP1Y2 NEWSCHOOL_STOP1.02~Y
TYPER3 CV_SCHOOL_TYPE_1999   SSTOP1M3 NEWSCHOOL_STOP1.03~M
TYPER4 CV_SCHOOL_TYPE_2000   SSTOP1Y3 NEWSCHOOL_STOP1.03~Y
TYPER5 CV_SCHOOL_TYPE_2001   SSTOP1M4 NEWSCHOOL_STOP1.04~M
TYPER6 CV_SCHOOL_TYPE_2002   SSTOP1Y4 NEWSCHOOL_STOP1.04~Y
SPERIOD1 NEWSCHOOL_PERIODS.01   SSTOP1M5 NEWSCHOOL_STOP1.05~M
SPERIOD2 NEWSCHOOL_PERIODS.02   SSTOP1Y5 NEWSCHOOL_STOP1.05~Y
SPERIOD3 NEWSCHOOL_PERIODS.03   SSTOP2M1 NEWSCHOOL_STOP2.01~M
SPERIOD4 NEWSCHOOL_PERIODS.04   SSTOP2Y1 NEWSCHOOL_STOP2.01~Y
SPERIOD5 NEWSCHOOL_PERIODS.05   SSTOP2M2 NEWSCHOOL_STOP2.02~M
SCODE1 NEWSCHOOL_SCHCODE.01   SSTOP2Y2 NEWSCHOOL_STOP2.02~Y
SCODE2 NEWSCHOOL_SCHCODE.02   SSTOP3M1 NEWSCHOOL_STOP3.01~M
SCODE3 NEWSCHOOL_SCHCODE.03   SSTOP3Y1 NEWSCHOOL_STOP3.01~Y
SCODE4 NEWSCHOOL_SCHCODE.04   STYPE1 NEWSCHOOL_TYPE.01
SCODE5 NEWSCHOOL_SCHCODE.05   STYPE2 NEWSCHOOL_TYPE.02
SSTOP1M1 NEWSCHOOL_STOP1.01~M   STYPE3 NEWSCHOOL_TYPE.03
SSTOP1Y1 NEWSCHOOL_STOP1.01~Y   pubid PUBID

Codes for Created Variable

1 = Public school
2 = Private, not parochial 
3 = Parochial
4 = Other

 
This program is used to create the school type variables from Round 7, i.e. the current or most recent schoolsthat the youth attended are public, private, parochial or other. This is completed in the following steps:

1) We first decide which school is the most recent school (non-college) that the youth participated by the endingdate for different enrollment periods.
2) We can get the school type from the new school roster.However, in the program, these two steps can not be separated.


/* create the array variables.*/

* # of enrollment periods;
array speriod speriod1-speriod5;

* ending date for each period;
array sstop1m sstop1m1-sstop1m5;
array sstop1y sstop1y1-sstop1y5;
array sstop2m sstop2m1-sstop2m2;
array sstop2y sstop2y1-sstop2y2;
array sstop3m sstop3m1;
array sstop3y sstop3y1;

* school code, i.e. elementary school, high school or college;
array scode scode1-scode5;

*school type for round 7;
array stype stype1-stype3;

* ending time for each school;
array srecm srecm1-srecm5;
array srecy srecy1-srecy5;

* school length counting both month&year: the month length from jan. 1990 to the ending month for each school;
array mlength mlength1-mlength5;

* 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-ylength5;

/************************* step 1).In the process to decide the most recent school. ************************/

do i=1 to 5;

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 );
if stype1=-5 then maxmleng=-5;

maxyleng=max(ylength1,ylength2, ylength3, ylength4, ylength5);
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 5;
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 5;
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 5;
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 5;
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 5;
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; /* There were no such cases in round 4, but there are a couple of cases in round 5*/

* 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 5;
if ylength[i]=maxyleng and srecm[i]=12 then do;
type1=stype[i];
flag2=1;
end;
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 5;
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;

* for the 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)
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))
then type1=-3;

* if the respondent only goes to one school in r6,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)
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=4433 then sltype1=1;
*if PUBID=4093 then sltype1=-3;


* 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 interview date;
flag1=0;
flag2=0;
if sltype=-3 and stype1=stype2 and stype1>0 then flag1=1;
if flag1=1 then sltype=1; /*R6 case 1252001 only */
if int_y=-5 then sltype=-5;

endsas;


Return to top


Date Received Diploma or Degree

Variables Created: 

 Variables Used

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

Previous rounds:     Round 7:  
gdr1 CV_GED   e11700 YSCH-11700
hsr1 CV_HS_DIPLOMA   e11900m YSCH-11900~M
gdr2 CV_GED   e11900y YSCH-11900~Y
hdr2 CV_HS_DIPLOMA   e13300 YSCH-13300
gdr3 CV_GED   e13500m YSCH-13500~M
hsr3 CV_HS_DIPLOMA   e13500y YSCH-13500~Y
aar3 CV_AA_DEGREE   e24685 YSCH-24685
bar3 CV_BA_DEGREE   e234501 YSCH-23450.01
gdr4 CV_GED   e234502 YSCH-23450.02
hsr4 CV_HS_DIPLOMA   e234503 YSCH-23450.03
aar4 CV_AA_DEGREE   e234601m YSCH-23460.01~M
bar4 CV_BA_DEGREE   e234601y YSCH-23460.01~Y
gdr5 CV_GED   e234602m YSCH-23460.02~M
hsr5 CV_HS_DIPLOMA   e234602y YSCH-23460.02~Y
aar5 CV_AA_DEGREE   e234603m YSCH-23460.03~M
bar5 CV_BA_DEGREE   e234603y YSCH-23460.03~Y
gdr6 CV_GED   t70001 YTRN-7000.01
hsr6 CV_HS_DIPLOMA   t70002 YTRN-7000.02
aar6 CV_AA_DEGREE   t70003 YTRN-7000.03
bar6 CV_BA_DEGREE   t70004 YTRN-7000.04
mar6 CV_MA_DEGREE   t70005 YTRN-7000.05
      t70006 YTRN-7000.06
      t70007 YTRN-7000.07
      pubid PUBID
      intd SYMBOL!CURDATE~D
      intm SYMBOL!CURDATE~M
      inty SYMBOL!CURDATE~Y

This program creates the variables that indicate the dates on which the youth received GED, High School Diploma, Associate Degree, Bachelor's Degree, Master's Degree, Doctoral Degree and Professional Degree from NLSY97 round 7 (2003). The dates will be calculated as the number of accumulated months from 1980.

Note: The program will check if there is some conflict in these answers between round 7 and earlier rounds. In case of conflicting information about the dates of degree receipt the information from the earlier round, if valid, will be used. If either the date from the earlier round or this is invalid then only the valid date is used.

Note: If R attends college without a High School diploma or GED then R is asked for an explanation in question, YSCH-13900. If R reports receiving a HS diploma or GED and gives a valid date then that is assigned. If however, R gives no date of receipt then a -3 is assigned.

The variables created are the following:

DTHS Date that the respondent received High School Diploma.
DTGED Date that the respondent received GED.
DTAA Date that the respondent received Associate Degree.
DTBA Date that the respondent received Bachelor's Degree.
DTMA Date that the respondent received Master's Degree.
DTDOC Date that the respondent received Doctoral Degree.
DTPROF Date that the respondent received Professional Degree.


 *** All arrays defined.;

array CR1 [7] gdr1 hsr1 aar1 bar1 mar1 dcr1 pfr1;
array CR2 [7] gdr2 hsr2 aar2 bar2 mar2 dcr2 pfr2;
array CR3 [7] gdr3 hsr3 aar3 bar3 mar3 dcr3 pfr3;
array CR4 [7] gdr4 hsr4 aar4 bar4 mar4 dcr4 pfr4;
array CR5 [7] gdr5 hsr5 aar5 bar5 mar5 dcr5 pfr5;
array CR6 [7] gdr6 hsr6 aar6 bar6 mar6 dcr6 pfr6;
array CRP [7] gdrP hsrP aarP barP marP dcrP pfrP;
array CRC [7] gdrC hsrC aarC barC marC dcrC pfrC;

array e2345 [*] e234501-e234503;
array e2733 [*] e273371-e273375;
array TMPDG [*] TMPDG1-TMPDG3;
array e2346m [*] e234601m e234602m e234603m;
array e2346y [*] e234601y e234602y e234603y;
array t7000 [*] t70001-t70007;

array CDT [7] CDTGD CDTHS CDTAA CDTBA CDTMA CDTDC CDTPF;
array YDT [7] ydtGD ydtHS ydtAA ydtBA ydtMA ydtDC ydtPF;

array HED [7] hedGD hedHS hedAA hedBA hedMA hedDC hedPF;
array FLG [7] flgGD flgHS flgAA flgBA flgMA flgDC flgPF;
array QUX [7] quxGD quxHS quxAA quxBA quxMA quxDC quxPF;
array DEG [7] degGD degHS degAA degBA degMA degDC degPF;


*** Initialize Variables.;

** Set initial values of date of degree received variables to -4. Set all dummies to 0.;
FLG_13900=0; FLG_COMM=0;
deg_unknown=0;
ged_trn=0;
do i=1 to 7;
CRC(i)=-4; CDT(i)=-4;
DEG(i)=0; FLG(i)=0; QUX(i)=0; HED(i)=0;
end;

** Set all variables that were not created in earlier rounds (rather were created but were missing for all Respondents and so were not included in the dataset) as -4 and if the Respondent was not interviewed as -5.;

aar1=-4; bar1=-4; mar1=-4; dcr1=-4; pfr1=-4;
aar2=-4; bar2=-4; mar2=-4; dcr2=-4; pfr2=-4;
mar3=-4; dcr3=-4; pfr3=-4;
mar4=-4; dcr4=-4; pfr4=-4;
mar5=-4; dcr5=-4; pfr5=-4;
dcr6=-4; pfr6=-4;

if gdr1=-5 then do; aar1=-5; bar1=-5; mar1=-5; dcr1=-5; pfr1=-5; end;
if gdr2=-5 then do; aar2=-5; bar2=-5; mar2=-5; dcr2=-5; pfr2=-5; end;
if gdr3=-5 then do; mar3=-5; dcr3=-5; pfr3=-5; end;
if gdr4=-5 then do; mar4=-5; dcr4=-5; pfr4=-5; end;
if gdr5=-5 then do; mar5=-5; dcr5=-5; pfr5=-5; end;
if gdr6=-5 then do; dcr6=-5; pfr6=-5; end;

*** Identify the latest date of degree received variables from previous rounds.;
do i=1 to 7;
if CR6(i)~=-5 then CRP(i)=CR6(i);
if CR6(i)=-5 then do;
if CR5(i)~=-5 then CRP(i)=CR5(i);
if CR5(i)=-5 then do;
if CR4(i)~=-5 then CRP(i)=CR4(i);
if CR4(i)=-5 then do;
if CR3(i)~=-5 then CRP(i)=CR3(i);
if CR3(i)=-5 then do;
if CR2(i)~=-5 then CRP(i)=CR2(i);
if CR2(i)=-5 then do;
CRP(i)=CR1(i);
end;
end;
end;
end;
end;
end;


*** Create the date of degree received variables using information from current round only
Note: The earlier code would not let a bad date be overwritten with a good one. So, we changed it.
The old code is at the end of the program.;

** Compute the date of receiving GED.;
if e13300=-3 then gdrC=-3;
if e13300=1 and gdrC<0 then do;
gdrC=-3;
if e13500m>0 and e13500y>0 then gdrC=(e13500y-1980)*12+e13500m;
if e13500m in (-4,0) or e13500y in (-4,0) then quxGD=1;
end;

** Compute the date of receiving HS Diploma.;
if e11700=-3 then hsrC=-3;
if e11700=1 and hsrC<0 then do;
hsrC=-3;
if e11900m>0 and e11900y>0 then hsrC=(e11900y-1980)*12+e11900m;
if e11900m in (-4,0) or e11900y in (-4,0) then quxHS=1;
end;

** Compute the dates of receiving GED, AA, BA/BS, MA/MS/MBA/MSW, Ph.D. and MS/LLD/DDS/JD.;
do j=1 to dim(TMPDG);
if e2345(j)=1 then TMPDG(j)=3; /* Associate/Junior College or two-year associate degree (AA) */
if e2345(j)=3 then TMPDG(j)=4; /* Bachelor's degree (BA, BS or unspecified) */
if e2345(j)=4 then TMPDG(j)=5; /* Master's degree (MA, MBA, MS, MSW) */
if e2345(j)=5 then TMPDG(j)=6; /* Doctoral Degree (Ph.D.) */
if e2345(j)=6 then TMPDG(j)=7; /* Professional Degree (MD, LLD, DDS, JD) */
if e2345(j)=9 then TMPDG(j)=2; /* GED */
end;
do j=1 to dim(TMPDG);
do i=2 to 7;
if TMPDG(j)=i and CRC(i)<0 then do;
CRC(i)=-3;
if e2346m(j)>0 & e2346y(j)>0 then CRC(i)=(e2346y(j)-1980)*12+e2346m(j);
if e2346m(j) in (-4,0) | e2346y(j) in (-4,0) then QUX(i)=1;
end;
end;
if e2345(j) in (8,999,-1,-2,-3) then deg_unknown=1;
end;

** Compute the date of receiving GED if respondent completes GED in a training program. Set the date to -3 because we don't know completion date. Do not, however, overwrite a good date.;
do k=1 to dim(t7000);
if GDRC=-4 and t7000(k)=4 then do;
GDRC=-3;
ged_trn=1;
end;
end;

*** Convert all -1 & -2s to -3.;
do i=1 to 7;
if CRP(i) in (-1,-2) then CRP(i)=-3;
if CRC(i) in (-1,-2) then CRC(i)=-3;
end;


*** Check if there is some conflict between information from the current round and that available from previous rounds.;
do i=1 to 7;
if CRC(i)>0 and CRP(i)>0 & CRC(i)~=CRP(i) then FLG(i)=1;
if CRP(i)>0 and CRC(i)=-3 then FLG(i)=2;
if CRC(i)>0 and CRP(i)=-3 then FLG(i)=3;
end;


*** Merge the results from previous rounds.;
** If more than one date is available for any degree then that is a problem.;
do i=1 to 7;
if FLG(i)=0 then do;
if CRP(i)~=-4 then CDT(i)=CRP(i);
if CRC(i)~=-4 then CDT(i)=CRC(i);
end;
end;
** If two dates of receipt are available for any degree--one from previous rounds and one from this--then resolve the conflict. To resolve the conflict.:
(i) Use the date reported in the earlier round if both dates are valid. If Associates or higher have two valid dates then that is not necessarily a data or questionnaire mistake. A person may have received the same type of degree in different majors. But it is a data inconsistency issue if the Respondent reported receiving the same type of degree in the same major from the same institution. These cases must be further investigated.
(ii) Use only the valid date if only one of them is a valid date.;
do i=1 to 7;
if FLG(i) in (1,2) then CDT(i)=CRP(i);
if FLG(i)=3 then CDT(i)=CRC(i);
end;


* If the Respondent reports receiving a highest degree in YSCH-3113 (first asked in Round 7) that is greater than what he/she reported as receiving elsewhere in the questionnaire, it was decided not to use information from YSCH-3113 unless it helped to resolve any kind of conflicting information;


*** START of Handedits;
** HANDEDIT (1): These Respondents reported attending college even though they had no GED or H.S. Diploma. They were asked how this happened in YSCH-13900. If their answer was that they had a GED or H. S. Diploma and gave a date, then that date was used as their CDTGD. If they said they received sometime earlier but the date of receipt could not be ascertained, then CDTGD=-3. Of course a -3 is never overwritten a valid date.;
if PUBID in (83 662 815 1271 1409 1754 1934 2360 2422 2456 2645 3167 3372 3808 4148 4151 4177 4248 4287 4349 4435 4444 4451 4532 4652 4655 4864 4958 5177 5587 5648 5962 6146 6338 6467 6960 7070 7131 7471 7765 7833 8091 8296 8497 8698 8828) & CDTGD<=0 then do;
CDTGD=-3;
FLG_13900=1;
hedGD=1;
end;

** HANDEDIT (2): These Respondents reported receiving GED in earlier rounds but commented in YSCH-13900 that they had not as yet received it. Some of them also reported working towards a GED in YSCH-27337. For such cases their prior GED receipt information was deleted.;
if PUBID in (3301 5039 6505 6936 7391) then do;
CDTGD=-4;
FLG_13900=1;
hedGD=1;
end;

** HANDEDIT (3) : Incorporating additional information from "comments." Note: valid dates are NEVER over-written by bad dates.;
if PUBID=1200 then do; CDTHS=-4; CDTGD=264; FLG_COMM=1; hedHS=1; hedGD=1; end;
if PUBID=1001 then do; CDTGD=-3; FLG_COMM=1; hedGD=1; end;
if PUBID=3723 then do; CDTGD=-4; FLG_COMM=1; hedGD=1; end;
if PUBID=8294 then do; CDTHS=-4; CDTGD=272; FLG_COMM=1; hedHS=1; hedGD=1; end;
if PUBID=8300 then do; CDTHS=270; FLG_COMM=1; hedHS=1; end;
if PUBID=8294 then do; CDTHS=-4; CDTGD=269; FLG_COMM=1; hedHS=1; hedGD=1; end;
if PUBID=1867 then do; CDTHS=258; FLG_COMM=1; hedHS=1; end;
if PUBID=7202 then do; CDTHS=269; FLG_COMM=1; hedHS=1; end;

* These Respondents reported receiving a GED in this round but reported in "comments" that they were waiting for their results. Their GED receipt information was also deleted.;
if PUBID in (5299 2911 7743) then do;
CDTGD=-4;
FLG_COMM=1;
hedGD=1;
end;

* This Respondent reported that he/she has his/her credits but has to fulfill the requirements of his/her field work and so the degree will come in March, 2004 when he/she passes this section. Therefore, Bachelor's receipt information is deleted.;
if PUBID=6190 then do;
CDTBA=-4;
FLG_COMM=1;
hedBA=1;
end;

* PUBID=5183. This Respondent reported that he/she was working towards a MA degree and expected to complete it in January of 2004. However, in comments for that question he/she reported "completed aug2003". Then in comments for terms required to complete the program he/she reported "fall of 1999 to spring 2003." Again in comments for whether has been enrolled continuously in that school he/she reported yes "but not currently." The Respondent also reported that the highest degree received was a BA, but he/she did not report any date of receipt. It was concluded that that R received a BA degree in Aug 2003 and as of the current interview date i.e., Dec 2003, the Respondent was not currently enrolled - basically no more classes to take waiting for MA degree (in January 2004). Perhaps this was some kind of an integrated BA & MA program.;
if PUBID=5183 then do;
CDTBA=284;
FLG_COMM=1;
hedBA=1;
end;

ENDSAS;

Return to top


Number of Grades Repeated or Skipped

Variables Created: 

Variables Used

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

Round 1     Round 7     Round 7 con't  
intd_r1 YINF-900_D   e2857 YSCH-2857   e9946111 YSCH-9946.01.01.01
intm_r1 YINF-900_M   e3102 YSCH-3102   e9946112 YSCH-9946.01.01.02
inty_r1 YINF-900_Y   e3103 YSCH-3103   e9946113 YSCH-9946.01.01.03
e3500_r1 YSCH-3500   e3104 YSCH-3104   e9946114 YSCH-9946.01.01.04
e3900_r1 YSCH-3900   e3010 YSCH-3010   e9946211 YSCH-9946.02.01.01
e4000_r1 YSCH-4000   e3061 YSCH-3061   e9946212 YSCH-9946.02.01.02
e5000_r1 YSCH-5000   e3112 YSCH-3112   e9946213 YSCH-9946.02.01.03
NUMREP_r1 CV_GRADES_REPEAT_EVER   e3878 YSCH-3878   e10099111m YSCH-10099.01.01.01~M
NUMSKIP_r1 CV_GRADE_SKIPPED_EVER   e841611 YSCH-8416.01.01   e10099111y YSCH-10099.01.01.01~Y
HGCr1_symbol COMPLETED   e841612 YSCH-8416.01.02   e10099112m YSCH-10099.01.01.02~M
      e841621 YSCH-8416.02.01   e10099112y YSCH-10099.01.01.02~Y
Round 2     e841622 YSCH-8416.02.02   e10099113m YSCH-10099.01.01.03~M
intd_r2 SYMBOL!CURDATE~D   e841631 YSCH-8416.03.01   e10099113y YSCH-10099.01.01.03~Y
intm_r2 SYMBOL!CURDATE~M   e872211 YSCH-8722.01.01   e10099114m YSCH-10099.01.01.04~M
inty_r2 SYMBOL!CURDATE~Y   e872221 YSCH-8722.02.01   e10099114y YSCH-10099.01.01.04~Y
NUMREP_r2 CV_GRADES_REPEAT_EVER   e872231 YSCH-8722.03.01   e10099211m YSCH-10099.02.01.01~M
NUMREPj_r2 CV_GRADES_REPEAT_YR   e877411m YSCH-8774.01.01~M   e10099211y YSCH-10099.02.01.01~Y
NUMSKIP_r2 CV_GRADE_SKIPPED_EVER   e877411y YSCH-8774.01.01~Y   e10099212m YSCH-10099.02.01.02~M
NUMSKIPj_r2 CV_GRADE_SKIPPED_YR   e877412m YSCH-8774.01.02~M   e10099212y YSCH-10099.02.01.02~Y
      e877412y YSCH-8774.01.02~Y   e10099213m YSCH-10099.02.01.03~M
Round 3     e877421m YSCH-8774.02.01~M   e10099213y YSCH-10099.02.01.03~Y
intd_r3 SYMBOL!CURDATE~D   e877421y YSCH-8774.02.01~Y   pubid PUBID
intm_r3 SYMBOL!CURDATE~M   e877422m YSCH-8774.02.02~M   intd SYMBOL!CURDATE~D
inty_r3 SYMBOL!CURDATE~Y   e877422y YSCH-8774.02.02~Y   intm SYMBOL!CURDATE~M
NUMREP_r3 CV_GRADES_REPEAT_EVER   e897711 YSCH-8977.01.01   inty SYMBOL!CURDATE~Y
NUMREPj_r3 CV_GRADES_REPEAT_YR   e897721 YSCH-8977.02.01   pregrdin SYMBOL!PREV!GRADE_IN
NUMSKIP_r3 CV_GRADE_SKIPPED_EVER   e897722 YSCH-8977.02.02   prehga SYMBOL!PREV!HGA
NUMSKIPj_r3 CV_GRADE_SKIPPED_YR   e897731 YSCH-8977.03.01   ENROLL CV_ENROLLSTAT
      e913111 YSCH-9131.01.01      
Round 4     e913112 YSCH-9131.01.02   Roster Data:  
intd_r4 SYMBOL!CURDATE~D   e913121 YSCH-9131.02.01   scode1 NEWSCHOOL_SCHCODE.01
intm_r4 SYMBOL!CURDATE~M   e913122 YSCH-9131.02.02   scode2 NEWSCHOOL_SCHCODE.02
inty_r4 SYMBOL!CURDATE~Y   e913131 YSCH-9131.03.01   scode3 NEWSCHOOL_SCHCODE.03
NUMREP_r4 CV_GRADES_REPEAT_EVER   e933511m YSCH-9335.01.01~M   scode4 NEWSCHOOL_SCHCODE.04
NUMREPj_r4 CV_GRADES_REPEAT_YR   e933511y YSCH-9335.01.01~Y   scode5 NEWSCHOOL_SCHCODE.05
NUMSKIP_r4 CV_GRADE_SKIPPED_EVER   e933512m YSCH-9335.01.02~M   strt11m NEWSCHOOL_START1.01~M
NUMSKIPj_r4 CV_GRADE_SKIPPED_YR   e933512y YSCH-9335.01.02~Y   strt11y NEWSCHOOL_START1.01~Y
      e933521m YSCH-9335.02.01~M   strt12m NEWSCHOOL_START1.02~M
Round 5     e933521y YSCH-9335.02.01~Y   strt12y NEWSCHOOL_START1.02~Y
intd_r5 SYMBOL!CURDATE~D   e933522m YSCH-9335.02.02~M   strt13m NEWSCHOOL_START1.03~M
intm_r5 SYMBOL!CURDATE~M   e933522y YSCH-9335.02.02~Y   strt13y NEWSCHOOL_START1.03~Y
inty_r5 SYMBOL!CURDATE~Y   e933531m YSCH-9335.03.01~M   strt14m NEWSCHOOL_START1.04~M
NUMREP_r5 CV_GRADES_REPEAT_EVER   e933531y YSCH-9335.03.01~Y   strt14y NEWSCHOOL_START1.04~Y
NUMREPj_r5 CV_GRADES_REPEAT_YR   e9589111 YSCH-9589.01.01.01   strt15m NEWSCHOOL_START1.05~M
NUMSKIP_r5 CV_GRADE_SKIPPED_EVER   e9589112 YSCH-9589.01.01.02   strt15y NEWSCHOOL_START1.05~Y
NUMSKIPj_r5 CV_GRADE_SKIPPED_YR   e9589113 YSCH-9589.01.01.03   strt21m NEWSCHOOL_START2.01~M
      e9589114 YSCH-9589.01.01.04   strt21y NEWSCHOOL_START2.01~Y
Round 6     e9589211 YSCH-9589.02.01.01   strt22m NEWSCHOOL_START2.02~M
intd_r6 SYMBOL!CURDATE~D   e9589212 YSCH-9589.02.01.02   strt22y NEWSCHOOL_START2.02~Y
intm_r6 SYMBOL!CURDATE~M   e9589213 YSCH-9589.02.01.03   strt31m NEWSCHOOL_START3.01~M
inty_r6 SYMBOL!CURDATE~Y   e9691111m YSCH-9691.01.01.01~M   strt31y NEWSCHOOL_START3.01~Y
NUMREP_r6 CV_GRADES_REPEAT_EVER   e9691111y YSCH-9691.01.01.01~Y   stop11m NEWSCHOOL_STOP1.01~M
NUMREPj_r6 CV_GRADES_REPEAT_YR   e9691112m YSCH-9691.01.01.02~M   stop11y NEWSCHOOL_STOP1.01~Y
NUMSKIP_r6 CV_GRADE_SKIPPED_EVER   e9691112y YSCH-9691.01.01.02~Y   stop12m NEWSCHOOL_STOP1.02~M
NUMSKIPj_r6 CV_GRADE_SKIPPED_YR   e9691113m YSCH-9691.01.01.03~M   stop12y NEWSCHOOL_STOP1.02~Y
      e9691113y YSCH-9691.01.01.03~Y   stop13m NEWSCHOOL_STOP1.03~M
      e9691114m YSCH-9691.01.01.04~M   stop13y NEWSCHOOL_STOP1.03~Y
      e9691114y YSCH-9691.01.01.04~Y   stop14m NEWSCHOOL_STOP1.04~M
      e9691211m YSCH-9691.02.01.01~M   stop14y NEWSCHOOL_STOP1.04~Y
      e9691211y YSCH-9691.02.01.01~Y   stop15m NEWSCHOOL_STOP1.05~M
      e9691212m YSCH-9691.02.01.02~M   stop15y NEWSCHOOL_STOP1.05~Y
      e9691212y YSCH-9691.02.01.02~Y   stop21m NEWSCHOOL_STOP2.01~M
      e9691213m YSCH-9691.02.01.03~M   stop21y NEWSCHOOL_STOP2.01~Y
      e9691213y YSCH-9691.02.01.03~Y   stop22m NEWSCHOOL_STOP2.02~M
      e9793111 YSCH-9793.01.01.01   stop22y NEWSCHOOL_STOP2.02~Y
            stop31m NEWSCHOOL_STOP3.01~M
            stop31y NEWSCHOOL_STOP3.01~Y

As in rounds 4-6, we are not using the read-in symbol variable for the first grade the youths enrolled; instead, we are using YSCH-8416.01.01. The reason for this is that, in round 2 and round 3, we ask the question YSCH-8263 ("Is this a DLI school") and YSCH-3401 ("Is this the first enrollment period") if Respondents answer "yes" to YSCH-8263. So only the people who are not in the first enrollment period go on to question YSCH-8416.01.01. But in round 4 and following, we don't ask question YSCH-3401 anymore, so even though a youth was in the first enrollment period of DLI school, we still go on to YSCH-8416.01.01. In this case, we use YSCH-8416.01.01 for the first grade attended rather than the symbol variable read in from the previous rounds.


***** PROGRAM STARTS;

if e3500_r1>=0 then HGAr1=e3500_r1;
if e4000_r1>=0 then HGAr1=e4000_r1;

if e5000_r1>=0 then HGCr1=e5000_r1;
if HGCr1_symbol>=0 then HGCr1=HGCr1_symbol;

* Computer problem in entering data.;
if PUBID=1868 then do; e877411y=2002; end;
if PUBID=8294 then do; e877411m=8; end;
if PUBID=2649 then do; e877411m=9; end;
if PUBID=2748 then do; e877411y=2002; end;
if PUBID=3440 then do; e877411m=8; end;
if PUBID=3557 then do; e877411y=2001; end;
if PUBID=3751 then do; e877411y=2002; end;
if PUBID=3853 then do; e877411m=8; e877411y=2002; end;
if PUBID=4941 then do; e877411m=9; end;
if PUBID=5544 then do; e877411y=2002; end;
if PUBID=6179 then do; e877411y=2002; end;
if PUBID=8457 then do; e877411m=8; end;
if PUBID=8699 then do; e877411y=2002; end;
if PUBID=8933 then do; e877411m=8; end;
if PUBID=9002 then do; e877411m=8; end;
if PUBID=2649 then do; e877411m=9; e933511m=5; end;
if PUBID=4573 then do; e933511y=2001; end;
if PUBID=4848 then do; e933511y=1999; end;

* This Respondent reported he/she graduated in June 2003 but had reported in Round 6 that he/she had received H. S. Diploma in June 2002. It was concluded that Respondent meant 2002 and not 2003.;
if PUBID=3779 then do; e933511y=2002; end;
if PUBID=6697 then do; stop12y=2002; e877421y=2002; end;
if PUBID=6063 then do; stop11m=8; end;
if PUBID=2435 then do; strt12m=8; strt12y=2001; stop12y=2001; end;
if PUBID=8938 then do; strt11y=2001; end;
if PUBID=8112 then do; strt11m=1; strt11y=2003; end;
if PUBID=8055 then do; stop11m=9; end;
if PUBID=6697 then do; strt12y=2002; stop12y=2002; end;

* Respondent reported he/she was not enrolled in that school after Nov 2002 (DLI=Jan 2003).;
if PUBID=4310 then do;
e3877=0;
e3878=0;
e933511m=-4;
e933511y=-4;
e841611=-4;
e913111=-4;
scode1=-4;
strt11m=-4; strt11y=-4;
stop11m=-4; stop11y=-4;
end;

* When asked which country the school was in, the Respondent reported that he/she did not attend. He/she stopped attending right after DLI--that very month--and so he/she is seen as attending at DLI, but then when asked the follow-up questions about grade attending, etc., he/she reported grade attended 0, completed but did not know the dates, etc. It was concluded that this case was to be treated as if the Respondent had not been enrolled at DLI and had never been enrolled since.;
if PUBID=446 then do;
scode1=-4;
strt11m=-4;
strt11y=-4;
stop11m=-4;
stop11y=-4;
e841611=-4;
e3878=0;
FLG_COMM=1;
handedit=1;
end;


** Compute interview dates in cumulative months;
if inty>0 & intm>0 then doicm=((inty-1980)*12)+intm;

** Create new array of start dates for first school depending on whether the Respondent corrected the roster data;

array strtm (*) strt11m strt12m strt13m ; * Start month from roster;
array strty (*) strt11y strt12y strt13y ; * Start year from roster;
array e8722 (*) e872211 e872221 e872231 ; * Verify start date;
array e8774m (*) e877411m e877421m e877431m; * Corrected start month;
array e8774y (*) e877411y e877421y e877431y; * Corrected start year;
array startm (*) start1m start2m start3m ; * Correct start month, created;
array starty (*) start1y start2y start3y ; * Correct start year, created;

numstart=0;
do i=1 to dim(strtm);
if e8774m(i)>0 and e8774y(i)>0 then do;
startm(i)=e8774m(i);
starty(i)=e8774y(i);
end;
else if e8774m(i)<=0 or e8774y(i)<=0 or e8722(i)=1 then do;
startm(i)=strtm(i);
starty(i)=strty(i);
numstart=numstart+1;
end;
end;


** Create arrays of grades attended, start dates, whether the grades were completed and completion dates;

* Grade attended;
array gr_attd (*) e841611 e841612 e841621 e841622 e841631
e9589111 e9589112 e9589113 e9589114
e9589211 e9589212 e9589213;

* Completed - yes/no;
array gr_comp (*) e913111 e913112 e913121 e913122 e913131
e9946111 e9946112 e9946113 e9946114
e9946211 e9946212 e9946213;

* Date of grade completion - month;
array cdate_m (*) e933511m e933512m e933521m e933522m e933531m
e10099111m e10099112m e10099113m e10099114m
e10099211m e10099212m e10099213m;

* Date of grade completion - year;
array cdate_y (*) e933511y e933512y e933521y e933522y e933531y
e10099111y e10099112y e10099113y e10099114y
e10099211y e10099212y e10099213y;

* Date of grade enrollment/start - month;
array sdate_m (*) start1m e877412m start2m e877422m start3m
e9691111m e9691112m e9691113m e9691114m
e9691211m e9691212m e9691213m;

* Date of grade enrollment/start - year;
array sdate_y (*) start1y e877412y start2y e877422y start3y
e9691111y e9691112y e9691113y e9691114y
e9691211y e9691212y e9691213y;

** Create arrays of all grades attended and completed and their start and complete dates;

* Assign GRA the number of elements in the new grades array to be created.;
GRA=9;

* Grade attended;
array attd (9) attd1-attd9;

* Grade completed;
array comp (9) comp1-comp9;

* Date of grade enrollment/start - month;
array stmo (9) stmo1-stmo9;

* Date of grade enrollment/start - year;
array styr (9) styr1-styr9;

* Date of grade completion - month;
array cpmo (9) cpmo1-cpmo9;

* Date of grade completion - year;
array cpyr (9) cpyr1-cpyr9;


** Set all new array variables to -4;
do i=1 to GRA;
stmo(i)=-4;
styr(i)=-4;
cpmo(i)=-4;
cpyr(i)=-4;
comp(i)=-4;
attd(i)=-4;
end;


** Record all grades completed and their completion dates;
j=1;
do i= 1 to dim(gr_attd);
if gr_comp(i)=1 and gr_attd(i) not in (-4,-5) then do;
comp(j)=gr_attd(i);
cpmo(j)=cdate_m(i);
cpyr(j)=cdate_y(i);
j=j+1;
end;
end;

** Record all grades attended and their start dates;
k=1;
flag1=0;
if e913111 not in (-4,-5) then do;
if e841611 not in (-4,-5) then do;
attd(k)=e841611;
if start1M>0 then stmo(k)=start1M;
if start1Y>0 then styr(k)=start1Y;
if e877411m=-4 and e877411y=-4 and strt11m=-4 and strt11y=-4 then flag1=1;
k=k+1;
end;
do i=2 to dim(gr_attd);
if gr_comp(i)~=-4 and gr_comp(i)~=. then do;
attd(k)=gr_attd(i);
stmo(k)=sdate_m(i);
styr(k)=sdate_y(i);
k=k+1;
end;
end;
end;


** Create date in continuous months for each start and complete date in arrays;

* Date of grade completion in continuous month scheme;
array cpcm (9) cpcm1-cpcm9;

* Date of grade enrollment/start in continuous month scheme;
array stcm (9) stcm1-stcm9;

do i=1 to GRA;
if cpyr(i)>0 and cpmo(i)>0 then cpcm(i)=((cpyr(i)-1980)*12)+cpmo(i);
else if cpyr(i) in (-1, -2, -3) or cpmo(i) in (-1, -2, -3) then cpcm(i)=-3;
else if cpyr(i)=-4 or cpmo(i)=-4 then cpcm(i)=-4;
if styr(i)>0 and stmo(i)>0 then stcm(i)=((styr(i)-1980)*12)+stmo(i);
else if styr(i) in (-1, -2, -3) or stmo(i) in (-1, -2, -3) then stcm(i)=-3;
else if styr(i)=-4 or stmo(i)=-4 then stcm(i)=-4;
end;


** Create new arrays of started and completed grades that have grades listed only once and in the correct order and report only the latest completion date;

* Completed grade and date of grade completion when grades have been listed only once and in order;
array NCOMP (9) NCOMP1-NCOMP9;
array NCDAT (9) NCDAT1-NCDAT9;

NCOMP1=comp1;
NCDAT1=cpcm1;
reorder=0;

** 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 GRA;
if comp(i)>0 then do;
if comp(i)=NCOMP1 and cpcm(i)>NCDAT1 then NCDAT1=cpcm(i);
else if comp(i)<NCOMP1 then do;
NCOMP1=comp(i);
NCDAT1=cpcm(i);
reorder=reorder+1;
end;
end;
end;

do j=2 to GRA;
do i=1 to GRA;
if NCOMP(j-1)~=. then do;
if comp(i)=NCOMP(j-1) and cpcm(i)>NCDAT(j-1) then NCDAT(j-1)=cpcm(i);
else if comp(i)=NCOMP(j-1)+1 then do;
NCOMP(j)=comp(i);
NCDAT(j)=cpcm(i);
end;
else if NCOMP(j)=. and comp(i)>NCOMP(j-1) then do;
NCOMP(j)=comp(i);
NCDAT(j)=cpcm(i);
reorder=reorder+1;
end;
end;
end;
end;

** Create a new array with all grades attended in order and an array with the earliest date each grade was started;

* Intermediate variables;
array tmpattd (9) tmpattd1-tmpattd9;
array tmpadat (9) tmpadat1-tmpadat9;

* Grades attended and the start dates for enrollment in these grades in proper order;
array NATTD (9) NATTD1-NATTD9;
array NADAT (9) NADAT1-NADAT9;


do i=1 to GRA;
tmpattd(i)=attd(i);
tmpadat(i)=stcm(i);
end;

i=1;
k=1;
do i=1 to GRA;
do j=i+1 to GRA;
if tmpattd(j)~=-4 then do;
if tmpattd(j)<tmpattd(i) and tmpattd(i)>0 and tmpattd(j)>0 then do;
att_temp=tmpattd(i);
dat_temp=tmpadat(i);
tmpattd(i)=tmpattd(j);
tmpadat(i)=tmpadat(j);
tmpattd(j)=att_temp;
tmpadat(j)=dat_temp;
reorder=reorder+1;
end;
end;
end;
if i=1 then do;
NATTD(k)=tmpattd(i);
NADAT(k)=tmpadat(i);
end;
if tmpattd(i)=NATTD(k) then do;
if (0<tmpadat(i)<NADAT(k)) or (NADAT(k)=-4 and tmpadat(i)>0) then do;
NADAT(k)=tmpadat(i);
end;
else if tmpadat(i) in (-1,-2,-3) or NADAT(k) in (-1,-2,-3) then NADAT(k)=-3;
end;
else if tmpattd(i)>NATTD(k) then do;
k=k+1;
NATTD(k)=tmpattd(i);
NADAT(k)=tmpadat(i);
end;
end;

** Compute the last enrollment date - stopdate;

* School stop date - month;
array stopm (8) stop11m stop21m stop31m stop12m stop22m stop13m stop14m stop15m;

* School stop date - month;
array stopy (8) stop11y stop21y stop31y stop12y stop22y stop13y stop14y stop15y;

* School stop date in continuous month scheme;
array stopd (8) stopd11 stopd21 stopd31 stopd12 stopd22 stopd13 stopd14 stopd15;

* School code;
array scode (8) scode1 scode1 scode1 scode2 scode2 scode3 scode4 scode5;

do i=1 to dim(stopm);
if stopy(i)>0 and stopm(i)>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;
if scode1 in (1,2,3) then stopdate=stopd11;
do i=2 to dim(stopm);
if scode(i) in (1,2,3) and stopd(i)>stopdate then stopdate=stopd(i);
end;
end;
else if ENROLL=1 then stopdate=-4;


** Compute end dates for attended grades. Find the end date for each grade attended
- if Respondent doesn't give a completion date then:
(a) choose the month before they started the next grade,
(b) if there is not another grade and currently enrolled then take the interview date,
(c) if there is not another grade and not currently enrolled then take the last stop date - stopdate,
(d) if the enrollment date for the grade is the last interview date then take the next June.;

** Date of completion/stop attending a grade;
array NEDAT (9) NEDAT1-NEDAT9;

** Flags of grade completion;
array ISCOM (9) ISCOM1-ISCOM9;

do i=1 to GRA;
if NATTD(i)~=. then ISCOM(i)=0;
end;

endimp=0;

do i=1 to GRA;
do j=1 to GRA;
if NATTD(i)=NCOMP(j) and NATTD(i)>0 then do;
NEDAT(i)=NCDAT(j);
ISCOM(i)=1;
end;
end;
if NATTD(i)~=. and NEDAT(i)=. and NADAT(i)~=PRbfint and NADAT(i)~=NADAT(i+1)
and NADAT(i+1)~=. then do;
NEDAT(i)=NADAT(i+1)-1;
endimp=1;
end;
else if NATTD(i)~=. and NEDAT(i)=. and NATTD(i+1)=. and ENROLL=1 then do;
NEDAT(i)=doicm;
endimp=1;
end;
else if NATTD(i)~=. and NEDAT(i)=. and NATTD(i+1)=. and ENROLL=0 then do;
NEDAT(i)=stopdate;
endimp=1;
end;
else if NEDAT(i)=. and NADAT(i)=PRbfint then do;
endimp=1;
if NADAT(i)<=210 then NEDAT(i)=210;
else if 211<=NADAT(i)<=222 then NEDAT(i)=222;
else if 223<=NADAT(i)<=234 then NEDAT(i)=234;
else if 235<=NADAT(i)<=246 then NEDAT(i)=246;
else if 247<=NADAT(i)<=258 then NEDAT(i)=258;
else if 259<=NADAT(i)<=270 then NEDAT(i)=270;
else if 271<=NADAT(i)<=282 then NEDAT(i)=282;
else if 283<=NADAT(i)<=294 then NEDAT(i)=294;
end;
end;


** Delete the grades whose information is repeatedly reported in the current round: If a grade is reported in the previous rounds and was completed, then don't repeat this grade's info in this round;

* Assign GRB the number of elements in this array of grades.;
GRB=15;

* The grade attended up to the previous round in order;
array PRbfat (15) PRbfat1-PRbfat15;

* Enrollment dates for grade attended up to the previous round in order;
array PRbfst (15) PRbfst1-PRbfst15;

* Stop dates for grade attended up to the previous round in order;
array PRbfed (15) PRbfed1-PRbfed15;

* Flag to indicate whether the grade was completed or not for grades attended up to the previous round in order;
array PRbfcp (15) PRbfcp1-PRbfcp15;

* Intermediate variables;
array tmp2att (9) tmp2att1-tmp2att9;

do i=1 to GRA;
tmp2att(i)=NATTD(i);
end;

backcut=0;
ncut=0;
backrep=0;

do i=1 to GRA;
do j=1 to GRB;
if 0<tmp2att(i)<13 and tmp2att(i)=PRbfat(j) and PRbfcp(j)=1 then do;
j=GRB;
backcut=1;
ncut=ncut+1;
do k=i+1-ncut to GRA-ncut;
if NATTD(k+1)~=. then do;
NATTD(k)=NATTD(k+1);
NADAT(k)=NADAT(k+1);
NEDAT(k)=NEDAT(k+1);
ISCOM(k)=ISCOM(k+1);
end;
else do;
NATTD(k)=.;
NADAT(k)=.;
NEDAT(k)=.;
ISCOM(k)=0;
k=GRA-ncut;
end;
end;
end;
end;
end;

if 0<NATTD1<13 then do;
do i=1 to GRB;
if PRbfat(i)>=NATTD1 then do;
if PRbfat(i+1)~=. then backrep=1;
if PRbfcp(i)=1 then backrep=2;
end;
end;
end;


** Flag the cases where the reported grades are jumping;

badpre=0;
replace=0;
jumprep1=0;
jumprep2=0;
jumpge21=0;
jumpge22=0;

if PRbfat1~=. then do;
do i=1 to (GRB-1);
if PRbfat(i)~=. and PRbfat(i+1)=. then do;
lphigh=PRbfat(i);
lphighst=PRbfst(i);
lphighed=PRbfed(i);
lphighcp=PRbfcp(i);
lpnum=i;
i=GRB;
end;
end;
end;
else lphigh=-5;

if 0<NATTD1<13 then do;
if (lphigh~=-5 and ((NATTD1=lphigh+1 and lphighcp~=1) or NATTD1>lphigh+1)) then jumprep1=1;
if (lphigh=-5 and ((HGCr1>0 and NATTD1>=HGCr1+2) or (HGAr1>0 and NATTD1>=HGAr1+2)))
then jumprep2=1;
if (lphigh~=-5 and NATTD1>=lphigh+2) then jumpge21=1;
if (lphigh=-5 and HGCr1>0 and NATTD1>=HGCr1+3) then jumpge22=1;
end;


** Substitute start dates in the previous round for first grade in loops;

if 0<NATTD1<13 and PRbfat1~=. then do;
do i=1 to (GRB-1);
if (PRbfst(i)>PRbfed(i) and PRbfed(i)>0) or (PRbfed(i)>PRbfst(i+1) and PRbfst(i+1)>0)
or (PRbfst(i+1)>PRbfed(i+1) and PRbfed(i+1)>0) then do;
NADAT1=-3;
badpre=1;
end;
else if PRbfat(i)=NATTD1 and PRbfat(i+1)=. and PRbfcp(i)=0 and badpre~=1 then do;
NADAT1=PRbfst(i);
replace=1;
end;
end;
end;
else if -4<NATTD1<=0 then NADAT1=-3;


***** Create the Grades Skipped and Grades Repeated Variables.;

** Measure the length of time that a Respondent was in each completed grade and then count the number of grades skipped and repeated;

array lengtha (9) length1-length9;

REPEAT=0;
REPEATj=0;
skipleng=0;
skipl_j=0;
SKIP=-16;
SKIPj=-16;
oldstrt=0;
nocomp=0;

do i=1 to (GRA-1);
if 0<NATTD(i)<13 and NEDAT(i)>0 and NADAT(i)>0 then lengtha(i)=NEDAT(i)-NADAT(i);
if 0<NATTD(i)<13 and NADAT(i)<=NEDAT(i)<=NADAT(i+1) and lengtha(i)>13
and NATTD(i+1)-NATTD(i)=1 and REPEAT~=-3 then do;
REPEAT=REPEAT+1;
if i=1 and NADAT(i)<PRbfint then oldstrt=1;
if NEDAT(i)<=282 then REPEATj=REPEATj+1;
end;
else if 0<NATTD(i)<13 and NADAT(i)<=NEDAT(i) and NATTD(i+1)=. and lengtha(i)>13
and REPEAT~=-3 and (ISCOM(i)=1 or e2857=NATTD(i)) then do;
REPEAT=REPEAT+1;
if i=1 and NADAT(i)<PRbfint then oldstrt=1;
if NEDAT(i)<=282 then REPEATj=REPEATj+1;
end;
else if 0<NATTD(i)<13 and NADAT(i)<=NEDAT(i) and NATTD(i+1)=. and lengtha(i)>13
and REPEAT~=-3 and (ISCOM(i)=0 and e2857~=NATTD(i)) then do;
if i=1 and NADAT(i)<PRbfint then oldstrt=1;
REPEAT=-3;
REPEATj=-3;
reason=1;
end;
end;


do i=1 to (GRA-2);
if 0<NATTD(i)<13 and NADAT(i)<NEDAT(i)<NADAT(i+1)<NEDAT(i+1) then do;
if NADAT(i) in (212, 213, 224, 225, 236, 237, 248, 249, 260, 261, 272, 273, 284, 285)
and NADAT(i)~=PRbfint and NATTD(i+1)-NATTD(i)=1 and ISCOM(i+1)=1
and NEDAT(i+1)-NADAT(i)<=12 and NADAT(i+2)-NEDAT(i+1)<=9 then do;
if (i=1 or (i~=1 and NADAT(i)-NEDAT(i-1)<=9)) and skipleng~=-3 then do;
skipleng=skipleng+1;
if NEDAT(i+1)<=282 and skipl_j~=-3 then skipl_j=skipl_j+1;
end;
end;
end;
end;


** Take care of the connection between previous round and current rounds;

connect=0;
if 0<NATTD1<13 and lphigh>0 and NATTD1~=lphigh then do;
if NATTD1-lphigh>1 then connect=1;
if lphighst in (212, 213, 224, 225, 236, 237, 248, 249, 260, 261, 272, 273, 284, 285)
and NEDAT1>=lphighst and NEDAT1-lphighst<=12 then connect=2;
end;
else if 0<NATTD1<13 and lphigh>0 and NATTD1=lphigh and ISCOM1=1 and lphighcp~=1
and PRbfst(lpnum-1)>0 then do;
if PRbfst(lpnum-1) in (212, 213, 224, 225, 236, 237, 248, 249, 260, 261, 270, 272, 282, 284)
and NEDAT1>=PRbfst(lpnum-1) and NEDAT1-PRbfst(lpnum-1)<=12 then connect=3;
end;

** Check for Respondents who completely skip (do not attend) a grade;

skipgr=0;
skipgrj=0;
skipgt2=0;

do i=1 to (GRA-1);
if 0<NATTD(i)<13 and NATTD(i+1)-NATTD(i)=2 and NEDAT(i)>0 and NADAT(i+1)>0
and NADAT(i+1)-NEDAT(i)<=9 and skipgr~=-3 then do;
skipgr=skipgr+1;
if NEDAT(i+1)<=282 then skipgrj=skipgrj+1;
end;
else if 0<NATTD(i)<13 and NATTD(i+1)-NATTD(i)=3 and NEDAT(i)>0 and NADAT(i+1)>0
and NADAT(i+1)-NEDAT(i)<=9 then do;
skipgr=skipgr+2;
if NEDAT(i+1)<=282 then skipgrj=skipgrj+2;
end;
else if 0<NATTD(i)<13 and NATTD(i+1)-NATTD(i)>3 and NEDAT(i)>0 and NADAT(i+1)>0
and NADAT(i+1)-NEDAT(i)<=9 then do;
skipgt2=1;/* 2 cases, created variables are already -3 for them.*/
end;
end;


** Set REPEAT and SKIP to -3 if allmess=1 or if backrep>0 or if jumprep=1 or if zerograd=1 or negdate=1;
allmess=0;
do i=1 to (GRA-1);
if 0<NATTD(i)<13 and (NADAT(i)>NEDAT(i) and NEDAT(i)>0)
or (NEDAT(i)>NADAT(i+1) and NADAT(i+1)>0)
or (NADAT(i+1)>NEDAT(i+1) and NEDAT(i+1)>0) then do;
allmess=1;
end;
end;

zerograd=0;
do i=1 to GRA;
if NATTD(i)=0 then zerogrd=1;
end;

negdate=0;
do i=1 to GRA;
if 0<NATTD(i)<13 and NEDAT(i) in (-1,-2,-3) or NADAT(i) in (-1,-2,-3) then negdate=1;
end;

if allmess=1 or backrep>0 or zerograd=1 or jumprep1=1 or jumprep2=1 or negdate=1 then do;
REPEAT=-3;
REPEATj=-3;
SKIP=-3;
SKIPj=-3;
end;

if allmess=1 then reason=2.1;
if backrep>0 then reason=2.2;
if zerograd=1 then reason=2.3;
if jumprep1=1 then reason=2.4;
if jumprep2=1 then reason=2.5;
if negdate=1 then reason=2.6;


** Flag Respondents who report skipping a grade and those who say they did not skip grade;

array whyskip (*) e897711 e897721 e897722 e897731 e9793111;

skipques=0;
do i=1 to dim(whyskip);
if whyskip(i)=1 then skipques=1;
end;

notskip=0;
do i=1 to dim(whyskip);
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~=-3 then do;
if (skipques=0 and skipleng=0 and skipgr=0) or (notskip>=1 and skipques=0) then SKIP=0;
else if skipleng=-3 and (skipgr=0 or skipques=0) then do;
SKIP=-3;
reason=3;
end;
else if skipgr=-3 and skipleng=0 then do;
SKIP=-3;
reason=4;
end;
else if skipleng>=1 then SKIP=skipleng;
else if skipques>=1 and skipgr>=1 then SKIP=skipgr;

else if skipques>=1 and skipgr=0 then do;
SKIP=-3;
reason=5;
end;
else if skipques=0 and skipgr>=1 then do;
SKIP=-3;
reason=6;
end;
if skipques=-3 or skipgr=-3 or skipleng=-3 then do;
SKIP=-3;
reason=7;
end;
end;

if SKIPj~=-3 then do;
if (skipl_j=0 and skipgrj=0) or (notskip>=1 and skipques=0) then SKIPj=0;
else if skipl_j=-3 and (skipgrj=0 or skipques=0) then do;
SKIP=-3;
reason=8;
end;
else if skipgrj=-3 and skipl_j=0 then do;
SKIPj=-3;
reason=9;
end;
else if skipl_j>=1 then SKIPj=skipl_j;
else if skipques>=1 and skipgrj>=1 then SKIPj=skipgrj;

else if skipques>=1 and skipgrj=0 then do;
SKIPj=-3;
reason=10;
end;
else if skipques=0 and skipgrj>=1 then do;
SKIPj=-3;
reason=11;
end;
if SKIP=-3 then do;
SKIPj=-3;
reason=12;
end;
end;

** Take care of the cases whose "repeated grade" could be double counted;

if oldstrt=1 and REPEAT>0 and PRbfrpev>0 and PRbf2857~=-5 then do;
do i=1 to (GRA-1);
if 0<NATTD1<13 and PRbfat(i)=NATTD1 and PRbfat(i+1)=. and (PRbfed(i)-PRbfst(i))>13 and
(PRbfcp(i)=1 or PRbf2857=PRbfat(i)) then do;
REPEAT=REPEAT-1;
if NEDAT1<=282 then REPEATj=REPEATj-1;
double_repeat=1;
end;
end;
end;

** HANDEDIT: This Respondent skipped grades from 10 to 12 in Round 6, but did not complete grade 12 by the time of DLI (Dec 2002). In this Round he/she reported being enrolled in grade 11 from Dec 2002 and completing it in June 2003 and then enrolling in grade 12 in August 2003. He/she reported that he/she did not complete that grade as of the current interview (Dec 2003).;
if PUBID=2968 then do;
REPEAT=-3;
REPEATj=-3;
SKIP=-3;
SKIPj=-3;
reason=13;
end;


** Do not compute any of the repeat or skip variables for those who were in college at DLI.;
if encatP in (2,3,4,5,6,7,9,10,11) then do;
REPEAT=0;
REPEATj=0;
skipleng=0;
skipl_j=0;
SKIP=0;
SKIPj=0;
oldstrt=0;
nocomp=0;
end;

** Combine previous and current round information.;

if PRbfrpev>=0 and REPEAT>=0 then NUMREP=PRbfrpev+REPEAT;
else if PRbfrpev<0 then NUMREP=PRbfrpev;
else if PRbfrpev>=0 and REPEAT<0 then NUMREP=REPEAT;

if PRbfrpev>=0 and REPEATj>=0 then NUMREPj=PRbfrpev+REPEATj;
else if PRbfrpev<0 then NUMREPj=PRbfrpev;
else if PRbfrpev>=0 and REPEATj<0 then NUMREPj=REPEATj;

if PRbfskev>=0 and SKIP>=0 then NUMSKIP=PRbfskev+SKIP;
else if PRbfskev<0 then NUMSKIP=PRbfskev;
else if PRbfskev>=0 and SKIP<0 then NUMSKIP=SKIP;

if PRbfskev>=0 and SKIP>=0 then NUMSKIPj=PRbfskev+SKIPj;
else if PRbfskev<0 then NUMSKIPj=PRbfskev;
else if PRbfskev>=0 and SKIPj<0 then NUMSKIPj=SKIPj;

** If the created variables were invalid in prior rounds then so will they be in this round.;
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;

** Take care of valid skips.;
if NUMREP_r1=-4 then do;
NUMSKIP=-4;
NUMREP=-4;
NUMSKIPj=-4;
NUMREPj=-4;
end;

** Take care of non-interviews.;
if e3104=-5 then do;
NUMSKIP=-5;
NUMREP=-5;
NUMSKIPj=-5;
NUMREPj=-5;
end;
 

endsas;


Return to top

Number of Schools Attended

Variables Created:

Variables Used

Name in Program Question Name on CD   Name in Program Question Name on CD
CURGDR1 YSCH_3500_1997   S9589114 YSCH-9589.01.01.04
HGAR2 YSCH_2857_1998   S9589211 YSCH-9589.02.01.01
HGAR3 YSCH_2857_1999   S9589212 YSCH-9589.02.01.02
HGAR4 YSCH_2857_2000   S9589213 YSCH-9589.02.01.03
HGAR5 YSCH_2857_2001   schint1 NEWSCHOOL_INTERVIEW.01
HGAR6 YSCH_2857_2002   schint2 NEWSCHOOL_INTERVIEW.02
HGAR7 YSCH_2857_2003   schint3 NEWSCHOOL_INTERVIEW.03
NUMR1 CV_SCH_ATTEND_EVER_1997   schint4 NEWSCHOOL_INTERVIEW.04
NUMR2 CV_SCH_ATTEND_EVER_1998   schint5 NEWSCHOOL_INTERVIEW.05
NUMR3 CV_SCH_ATTEND_EVER_1999   SCHID1 NEWSCHOOL_PUBID.01
NUMR4 CV_SCH_ATTEND_EVER_2000   SCHID2 NEWSCHOOL_PUBID.02
NUMR5 CV_SCH_ATTEND_EVER_2001   SCHID3 NEWSCHOOL_PUBID.03
NUMR6 CV_SCH_ATTEND_EVER_2002   SCHID4 NEWSCHOOL_PUBID.04
S826311 YSCH-8263.01.01   SCHID5 NEWSCHOOL_PUBID.05
S826312 YSCH-8263.01.02   START1M NEWSCHOOL_START1.01~M
S826321 YSCH-8263.02.01   START1Y NEWSCHOOL_START1.01~Y
S826322 YSCH-8263.02.02   START2M NEWSCHOOL_START1.02~M
S826331 YSCH-8263.03.01   START2Y NEWSCHOOL_START1.02~Y
S841611 YSCH-8416.01.01   START3M NEWSCHOOL_START1.03~M
S841612 YSCH-8416.01.02   START3Y NEWSCHOOL_START1.03~Y
S841621 YSCH-8416.02.01   START4M NEWSCHOOL_START1.04~M
S841622 YSCH-8416.02.02   START4Y NEWSCHOOL_START1.04~Y
S841631 YSCH-8416.03.01   START5M NEWSCHOOL_START1.05~M
S9589111 YSCH-9589.01.01.01   START5Y NEWSCHOOL_START1.05~Y
S9589112 YSCH-9589.01.01.02   SYMGRD SYMBOL!CUR!FIRSTGRADE
S9589113 YSCH-9589.01.01.03      

 This program is used to count the number of regular schools that the youth ever attended as of the survey date and as of June 30, 2003.

The program first counts the number of new regular schools that the youth attended since DLI to the date of survey (June 30, 2003) by the first enrollment date in each new school.  Then, it adds this number to the created variable in the last interview round and get the total number of regular schools that the youth has ever attended to the required date.

When we count the new schools, since we only count the schools from the 7th grade through the12th grade, we need to check if Respondents do go to these grades in the new school before we count it.

If a respondent did not have a parent interview in R1, we lack information on the number of schools attended prior to R1 (if they were enr in a grade>7 in R1). Those respondents receive a -4 in R1 and a -3 in all subsequent rounds for the CVs.

The variables created are as following:
NUMS: Total number of regular schools that youth attended as of the survey date of round 7.
NUMJ: Total number of regular schools that youth attended as of June 30, 2003.

NOTE: Unlike rounds 2-3, in round 4 no grade was read in from previous rounds (in prior numschool CV programs this variable is called "symgrd" and come from symbol!Cur!Firstgrade.01.01). In the present round the first grade from the loop question (S841611) is properly used where "symgrd" was used in the past.


ARRAY STARTM START1M START2M START3M START4M START5M ;
ARRAY STARTY START1Y START2Y START3Y START4Y START5Y ;
ARRAY START START1-START5;
ARRAY schint schint1-schint5;
ARRAY SCHID SCHID1-SCHID5;
ARRAY DUMGRD DUMGRD1-DUMGRD5;
ARRAY AGAIN AGAIN1-AGAIN5;

/*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. 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-DUMGRD5= dummy to indicate whether R attended grades 7-12 in schools 1-5
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 5;
DUMGRD[I]=0;
START[I]=-4;
END;

/* R6 reads-in a grade from the prior schint, 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 ) 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 THEN DUMGRD3=-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 ) 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 THEN DUMGRD3=1;


/*Create a flag (again 1-5) 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 5;
again(i)=0;
end;

do i=1 to 5;

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-startdm5;
do i=1 to 5;
if starty[i]>0 or starty[i] in (-1,-2,-3) then startdm[i]=1;
else startdm[i]=0;
end;


/*Next, calculate NUMJR7 and NUMR7.*/

/* Calculate the accumulated month of the start date. */
DO I=1 TO 5;
IF STARTY[I]>0 AND STARTM[I]>0 THEN START[I]=12*(STARTY[I]-1990)+STARTM[I];
END;

prenum=0;
if NUMR6>0 then prenum= NUMR6;
else if NUMR6 in (-4, -5) and NUMR5>0 then prenum= NUMR5;
else if NUMR6 in (-4, -5) and NUMR5 in (-4, -5) and NUMR4>0 then prenum= NUMR4;
else if NUMR6 in (-4, -5) and NUMR5 in (-4, -5) and NUMR4 in (-4, -5) and NUMR3>0 then prenum= NUMR3;
else if NUMR6 in (-4, -5) and NUMR5 in (-4, -5) and NUMR4 in (-4, -5)
and NUMR3 in (-4, -5) and NUMR2>0 then prenum= NUMR2;
else if NUMR6 in (-4, -5) and NUMR5 in (-4, -5) and NUMR4 in (-4, -5)
and NUMR3 in (-4, -5) and NUMR2 in (-4, -5) and NUMR1>0 then prenum= NUMR1;


NUMJR7=0;
NUMR7=0;
/**** count the new schools for all the cases.*****/
DO I=1 TO 5;
IF schint[I]=7 and again(i)=0 THEN DO;
IF DUMGRD[I]=1 THEN NUMR7=numR7+1;
IF DUMGRD[I]=1 AND (0<START[I]<=162 OR 0<STARTY[I]<2003) THEN NUMJR7=numJR7+1;
END;
END;


if -3<=schint1<=-1 or -3<=schint2<=-1 or -3<=schint3<=-1 or -3<=schint4<=-1 or -3<=schint5<=-1 then do;
numr7=-3;
numjr7=-3;
end;


/**** If the respondent is not interviewed in Round 6 and has no number of schools info. in previous schints, or if number of school info. in round 6 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 (numr6=-5 and numr5 in (0,-4,-5) and numr4 in (0,-4,-5) and numr3 in (0,-4,-5) and numr2 in (0,-4,-5) and numr1 in (0,-4)) or numr6 in (0, -4) then do;
numr7=0;
numjr7=0;
flagprev=1;


do i=1 to 5;
IF DUMGRD[I]=1 and again(i)=0 THEN NUMR7=NUMR7+1;
IF DUMGRD[I]=1 and again(i)=0 AND (0<START[I]<=162 OR 0<STARTY[I]<2003 or (schint[i] in (1,2,3,4) and
again(i)=0)) THEN NUMJR7=NUMJR7+1;
end;
end;


IF DUMGRD1=-3 OR DUMGRD2=-3 OR DUMGRD3=-3 OR DUMGRD4=-3 OR DUMGRD5=-3 THEN DO;
NUMR7=-3;
NUMJR7=-3;
END;
/* if school are rported in round 7*/
IF (schint1=7 AND AGAIN1 =0 AND DUMGRD1=1 AND ((START1Y=2003 AND -4<START1M<0) OR -4<START1Y<0)) OR
(schint2=7 AND AGAIN2 =0 AND DUMGRD2=1 AND ((START2Y=2003 AND -4<START2M<0) OR -4<START2Y<0)) OR
(schint3=7 AND AGAIN3 =0 AND DUMGRD3=1 AND ((START3Y=2003 AND -4<START3M<0) OR -4<START3Y<0)) OR
(schint4=7 AND AGAIN4 =0 AND DUMGRD4=1 AND ((START4Y=2003 AND -4<START4M<0) OR -4<START4Y<0)) OR
(schint5=7 AND AGAIN5 =0 AND DUMGRD5=1 AND ((START5Y=2003 AND -4<START5M<0) OR -4<START5Y<0))

THEN NUMJR7=-3;


/*We then add the above two numbers to the corresponding variables from round 1 to round 5.*/

IF NUMR6>=0 THEN DO;
IF NUMJR7>=0 then NUMJ=NUMJR7+NUMR6;
IF NUMR7>=0 THEN NUMS=NUMR7+NUMR6;
END;

IF NUMR6=-4 and HGAR6<7 THEN DO;
IF NUMJR7>=0 THEN NUMJ=NUMJR7;
IF NUMR7>=0 THEN NUMS=NUMR7;
END;

IF NUMR6=-5 THEN DO;
IF NUMR5>=0 THEN DO;
IF NUMJR7>=0 THEN NUMJ=NUMJR7+NUMR5;
IF NUMR7>=0 THEN NUMS=NUMR7+NUMR5;
END;

ELSE IF NUMR5<0 and NUMR4>=0 THEN DO;
IF NUMJR7>=0 THEN NUMJ=NUMJR7+NUMR4;
IF NUMR7>=0 THEN NUMS=NUMR7+NUMR4;
END;


ELSE IF NUMR4<0 and NUMR3>=0 THEN DO;
IF NUMJR7>=0 THEN NUMJ=NUMJR7+NUMR3;
IF NUMR7>=0 THEN NUMS=NUMR7+NUMR3;
END;

ELSE IF NUMR3<0 and NUMR2>=0 THEN DO;
IF NUMJR7>=0 THEN NUMJ=NUMJR7+NUMR2;
IF NUMR7>=0 THEN NUMS=NUMR7+NUMR2;
END;
ELSE IF NUMR1>=0 AND NUMR2<0 THEN DO;
IF NUMJR7>=0 THEN NUMJ=NUMJR7+NUMR1;
IF NUMR7>=0 THEN NUMS=NUMR7+NUMR1;
END;

else if numr5=-3 then do;
numjr7=-3;
numr7=-3;
end;


else if numr5=-5 and numr4=-3 then do;
numjr7=-3;
numr7=-3;
end;

else if numr5=-5 and numr4=-5 and numr3=-3 then do;
numjr7=-3;
numr7=-3;
end;

else if numr5=-5 and numr4=-5 and numr3=-5 and numr2=-3 then do;
numjr7=-3;
numr7=-3;
end;

else if numr5=-5 and numr4=-5 and numr3=-5 and numr2=-5 and numr1=-3 then do;
numjr7=-3;
numr7=-3;
end;


/*For the youths 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 6 >= 7, we use the number from round 6 as the total number.
2)If the 'grade currently attended' in round 1 >7, we use -4 for the total number.
3)If both the 'grade currently attended' in round 1 and the 'highest grade attended' in round 6 are <7, we use -4 for the total number.*/

IF NUMR1 in (0,-4) and numr6=-5 and numr5=-5 and numr4=-5 and numr3=-5 and numr2=-5 THEN DO;
IF CURGDR1<=7 THEN DO;
NUMJ=NUMJR7;
NUMS=NUMR7;
END;

IF CURGDR1>7 or NUMR1 in (-1,-2,-3) THEN DO;
NUMJ=-3;
NUMS=-3;
END;

IF CURGDR1<7 AND HGAR7<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 NUMR5=-3 OR NUMR6=-3 or NUMJR7=-3 THEN NUMJ=-3;

IF -3<=NUMR1<=-1 OR -3<=NUMR2<=-1 OR NUMR3=-3 OR NUMR4=-3 OR NUMR5=-3 OR NUMR6=-3 or NUMR7=-3 THEN NUMS=-3;

if HGAR7<7 then do;
numj=-4;
nums=-4;
end;


/*IF S826311=-5*/ if int_y=-5 THEN DO;
NUMJR7=-5;
NUMR7=-5;
NUMJ=-5;
NUMS=-5;
END;
 

endsas;


Return to top


Total Fraction of Credits Earned towards Bachelors/Associate Degree

Variables Created: 

Variables Used

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

Previous Rounds     Previous Rounds     Current Round  
e22900r1_1 YSCH-22900.01   e23300r4_4 YSCH-23300.04   e273371 YSCH-27337.01
e16200r1_1 YSCH-16200.01   e23400r4_1 YSCH-23400.01   e273372 YSCH-27337.02
e23100r1_1 YSCH-23100.01   e23400r4_2 YSCH-23400.02   e273373 YSCH-27337.03
e23200r1_1 YSCH-23200.01   e23400r4_3 YSCH-23400.03   e273374 YSCH-27337.04
e23300r1_1 YSCH-23300.01   e23400r4_4 YSCH-23400.04   e273375 YSCH-27337.05
e23400r1_1 YSCH-23400.01   e23450r4_1 YSCH-23450.01   e252971 YSCH-25297.01
asctr1_1 CV_ASSOC_CREDITS   e23450r4_2 YSCH-23450.02   e252972 YSCH-25297.02
bactr1_1 CV_BA_CREDITS   e23450r4_3 YSCH-23450.03   e252973 YSCH-25297.03
doicmr1 CV_INTERVIEW_CMONTH   schidr4_1 NEWSCHOOL_PUBID.01   e252974 YSCH-25297.04
e16200r2_1 YSCH-16200.01   schidr4_2 NEWSCHOOL_PUBID.02   e252975 YSCH-25297.05
e27337r2_1 YSCH-27337.01   schidr4_3 NEWSCHOOL_PUBID.03   e162001 YSCH-16200.01
e27337r2_2 YSCH-27337.02   schidr4_4 NEWSCHOOL_PUBID.04   e265211 YSCH-26521.01
e27337r2_3 YSCH-27337.03   schidr4_5 NEWSCHOOL_PUBID.05   e265212 YSCH-26521.02
e27337r2_4 YSCH-27337.04   asctr4_1 CV_ASSOC_CREDITS.01   e265213 YSCH-26521.03
e27337r2_5 YSCH-27337.05   asctr4_2 CV_ASSOC_CREDITS.02   e265214 YSCH-26521.04
e27388r2_1 YSCH-27388.01   asctr4_3 CV_ASSOC_CREDITS.03   e265215 YSCH-26521.05
e27388r2_2 YSCH-27388.02   asctr4_4 CV_ASSOC_CREDITS.04   xcred1 YSCH-26827.01
e27388r2_3 YSCH-27388.03   bactr4_1 CV_BA_CREDITS.01   xcred2 YSCH-26827.02
e27388r2_4 YSCH-27388.04   bactr4_2 CV_BA_CREDITS.02   xcred3 YSCH-26827.03
e27388r2_5 YSCH-27388.05   bactr4_3 CV_BA_CREDITS.03   xcred4 YSCH-26827.04
e22900r2_1 YSCH-22900.01   bactr4_4 CV_BA_CREDITS.04   xcred5 YSCH-26827.05
e22900r2_2 YSCH-22900.02   doicmr4 CV_INTERVIEW_CMONTH   apcred1 YSCH-26878.01
e22900r2_3 YSCH-22900.03   e16200r5_1 YSCH-16200.01   apcred2 YSCH-26878.02
e22900r2_4 YSCH-22900.04   e27337r5_1 YSCH-27337.01   apcred3 YSCH-26878.03
e22900r2_5 YSCH-22900.05   e27337r5_2 YSCH-27337.02   apcred4 YSCH-26878.04
e23100r2_1 YSCH-23100.01   e27337r5_3 YSCH-27337.03   apcred5 YSCH-26878.05
e23100r2_2 YSCH-23100.02   e27337r5_4 YSCH-27337.04   hscred1 YSCH-26929.01
e23100r2_3 YSCH-23100.03   e27337r5_5 YSCH-27337.05   hscred2 YSCH-26929.02
e23100r2_4 YSCH-23100.04   e27337r5_6 YSCH-27337.06   hscred3 YSCH-26929.03
e23200r2_1 YSCH-23200.01   e27388r5_1 YSCH-27388.01   hscred4 YSCH-26929.04
e23200r2_2 YSCH-23200.02   e27388r5_2 YSCH-27388.02   hscred5 YSCH-26929.05
e23200r2_3 YSCH-23200.03   e27388r5_3 YSCH-27388.03   e273881 YSCH-27388.01
e23200r2_4 YSCH-23200.04   e27388r5_4 YSCH-27388.04   e273882 YSCH-27388.02
e23200r2_5 YSCH-23200.05   e27388r5_5 YSCH-27388.05   e273883 YSCH-27388.03
e23300r2_1 YSCH-23300.01   e27388r5_6 YSCH-27388.06   e273884 YSCH-27388.04
e23300r2_2 YSCH-23300.02   e22900r5_1 YSCH-22900.01   e273885 YSCH-27388.05
e23300r2_3 YSCH-23300.03   e22900r5_2 YSCH-22900.02   e2070011 YSCH-20700.01.01
e23400r2_1 YSCH-23400.01   e22900r5_3 YSCH-22900.03   e2070012 YSCH-20700.01.02
e23400r2_2 YSCH-23400.02   e22900r5_4 YSCH-22900.04   e2070013 YSCH-20700.01.03
e23400r2_3 YSCH-23400.03   e22900r5_5 YSCH-22900.05   e2070014 YSCH-20700.01.04
e23400r2_4 YSCH-23400.04   e22900r5_6 YSCH-22900.06   e2070015 YSCH-20700.01.05
e23400r2_5 YSCH-23400.05   e23100r5_1 YSCH-23100.01   e2070016 YSCH-20700.01.06
e23450r2_1 YSCH-23450.01   e23100r5_2 YSCH-23100.02   e2070017 YSCH-20700.01.07
e23450r2_2 YSCH-23450.02   e23100r5_3 YSCH-23100.03   e2070018 YSCH-20700.01.08
e23450r2_3 YSCH-23450.03   e23100r5_4 YSCH-23100.04   e2070019 YSCH-20700.01.09
e23450r2_4 YSCH-23450.04   e23100r5_5 YSCH-23100.05   e2070021 YSCH-20700.02.01
schidr2_1 NEWSCHOOL_PUBID.01   e23200r5_1 YSCH-23200.01   e2070022 YSCH-20700.02.02
schidr2_2 NEWSCHOOL_PUBID.02   e23200r5_2 YSCH-23200.02   e2070023 YSCH-20700.02.03
schidr2_3 NEWSCHOOL_PUBID.03   e23200r5_3 YSCH-23200.03   e2070024 YSCH-20700.02.04
schidr2_4 NEWSCHOOL_PUBID.04   e23200r5_4 YSCH-23200.04   e2070025 YSCH-20700.02.05
schidr2_5 NEWSCHOOL_PUBID.05   e23200r5_5 YSCH-23200.05   e2070026 YSCH-20700.02.06
schidr2_6 NEWSCHOOL_PUBID.06   e23200r5_6 YSCH-23200.06   e2070027 YSCH-20700.02.07
asctr2_1 CV_ASSOC_CREDITS.01   e23300r5_1 YSCH-23300.01   e2070028 YSCH-20700.02.08
asctr2_2 CV_ASSOC_CREDITS.02   e23300r5_2 YSCH-23300.02   e2070029 YSCH-20700.02.09
asctr2_3 CV_ASSOC_CREDITS.03   e23300r5_3 YSCH-23300.03   e2070031 YSCH-20700.03.01
asctr2_4 CV_ASSOC_CREDITS.04   e23300r5_4 YSCH-23300.04   e2070032 YSCH-20700.03.02
asctr2_5 CV_ASSOC_CREDITS.05   e23300r5_5 YSCH-23300.05   e2070033 YSCH-20700.03.03
bactr2_1 CV_BA_CREDITS.01   e23400r5_1 YSCH-23400.01   e2070041 YSCH-20700.04.01
bactr2_2 CV_BA_CREDITS.02   e23400r5_2 YSCH-23400.02   e2070051 YSCH-20700.05.01
bactr2_3 CV_BA_CREDITS.03   e23400r5_3 YSCH-23400.03   e228001 YSCH-22800.01
bactr2_4 CV_BA_CREDITS.04   e23450r5_1 YSCH-23450.01   e228002 YSCH-22800.02
bactr2_5 CV_BA_CREDITS.05   e23450r5_2 YSCH-23450.02   e228003 YSCH-22800.03
doicmr2 CV_INTERVIEW_CMONTH   e23450r5_3 YSCH-23450.03   e228004 YSCH-22800.04
e16200r3_1 YSCH-16200.01   e23450r5_4 YSCH-23450.04   e228005 YSCH-22800.05
e27337r3_1 YSCH-27337.01   e23450r5_5 YSCH-23450.05   e229001 YSCH-22900.01
e27337r3_2 YSCH-27337.02   e23450r5_6 YSCH-23450.06   e229002 YSCH-22900.02
e27337r3_3 YSCH-27337.03   schidr5__1 NEWSCHOOL_PUBID.01   e229003 YSCH-22900.03
e27337r3_4 YSCH-27337.04   schidr5__2 NEWSCHOOL_PUBID.02   e229004 YSCH-22900.04
e27337r3_5 YSCH-27337.05   schidr5__3 NEWSCHOOL_PUBID.03   e229005 YSCH-22900.05
e27388r3_1 YSCH-27388.01   schidr5__4 NEWSCHOOL_PUBID.04   e231001 YSCH-23100.01
e27388r3_2 YSCH-27388.02   schidr5__5 NEWSCHOOL_PUBID.05   e231002 YSCH-23100.02
e27388r3_3 YSCH-27388.03   schidr5__6 NEWSCHOOL_PUBID.06   e231003 YSCH-23100.03
e27388r3_4 YSCH-27388.04   asctr5_1 CV_ASSOC_CREDITS.01   e231004 YSCH-23100.04
e27388r3_5 YSCH-27388.05   asctr5_2 CV_ASSOC_CREDITS.02   e231005 YSCH-23100.05
e22900r3_1 YSCH-22900.01   asctr5_3 CV_ASSOC_CREDITS.03   e232001 YSCH-23200.01
e22900r3_2 YSCH-22900.02   asctr5_4 CV_ASSOC_CREDITS.04   e232002 YSCH-23200.02
e22900r3_3 YSCH-22900.03   asctr5_5 CV_ASSOC_CREDITS.05   e232003 YSCH-23200.03
e22900r3_4 YSCH-22900.04   asctr5_6 CV_ASSOC_CREDITS.06   e233001 YSCH-23300.01
e23100r3_1 YSCH-23100.01   bactr5_1 CV_BA_CREDITS.01   e233002 YSCH-23300.02
e23100r3_2 YSCH-23100.02   bactr5_2 CV_BA_CREDITS.02   e233003 YSCH-23300.03
e23100r3_3 YSCH-23100.03   bactr5_3 CV_BA_CREDITS.03   e233004 YSCH-23300.04
e23200r3_1 YSCH-23200.01   bactr5_4 CV_BA_CREDITS.04   e233005 YSCH-23300.05
e23200r3_2 YSCH-23200.02   bactr5_5 CV_BA_CREDITS.05   e234001 YSCH-23400.01
e23200r3_3 YSCH-23200.03   bactr5_6 CV_BA_CREDITS.06   e234002 YSCH-23400.02
e23200r3_4 YSCH-23200.04   doicmr5 CV_INTERVIEW_CMONTH   e234003 YSCH-23400.03
e23300r3_1 YSCH-23300.01   e27337r6_1 YSCH-27337.01   e234501 YSCH-23450.01
e23300r3_2 YSCH-23300.02   e27337r6_2 YSCH-27337.02   e234502 YSCH-23450.02
e23300r3_3 YSCH-23300.03   e27337r6_3 YSCH-27337.03   e234503 YSCH-23450.03
e23400r3_1 YSCH-23400.01   e27337r6_4 YSCH-27337.04   SCHID_1 NEWSCHOOL_PUBID.01
e23400r3_2 YSCH-23400.02   e27337r6_5 YSCH-27337.05   SCHID_2 NEWSCHOOL_PUBID.02
e23400r3_3 YSCH-23400.03   e16200r6_1 YSCH-16200.01   SCHID_3 NEWSCHOOL_PUBID.03
e23400r3_4 YSCH-23400.04   e27388r6_1 YSCH-27388.01   SCHID_4 NEWSCHOOL_PUBID.04
e23450r3_1 YSCH-23450.01   e27388r6_2 YSCH-27388.02   SCHID_5 NEWSCHOOL_PUBID.05
e23450r3_2 YSCH-23450.02   e27388r6_3 YSCH-27388.03   scode1 NEWSCHOOL_SCHCODE.01
e23450r3_3 YSCH-23450.03   e27388r6_4 YSCH-27388.04   scode2 NEWSCHOOL_SCHCODE.02
schidr3_1 NEWSCHOOL_PUBID.01   e27388r6_5 YSCH-27388.05   scode3 NEWSCHOOL_SCHCODE.03
schidr3_2 NEWSCHOOL_PUBID.02   e22900r6_1 YSCH-22900.01   scode4 NEWSCHOOL_SCHCODE.04
schidr3_3 NEWSCHOOL_PUBID.03   e22900r6_2 YSCH-22900.02   scode5 NEWSCHOOL_SCHCODE.05
schidr3_4 NEWSCHOOL_PUBID.04   e22900r6_3 YSCH-22900.03   NORCID NORCID
schidr3_5 NEWSCHOOL_PUBID.05   e22900r6_4 YSCH-22900.04   pubid PUBID
schidr3_6 NEWSCHOOL_PUBID.06   e22900r6_5 YSCH-22900.05   intd SYMBOL!CURDATE~D
schidr3_7 NEWSCHOOL_PUBID.07   e23100r6_1 YSCH-23100.01   intm SYMBOL!CURDATE~M
asctr3_1 CV_ASSOC_CREDITS.01   e23100r6_2 YSCH-23100.02   inty SYMBOL!CURDATE~Y
asctr3_2 CV_ASSOC_CREDITS.02   e23100r6_3 YSCH-23100.03      
asctr3_3 CV_ASSOC_CREDITS.03   e23100r6_4 YSCH-23100.04      
asctr3_5 CV_ASSOC_CREDITS.05   e23200r6_1 YSCH-23200.01      
bactr3_1 CV_BA_CREDITS.01   e23200r6_2 YSCH-23200.02      
bactr3_2 CV_BA_CREDITS.02   e23200r6_3 YSCH-23200.03      
bactr3_3 CV_BA_CREDITS.03   e23200r6_4 YSCH-23200.04      
bactr3_4 CV_BA_CREDITS.04   e23200r6_5 YSCH-23200.05      
bactr3_5 CV_BA_CREDITS.05   e23300r6_1 YSCH-23300.01      
doicmr3 CV_INTERVIEW_CMONTH   e23300r6_2 YSCH-23300.02      
e16200r4_1 YSCH-16200.01   e23300r6_3 YSCH-23300.03      
e27337r4_1 YSCH-27337.01   e23300r6_4 YSCH-23300.04      
e27337r4_2 YSCH-27337.02   e23400r6_1 YSCH-23400.01      
e27337r4_3 YSCH-27337.03   e23400r6_2 YSCH-23400.02      
e27337r4_4 YSCH-27337.04   e23400r6_3 YSCH-23400.03      
e27388r4_1 YSCH-27388.01   e23400r6_4 YSCH-23400.04      
e27388r4_2 YSCH-27388.02   e23450r6_1 YSCH-23450.01      
e27388r4_3 YSCH-27388.03   e23450r6_2 YSCH-23450.02      
e27388r4_4 YSCH-27388.04   e23450r6_3 YSCH-23450.03      
e22900r4_1 YSCH-22900.01   e23450r6_5 YSCH-23450.05      
e22900r4_2 YSCH-22900.02   schidr6_1 NEWSCHOOL_PUBID.01      
e22900r4_3 YSCH-22900.03   schidr6_2 NEWSCHOOL_PUBID.02      
e22900r4_4 YSCH-22900.04   schidr6_3 NEWSCHOOL_PUBID.03      
e23100r4_1 YSCH-23100.01   schidr6_4 NEWSCHOOL_PUBID.04      
e23100r4_2 YSCH-23100.02   asctr6_1 CV_ASSOC_CREDITS.01      
e23100r4_3 YSCH-23100.03   asctr6_2 CV_ASSOC_CREDITS.02      
e23100r4_4 YSCH-23100.04   asctr6_3 CV_ASSOC_CREDITS.03      
e23200r4_1 YSCH-23200.01   asctr6_4 CV_ASSOC_CREDITS.04      
e23200r4_2 YSCH-23200.02   bactr6_1 CV_BA_CREDITS.01      
e23200r4_3 YSCH-23200.03   bactr6_2 CV_BA_CREDITS.02      
e23200r4_4 YSCH-23200.04   bactr6_3 CV_BA_CREDITS.03      
e23300r4_1 YSCH-23300.01   bactr6_4 CV_BA_CREDITS.04      
e23300r4_2 YSCH-23300.02   bactr6_5 CV_BA_CREDITS.05      
e23300r4_3 YSCH-23300.03   doicmr6 CV_INTERVIEW_CMONTH      

This program calculates fraction of credits earned toward a bachelor's degree (CV_BA_CREDITS) and fraction of credits earned toward a associate's degree (CV_ASSOC_CREDITS) for round 7.


** Arrays defined for the created variables of interest - henceforth referred to as CV;
array asfrac (5) asfrac1-asfrac5; * Created variable: fraction credits earned for associate credits;
array bafrac (5) bafrac1-bafrac5; * Created variable: fraction credits earned for bachelor credits;


*** Arrays defined for Rounds 1-6 variables;
array asctr2 (*) asctr2_1-asctr2_6; * Fraction of credits earned towards Associate's Degree in Round2;
array bactr2 (*) bactr2_1-bactr2_6; * Fraction of credits earned towards Bachelor's Degree in Round2;
array asctr3 (*) asctr3_1-asctr3_6; * Fraction of credits earned towards Associate's Degree in Round3;
array bactr3 (*) bactr3_1-bactr3_6; * Fraction of credits earned towards Bachelor's Degree in Round3;
array asctr4 (*) asctr4_1-asctr4_6; * Fraction of credits earned towards Associate's Degree in Round4;
array bactr4 (*) bactr4_1-bactr4_6; * Fraction of credits earned towards Bachelor's Degree in Round4;
array asctr5 (*) asctr5_1-asctr5_6; * Fraction of credits earned towards Associate's Degree in Round5;
array bactr5 (*) bactr5_1-bactr5_6; * Fraction of credits earned towards Bachelor's Degree in Round5;
array asctr6 (*) asctr6_1-asctr6_6; * Fraction of credits earned towards Associate's Degree in Round6;
array bactr6 (*) bactr6_1-bactr6_6; * Fraction of credits earned towards Bachelor's Degree in Round6;

array e27388r2 (*) e27388r2_1-e27388r2_6; * Total credits needed for graduation in Round2;
array e27388r3 (*) e27388r3_1-e27388r3_6; * Total credits needed for graduation in Round3;
array e27388r4 (*) e27388r4_1-e27388r4_6; * Total credits needed for graduation in Round4;
array e27388r5 (*) e27388r5_1-e27388r5_6; * Total credits needed for graduation in Round5;
array e27388r6 (*) e27388r6_1-e27388r6_6; * Total credits needed for graduation in Round6;

array tasctr2 (*) tasctr2_1-tasctr2_6; * Total credits towards Associate's Degree earned in Round2;
array tbactr2 (*) tbactr2_1-tbactr2_6; * Total credits towards Bachelor's Degree earned in Round2;
array tasctr3 (*) tasctr3_1-tasctr3_6; * Total credits towards Associate's Degree earned in Round3;
array tbactr3 (*) tbactr3_1-tbactr3_6; * Total credits towards Bachelor's Degree earned in Round3;
array tasctr4 (*) tasctr4_1-tasctr4_6; * Total credits towards Associate's Degree earned in Round4;
array tbactr4 (*) tbactr4_1-tbactr4_6; * Total credits towards Bachelor's Degree earned in Round4;
array tasctr5 (*) tasctr5_1-tasctr5_6; * Total credits towards Associate's Degree earned in Round5;
array tbactr5 (*) tbactr5_1-tbactr5_6; * Total credits towards Bachelor's Degree earned in Round5;
array tasctr6 (*) tasctr6_1-tasctr6_6; * Total credits towards Associate's Degree earned in Round6;
array tbactr6 (*) tbactr6_1-tbactr6_6; * Total credits towards Bachelor's Degree earned in Round6;

array schidr2 (6) schidr2_1-schidr2_6; * School public id of schools attended in Round 2;
array schidr3 (6) schidr3_1-schidr3_6; * School public id of schools attended in Round 3;
array schidr4 (6) schidr4_1-schidr4_6; * School public id of schools attended in Round 4;
array schidr5 (6) schidr5_1-schidr5_6; * School public id of schools attended in Round 5;
array schidr6 (6) schidr6_1-schidr6_6; * School public id of schools attended in Round 6;

* Note: There are a maximum of seven schools reported in Round 3. There was only one R who reported a seventh school and that was a high school. Since high schools are not relevant for this program, the seventh school was not included in the arrays that would have unnecessary increased the number of elements in these arrays.;

*** Arrarys defined for Round 7 variables;

array e22800 (5) e228001-e228005; * Total no. of credits earned;
array e23000 (5) e230001-e230005; * (Corrected) Total no. of credits earned;
array e27337 (5) e273371-e273375; * Type of diploma working towards;
array e27388 (5) e273881-e273885; * Total credits required to earn the degree;

array e26521 (5) e265211-e265215; * Total no. of incoming credits - those reporting any such credits are asked to break that up into the three following categories.;
array xcred (5) xcred1-xcred5; * Transfer credits;
array hscred (5) hscred1-hscred5; * Credits from High School;
array apcred (5) apcred1-apcred5; * Test credits;

array e23200 (5) e232001-e232005; * 1-0: R needs or does not need any more credits to graduate;
array e23400 (5) e234001-e234005; * Total no. credits still needed to graduate (asked if e23200=1);
array e25297 (5) e252971-e252975; * CAPI check (1-0): Is this a DLI school?;
array SCHID (5) SCHID_1-SCHID_5; * School public id of schools attended in Round 7;
array scode (5) scode1-scode5; * School code - type of school or college;

*** Arrays defined for intermediate variables created;
array tcred (5) tcred1-tcred5; * Total credits (not fraction) earned;
array tbac (5) tbac1-tbac5; * Total credits (not fraction) earned towards BA degree;
array tasc (5) tasc1-tasc5; * Total credits (not fraction) earned towards assoc degree;
array noterm (5) noterm1-noterm5; * 1: If the Respondent attended but did not complete any term;
array tncred (5) tncred1-tncred5; * Sum of transfer, H.S. and A.P. (test) credits;
array flag (5) flag1-flag5; * 1: If tncred is not equal to e26521.;
array crcred (5) crcred1-crcred5; * 1: If the CV is computed using current credits, case 1;
array incred (5) incred1-incred5; * 1: If the CV is computed using incoming credits, case 2;
array dlcred (5) dlcred1-dlcred5; * 1: If the CV is computed using DLI credits, case 3;
array errci (5) errci1-errci5; * 1: If both CRCRED and INCRED are 1;
array errcd (5) errcd1-errcd5; * 1: If both CRCRED and DLCRED are 1;
array errdi (5) errdi1-errdi5; * 1: If both DLCRED and INCRED are 1;
array ovr (5) ovr1-ovr5; * 1: If CVs are greater than 100;
array same (5) same1-same5; * Identifies the round that the Respondent last attended the college.;
array dgchk (5) dgchk1-dgchk5; * 1: If the Respondent had received a GED or HS Diploma and school code showed that the Respondent was in college but the degree working towards question (e27337) was skipped.;
array dtprb (5) dtprb1-dtprb5; * 1: If the Respondent reported that he/she needed more credits to graduate but when asked how many more was needed he/she reported 0;
array dliprb (5) dliprb1-dliprb5; * 1: If CAPI check shows this is not a DLI school but it actually is.;
array ngrd (5) ngrd1-ngrd5; * 1-2: If the computed CVs are 100 even though YSCH-23200=0. (YSCH-23200: "Does this mean you need no more credits to get the degree you're working toward?" and No=0).;
array miss (5) miss1-miss5; * 1: If the CVs are missing although the Respondent reported attending at least one college;
array nfrct (5) nfrct1-nfrct5; * 1-2: If CVs are greater than 100 and they are recomputed using the sum of total credits and credits remaining in the denominator
instead of total credits required.;
array olfrct (5) olfrct1-olfrct5; * 1-2: If no new term is completed and CVs initially computed this round are greater than 100 and so DLI CVs are used to recompute CVs.;
array nofrct (5) nofrct1-nofrct5; * 1-2: If CVs are greater than 100 and fraction of credits needed to graduate (YSCH-23400) are missing and so CVs cannot be recomputed.;

* Identifying the college that the Respondent reported attending in this round is the same one that the Respondent attended in some earlier round: r57m21 is 1 if the first school on the Round 7 school roster is the same as the second school on the Round 5 school roster and the DLI round is Round 5.;
array r67m (6,5) r67m11-r67m15 r67m21-r67m25 r67m31-r67m35 r67m41-r67m45 r67m51-r67m55 r67m61-r67m65;
array r57m (6,5) r57m11-r57m15 r57m21-r57m25 r57m31-r57m35 r57m41-r57m45 r57m51-r57m55 r57m61-r57m65;
array r47m (6,5) r47m11-r47m15 r47m21-r47m25 r47m31-r47m35 r47m41-r47m45 r47m51-r47m55 r57m61-r57m65;
array r37m (6,5) r37m11-r37m15 r37m21-r37m25 r37m31-r37m35 r37m41-r37m45 r37m51-r37m55 r37m61-r37m65;
array r27m (6,5) r27m11-r27m15 r27m21-r27m25 r27m31-r27m35 r27m41-r27m45 r27m51-r27m55 r27m61-r27m65;

*** Additional arrays defined;
array s (6,6) schidr1_1-schidr1_6 schidr2_1-schidr2_6 schidr3_1-schidr3_6
schidr4_1-schidr4_6 schidr5_1-schidr5_6 schidr6_1-schidr6_6;
array a (6,6) asctr1_1-asctr1_6 asctr2_1-asctr2_6 asctr3_1-asctr3_6
asctr4_1-asctr4_6 asctr5_1-asctr5_6 asctr6_1-asctr6_6;
array b (6,6) bactr1_1-bactr1_6 bactr2_1-bactr2_6 bactr3_1-bactr3_6
bactr4_1-bactr4_6 bactr5_1-bactr5_6 bactr6_1-bactr6_6;
array e (6,6) e27337r2_1-e27337r2_6 e27337r2_1-e27337r2_6 e27337r3_1-e27337r3_6
e27337r4_1-e27337r4_6 e27337r5_1-e27337r5_6 e27337r6_1-e27337r6_6;

*** Other intermediate variables created;
* DLI: Identifies the DLI Round;
* over100: 1 if there is any ovr>=1;
* noptgrad: 1 if there is any ngrd>=1;




***** Main Program Starts:

/*******************************************************************************************************
If a Respondent completed at least one term, CAPI verified the total credits for each school in YSCH-22800. Due to a design error, the check question YSCH-22800 does not include Round 2 college credits even when the SCHIDs from both rounds match. However, if a Respondent saw this incorrect count and reported the correct one, the latter is used. Respondents who have yet to complete a term at a given college were not asked YSCH-22800. The only credits possible for these people are incoming credits at YSCH-26521, or the DLI Round created variable for a matching school.

There are 3 ways to compute credits in this program, which are all mutually exclusive (except for 1 exception mentioned below):
Case 1: If the Respondent completed any terms, YSCH-22800 or YSCH-23000 is used.
Case 2: If the Respondent has not completed any term and reported a new school, then the incoming credits (YSCH-26521) are used. If no terms are completed then YSCH-22800 is not asked. YSCH-26521 is asked only if a new college is reported. For school #1 YSCH-16200 is used.
Case 3: If the Respondent has not completed any terms and reported a DLI school, then the total credit from the DLI round (through the SCHID match variable described below) is used.
********************************************************************************************************/

do i=1 to 5;
if e27337(i) in (1,3) and e22800(i)=-4 and e23000(i)=-4 then noterm(i)=1;
end;

do i=1 to 5;
if xcred(i)=>0 & hscred(i)=>0 & apcred(i)=>0 then tncred(i)=xcred(i)+hscred(i)+apcred(i);
if e26521(i)=>0 & tncred(i)=>0 & e26521(i)~=tncred(i) then flag(i)=1;
end;

do i=1 to 5;
if e23200(i)=0 & e23400(i)=0 then dtprb(i)=1;
end;


*** Case 1;

do i=1 to 5;
if e22800(i)>-4 then do;
tcred(i)=e22800(i);
crcred(i)=1;
end;
if e23000(i)>-4 then do;
tcred(i)=e23000(i);
crcred(i)=1;
end;
end;


*** Case 3;

if schidr2_1~=-5 then DLI=2;
if schidr3_1~=-5 then DLI=3;
if schidr4_1~=-5 then DLI=4;
if schidr5_1~=-5 then DLI=5;
if schidr6_1~=-5 then DLI=6;

do i=1 to 5;
do j=1 to 6;
if e25297(i)=0 & SCHID(i)>=0 then do;
if SCHID(i)=schidr6(j) & DLI=6 then dliprb(i)=1;
if SCHID(i)=schidr5(j) & DLI=5 then dliprb(i)=1;
if SCHID(i)=schidr4(j) & DLI=4 then dliprb(i)=1;
if SCHID(i)=schidr3(j) & DLI=3 then dliprb(i)=1;
if SCHID(i)=schidr2(j) & DLI=2 then dliprb(i)=1;
end;
end;
end;

do i=1 to 6;
do j=1 to 5;
if schidr6(i)=SCHID(j) & DLI=6 & SCHID(j)>0 then do;
r67m(i,j)=1;
same(j)=6;
end;
if schidr5(i)=SCHID(j) & DLI=5 & SCHID(j)>0 then do;
r57m(i,j)=1;
same(j)=5;
end;
if schidr4(i)=SCHID(j) & DLI=4 & SCHID(j)>0 then do;
r47m(i,j)=1;
same(j)=4;
end;
if schidr3(i)=SCHID(j) & DLI=3 & SCHID(j)>0 then do;
r37m(i,j)=1;
same(j)=3;
end;
if schidr2(i)=SCHID(j) & DLI=2 & SCHID(j)>0 then do;
r27m(i,j)=1;
same(j)=2;
end;
end;
end;

do i=1 to 6;
if asctr2(i)>=0 then tasctr2(i)=round((asctr2(i)*e27388r2(i)/100),1);
if asctr3(i)>=0 then tasctr3(i)=round((asctr3(i)*e27388r3(i)/100),1);
if asctr4(i)>=0 then tasctr4(i)=round((asctr4(i)*e27388r4(i)/100),1);
if asctr5(i)>=0 then tasctr5(i)=round((asctr5(i)*e27388r5(i)/100),1);
if asctr6(i)>=0 then tasctr6(i)=round((asctr6(i)*e27388r6(i)/100),1);

if bactr2(i)>=0 then tbactr2(i)=round((bactr2(i)*e27388r2(i)/100),1);
if bactr3(i)>=0 then tbactr3(i)=round((bactr3(i)*e27388r3(i)/100),1);
if bactr4(i)>=0 then tbactr4(i)=round((bactr4(i)*e27388r4(i)/100),1);
if bactr5(i)>=0 then tbactr5(i)=round((bactr5(i)*e27388r5(i)/100),1);
if bactr6(i)>=0 then tbactr6(i)=round((bactr6(i)*e27388r6(i)/100),1);

if asctr2(i)<0 then tasctr2(i)=asctr2(i);
if asctr3(i)<0 then tasctr3(i)=asctr3(i);
if asctr4(i)<0 then tasctr4(i)=asctr4(i);
if asctr5(i)<0 then tasctr5(i)=asctr5(i);
if asctr6(i)<0 then tasctr6(i)=asctr6(i);

if bactr2(i)<0 then tbactr2(i)=bactr2(i);
if bactr3(i)<0 then tbactr3(i)=bactr3(i);
if bactr4(i)<0 then tbactr4(i)=bactr4(i);
if bactr5(i)<0 then tbactr5(i)=bactr5(i);
if bactr6(i)<0 then tbactr6(i)=bactr6(i);
end;

* Note: In order to use the DLI created variables only school matching is required. A matching of the degree working towards is NOT required.;
do i=1 to 6;
do j=1 to 5;
if tasctr2(i)=>0 & r27m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tasctr2(i); dlcred(j)=1; end;
if tbactr2(i)=>0 & r27m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tbactr2(i); dlcred(j)=1; end;
if tasctr3(i)=>0 & r37m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tasctr3(i); dlcred(j)=1; end;
if tbactr3(i)=>0 & r37m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tbactr3(i); dlcred(j)=1; end;
if tasctr4(i)=>0 & r47m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tasctr4(i); dlcred(j)=1; end;
if tbactr4(i)=>0 & r47m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tbactr4(i); dlcred(j)=1; end;
if tasctr5(i)=>0 & r57m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tasctr5(i); dlcred(j)=1; end;
if tbactr5(i)=>0 & r57m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tbactr5(i); dlcred(j)=1; end;
if tasctr6(i)=>0 & r67m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tasctr6(i); dlcred(j)=1; end;
if tbactr6(i)=>0 & r67m(i,j)=1 & e22800(j)=-4 then do; tcred(j)=tbactr6(i); dlcred(j)=1; end;
end;
end;


*** Case 2;

do i=1 to 5;
if e26521(i)>-4 & e22800(i)=-4 & e23000(i)=-4 then do;
tcred(i)=e26521(i);
incred(i)=1;
end;
end;

* Note: 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. This is asked only if a DLI college is reported and the incoming credits reported is refused/dont know.;
if e162001>-4 & e228001=-4 & e230001=-4 then do;
tcred1=e162001;
incred1=2;
end;

* Checking to make sure that the three methods of collecting credit information do not overlap.;
do i=1 to 5;
if crcred(i)=1 & incred(i)=1 then errci(i)=1;
if crcred(i)=1 & dlcred(i)=1 then errcd(i)=1;
if incred(i)=1 & dlcred(i)=1 then errdi(i)=1;
if incred(i)=2 & dlcred(i)=1 then errdi(i)=2;
end;


***** Initialize all CVs.;
do i=1 to 5;
asfrac(i)=0;
bafrac(i)=0;
end;


do i=1 to 5;

* Computation of CV for the Associate's Degree;
if e27337(i)=1 & tcred(i)=>0 then tasc(i)=tcred(i);
if (-4<e27388(i)<0|-4<tcred(i)<0) & e27337(i)=1 then asfrac(i)=-3;
if tasc(i)=>0 & e27388(i)>0 then asfrac(i)=(tasc(i)/e27388(i))*100;
asfrac(i)=round(asfrac(i),1);
* Respondents who say they have graduated;
if e23200(i)=1 & e27337(i)=1 then asfrac(i)=100;

* Computation of CV for the Bachelor's Degree;
if e27337(i)=3 & tcred(i)=>0 then tbac(i)=tcred(i);
if (-4<e27388(i)<0|-4<tcred(i)<0) & e27337(i)=3 then bafrac(i)=-3;
if tbac(i)=>0 & e27388(i)>0 then bafrac(i)=(tbac(i)/e27388(i))*100;
bafrac(i)=round(bafrac(i),1);
* Respondents who say they have graduated;
if e23200(i)=1 & e27337(i)=3 then bafrac(i)=100;

end;


*** Checking for problem cases.;

do i=1 to 5;
if asfrac(i)>100 then ovr(i)=1;
if bafrac(i)>100 then ovr(i)=2;
if ovr(i)>=1 then over100=1;
end;

do i=1 to 5;
if asfrac(i)>=100 & e23200(i)=0 then ngrd(i)=1;
if bafrac(i)>=100 & e23200(i)=0 then ngrd(i)=2;
if ngrd(i)>=1 then notgrad=1;
end;

do i=1 to 5;
if e27337(i)=1 and asfrac(i)=. then miss(i)=1;
if e27337(i)=3 and bafrac(i)=. then miss(i)=2;
end;


** Asfrac or bafrac>=100, which means that they gained more credits than the credits required for the degree (e27388), which means that they claimed that they still need more credits for the degree (e23200=0) we would handle these observations as below:
(a) if e23200=0 and e23400>0, we add up e23400 and (tasc/tbac) the credits the Rs have earned as the total credits required for the degree, and use it without e27388 to calculate the cv.  (33 school 1 R7)
(b) if e23200=0 and e23400<=0, e23450 equals -4. we would give -3 to CV.
(c) For observations that asfrac or bafrac>=100 and they haven't completed any term so we don't have information about e23200 and e23400, use the same fraction as at last round. However if this is a new college then we cannot use this method.
(d) if there are cases with CV>100 even after all these recomputations (a-c) then we give them -3 unless they made some corrections to the credits required to graduate (e23400).;

** Case (a);
do i=1 to 5;
if ngrd(i)=1 & e23400(i)>0 then do;
asfrac(i)=round(100*tasc(i)/(tasc(i)+e23400(i)),1);
nfrct(i)=1;
end;
if ngrd(i)=2 & e23400(i)>0 then do;
bafrac(i)=round(100*tbac(i)/(tbac(i)+e23400(i)),1);
nfrct(i)=2;
end;
end;

** Case (b);
do i=1 to 5;
if ngrd(i)=1 & e23400(i)<=0 then do;
asfrac(i)=-3;
nofrct(i)=1;
end;
if ngrd(i)=2 & e23400(i)<=0 then do;
bafrac(i)=-3;
nofrct(i)=2;
end;
end;


** Case (c);
do i=1 to 5;
if asfrac(i)>100 & e23200(i)=-4 & e23400(i)=-4 then do;
olfrct(i)=1;
do j=1 to 6;
if DLI=j then do;
do k=1 to 6;
if SCHID(i)=s(j,k) & e(j,k)=1 & dlcred(i)=1 then asfrac(i)=a(j,k);
if SCHID(i)=s(j,k) & e(j,k)~=1 & dlcred(i)=1 then asfrac(i)=0;
end;
end;
end;
end;
if bafrac(i)>100 & e23200(i)=-4 & e23400(i)=-4 then do;
olfrct(i)=2;
do j=1 to 6;
if DLI=j then do;
do k=1 to 6;
if SCHID(i)=s(j,k) & e(j,k)=3 & dlcred(i)=1 then bafrac(i)=b(j,k);
if SCHID(i)=s(j,k) & e(j,k)~=3 & dlcred(i)=1 then bafrac(i)=0;
end;
end;
end;
end;
end;


** Case (d);
do i=1 to 5;
if asfrac(i)>100 & e23400(i)>=0 then do;
asfrac(i)=round(100*tasc(i)/(tasc(i)+e23400(i)),1);
nfrct(i)=1;
end;
if asfrac(i)>100 & e23400(i)<0 then do;
asfrac(i)=-3;
nofrct(i)=1;
end;
if bafrac(i)>100 & e23400(i)>=0 then do;
bafrac(i)=round(100*tbac(i)/(tbac(i)+e23400(i)),1);
nfrct(i)=2;
end;
if bafrac(i)>100 & e23400(i)<0 then do;
bafrac(i)=-3;
nofrct(i)=2;
end;
end;


*** If the Respondent is not working towards Associates or Bachelor's degree then CV=-4.;

do i=1 to 5;
if e27337(i)=-4 then do;
asfrac(i)=-4;
bafrac(i)=-4;
end;
if e27337(i)=1 then bafrac(i)=-4;
if e27337(i)=3 then asfrac(i)=-4;
if e27337(i) in (-1,-2,-3) then asfrac(i)=-3;
if e27337(i) in (-1,-2,-3) then bafrac(i)=-3;
end;

*** Some more problem cases. Sometimes the degree working towards question is skipped. If the Respondents have no H.S. Diploma or GED then it is OK, as they may be currently enrolled in school as well as college and are trying to get some extra college credits for later enrollment in college. These
should have CV=-4. However if the Respondents do have at least a H.S. Diploma or GED then it means that they may be legitemately working towards an AA/AS/BA/BS degree. These are the problem cases. Because they got skipped out of the degree working towards question they got skipped out of credits
earned question as well. We code them as -3.;

do i=1 to 5;
if e27337(i)=-4 & scode(i) in (4,5) & (hsd=1|ged=1) then do;
dgchk(i)=1;
bafrac(i)=-3;
asfrac(i)=-3;
end;
end;

endsas;


Return to top


QED Data:  School Size and Student-Teacher Ratio

Variables Created: 

Variables Used

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

e2857 YSCH-2857   strt31m NEWSCHOOL_START3.01~M
e3878 YSCH-3878   strt31y NEWSCHOOL_START3.01~Y
e21625 YSCH-21625   stop11m NEWSCHOOL_STOP1.01~M
pin1 NEWSCHOOL_ID.01   stop11y NEWSCHOOL_STOP1.01~Y
pin2 NEWSCHOOL_ID.02   stop12m NEWSCHOOL_STOP1.02~M
pin3 NEWSCHOOL_ID.03   stop12y NEWSCHOOL_STOP1.02~Y
pin4 NEWSCHOOL_ID.04   stop13m NEWSCHOOL_STOP1.03~M
pin5 NEWSCHOOL_ID.05   stop13y NEWSCHOOL_STOP1.03~Y
scode1 NEWSCHOOL_SCHCODE.01   stop14m NEWSCHOOL_STOP1.04~M
scode2 NEWSCHOOL_SCHCODE.02   stop14y NEWSCHOOL_STOP1.04~Y
scode3 NEWSCHOOL_SCHCODE.03   stop15m NEWSCHOOL_STOP1.05~M
scode4 NEWSCHOOL_SCHCODE.04   stop15y NEWSCHOOL_STOP1.05~Y
scode5 NEWSCHOOL_SCHCODE.05   stop21m NEWSCHOOL_STOP2.01~M
strt11m NEWSCHOOL_START1.01~M   stop21y NEWSCHOOL_STOP2.01~Y
strt11y NEWSCHOOL_START1.01~Y   stop22m NEWSCHOOL_STOP2.02~M
strt12m NEWSCHOOL_START1.02~M   stop22y NEWSCHOOL_STOP2.02~Y
strt12y NEWSCHOOL_START1.02~Y   stop31m NEWSCHOOL_STOP3.01~M
strt13m NEWSCHOOL_START1.03~M   stop31y NEWSCHOOL_STOP3.01~Y
strt13y NEWSCHOOL_START1.03~Y   age SYMBOL!KEY!AGE
strt14m NEWSCHOOL_START1.04~M   race SYMBOL!KEY!RACE
strt14y NEWSCHOOL_START1.04~Y   sex SYMBOL!KEY!SEX
strt15m NEWSCHOOL_START1.05~M   cenreg CV_CENSUS_REGION
strt15y NEWSCHOOL_START1.05~Y   intd SYMBOL!CURDATE~D
strt21m NEWSCHOOL_START2.01~M   intm SYMBOL!CURDATE~M
strt21y NEWSCHOOL_START2.01~Y   inty SYMBOL!CURDATE~Y
strt22m NEWSCHOOL_START2.02~M   pubid PUBID
strt22y NEWSCHOOL_START2.02~Y      

Codes for Created Variable

School Size

Student-teacher ratio

1 = <100
2 = 100-299
3 = 300-499
4 = 500-749
5 = 750-999
6 = 1000+

1 = <14
2 = 14-17
3 = 18-21
4 = 22+

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. */

 

 SCHSIZE=-4;
STUDTEAC=-4;

** Now, create SCHSIZE and STUDTEAC while checking that the grades that the Respondent reports being enrolled in at that school coincides with the grades taught at that school as reported in the QED dataset (GRADSPN).;

ogradspan=gradspan;

if GRADSPAN='"2"' then GRADSPAN='"3"';
if GRADSPAN='"A"' then GRADSPAN='"10"';
if GRADSPAN='"B"'|GRADSPAN='"C"'|GRADSPAN='"D"'|GRADSPAN='"E"'|GRADSPAN='"."' then GRADSPAN='"0"';

** 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;
if GRADSPAN='"10"' then GRADSPN=10;

** When Respondents report being enrolled in a high school and then subsequently being enrolled in a college/university the college information is ignored as the variables created by this program (SCHSIZE and STUDTEAC) refer ONLY to characteristics of the last elementary, middle or high school that the Respondent attended and not to any characteristics of any college that the Respondent may have attended. "HGAFLAG" denotes the cases with college attendance.;

hgaflag=0;
if e2857>12 & PIN>100 & LSCH_CODE in (1,2,3) then do;
e2857=12;
hgaflag=1;
end;

** Check the consistency of grades reported with the grade range of the school reported.;
if GRADSPN ~=. then correct=0;
if 1<=e2857<=3 & GRADSPN in (1,4,5) & GRADSPN not in (6,7,8,9,10) then correct=1;
if 4<=e2857<=6 & GRADSPN in (1,4,5,6) & GRADSPN not in (7,8,9,10) then correct=1;
if 7<=e2857<=8 & GRADSPN in (1,5,6,7,8) & GRADSPN not in (4,9,10) then correct=1;
if e2857=9 & GRADSPN in (1,7,8,9) & GRADSPN not in (4,5,6,10) then correct=1;
if 10<=e2857<=12 & GRADSPN in (1,8,9,10) & GRADSPN not in (4,5,6,7) then correct=1;

** As long as the single item HGA is the same as the HGA at the last high/middle/elementary school reported, the above method of checking the consistency of grades reported with the grade range of the school reported is OK. However, the single item HGA is not always the same as the HGA at the last elementary, middle or high school reported. An alternative method to check the consistency is as given below. When "correct" and "corr" are unequal then these cases need to be checked further and if necessary they are edited by hand. There are only 3 cases of correct=0 & corr=1 & 15 cases of correct=1 & corr=0 and we handedited one of the correct=0 and corr=1 cases to correct=1.;

if GRADSPN ~=. then corr=0;
if GRADSPN=1 & 1<=LSCH_GRADE<=12 then corr=1;
if GRADSPN=4 & 1<=LSCH_GRADE<=6 then corr=1;
if GRADSPN=5 & 1<=LSCH_GRADE<=8 then corr=1;
if GRADSPN=6 & 4<=LSCH_GRADE<=8 then corr=1;
if GRADSPN=7 & 7<=LSCH_GRADE<=9 then corr=1;
if GRADSPN=8 & 7<=LSCH_GRADE<=12 then corr=1;
if GRADSPN=9 & 9<=LSCH_GRADE<=12 then corr=1;
if GRADSPN=10 & 10<=LSCH_GRADE<=12 then corr=1;


** Handedit;
if PUBID=8328 then correct=1;

** If the grades reported in the QED & the NLSY97 do not coincide, both created variables, SCHSIZE and STUDTEAC are coded -3. Otherwise, create them according to the definition provided at the top of the program.;

if STUDRANG=0 then SCHSIZE=1;
if 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 then SCHSIZE=6;
if STUDRANG=7 then SCHSIZE=6;

if NOSTUD>0 & NOTEACH>0 then STUDTEA1=NOSTUD/NOTEACH;
if 0<STUDTEA1<14 then STUDTEAC=1;
if STUDTEA1>=14 & STUDTEA1<18 then STUDTEAC=2;
if STUDTEA1>=18 & STUDTEA1<22 then STUDTEAC=3;
if STUDTEA1>=22 then STUDTEAC=4;

if correct=0|GRADSPN=. then SCHSIZE=-3;
if correct=0|GRADSPN=. then STUDTEAC=-3;
 

 ** It should be made sure that there are not five or less schools in each cell determined by the region/census, type of school, control, school size & the student-teacher ratio to avoid any possibilities of identifying the schools. Assign -3 to the created variables for schools that fall in cells of five or less schools. COUNT is a variable that counts the number of schools in each cell;

if COUNT<=5 then SCHSIZE=-3;
if COUNT<=5 then STUDTEAC=-3;

** If a respondent reports no schools in the Round 7 roster or the only schools in the Round 7 roster are 2 or 4 year universities.;
if PIN=-4 then SCHSIZE=-4;
if PIN=-4 then STUDTEAC=-4;

** Those not interviewed in Round 7 are assigned -5.;
if e3878=-5 then do;
SCHSIZE=-5;
STUDTEAC=-5;
end;

 

 

endsas;

Return to top


Training:  Receipt of Certificate or Vocational License

Variables Created:

Variables Used

t640m1-t640m3 YTRN640.01-.03
t640y1-t640y3 YTRN640.01-.03

t690001-t690007 YTRN6900
t700001-t700007 YTRN7000
t1500m1-t1500m6 YTRN1500.00-.06
t1500y1-t1500y6 YTRN1500.00-.06
TRNCYR CV_TRN_CERT
TRNCMTH CV_TRN_CERT_DATE~Y
TRNCERT CV_TRN_CERT_DATE~M

Name in Program

Question Name on CD

 

Name in Program

Question Name on CD

t640m1-t640m3 YTRN640.01-.03   trncmo2002 CV_TRN_CERT_DATE_M_2002
t640y1-t640y3 YTRN640.01-.03   trncy2002 CV_TRN_CERT_DATE_Y_2002
t690001-t690007 YTRN6900   trncrt2002 CV_TRN_CERT_2002
t700001-t700007 YTRN7000   t640m1 YTRN_640_01_M_2003
t1500m1-t1500m6 YTRN1500.00-.06   t640y1 YTRN_640_01_Y_2003
t1500y1-t1500y6 YTRN1500.00-.06   t640m2 YTRN_640_02_M_2032
TRNCYR CV_TRN_CERT   t640y2 YTRN_640_02_Y_2003
TRNCMTH CV_TRN_CERT_DATE~Y   t640m3 YTRN_640_03_M_2003
TRNCERT CV_TRN_CERT_DATE~M   t640y3 YTRN_640_03_Y_2003
trncmo97 CV_TRN_CERT_DATE_M_1997   t1500m1 YTRN_1500_01_M_2003
trncy97 CV_TRN_CERT_DATE_Y_1997   t1500y1 YTRN_1500_01_Y_2003
trncrt97 CV_TRN_CERT_1997   t1500m2 YTRN_1500_02_M_2003
trncmo98 CV_TRN_CERT_DATE_M_1998   t1500y2 YTRN_1500_02_Y_2003
trncy98 CV_TRN_CERT_DATE_Y_1998   t1500m3 YTRN_1500_03_M_2003
trncrt98 CV_TRN_CERT_1998   t1500y3 YTRN_1500_03_Y_2003
trncmo99 CV_TRN_CERT_DATE_M_1999   t1500m4 YTRN_1500_04_M_2003
trncy99 CV_TRN_CERT_DATE_Y_1999   t1500y4 YTRN_1500_04_Y_2003
trncrt99 CV_TRN_CERT_1999   t1500m5 YTRN_1500_05_M_2003
trncmo2000 CV_TRN_CERT_DATE_M_2000   t1500y5 YTRN_1500_05_Y_2003
trncy2000 CV_TRN_CERT_DATE_Y_2000   t1500m6 YTRN_1500_06_M_2003
trncrt2000 CV_TRN_CERT_2000   t1500y6 YTRN_1500_06_Y_2003
trncmo2001 CV_TRN_CERT_DATE_M_2001   t69001-t69007 YTRN_6900_01_2003-YTRN_6900_07_2003
trncy2001 CV_TRN_CERT_DATE_Y_2001   t70001-t70007 YTRN_7000_01_2003-YTRN_7000_07_2003
trncrt2001 CV_TRN_CERT_2001   PUBID PUBID_1997

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.
1  Condition Applies (yes)

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{7} t69001 - t69007;
array t70000{7} t70001 - t70007;
array t1500m{7} t1500m1 - t1500m7;
array t1500y{7} t1500y1 - t1500y7;
array t640m{7} t640m1 - t640m7;
array t640y{7} t640y1 - t640y7;
array trncrt{7} trncrt97 - trncrt99 trncrt2000 trncrt2001 trncrt2002 trncrt2003;
array trncmo{7} trncmo97 - trncmo99 trncmo2000 trncmo2001 trncmo2002 trncmo2003;
array trncy{7} trncy97 - trncy99 trncy2000 trncy2001 trncy2002 trncy2003;

do i=1 to 7;
if reccert=0 and t69000{i}=1 and 1<=t70000{i}<=3 and t640y{i}>-4 then do;/*8-18-04*/
TRNCERT=1;
TRNCYR=t640y{i};
TRNCMTH=t640m{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 t640y{i}=TRNCYR and
t640m{i}>TRNCMTH then do;
TRNCMTH=t640m{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 t640y{i}>TRNCYR then do;
TRNCYR=t640y{i};
TRNCMTH=t640m{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 7;
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;

if int_y=-5 and int_m=-5 then do;
TRNCERT=-5;
TRNCYR=-5;
TRNCMTH=-5;
end;

endsas;


Return to top Return to Table of Contents