Date Left High School and Highest High School Grade - Appendix 1

National Longitudinal Survey of Youth - 1997 Cohort

Date Left High School and Highest High School Grade - Appendix 1

Variables Created

  • CVC_HS_LEFT_DATE
  • CVC_HS_LEFT_HGC
  • CVC_HS_LEFT_HGA

This program creates three variables: the date the respondent left high school, the highest grade completed at that point, and the highest grade attended. These variables are created for all respondents who have a highest grade completed greater than 12, who have received a high school diploma or GED, who are at least age 21, or who are in college. Note that these cross-round variables are created for all respondents, regardless of whether they were interviewed in the current round.

Variables Used

/**Variable names in the program      Variable names in the Gator**/                
       encatr1                        CV_ENROLLSTAT              
       hgcr1                          CV_HGC_EVER                
       doicmr1                        CV_INTERVIEW_CMONTH        
       DOBM                           KEY!BDATE_M_1997           
       DOBY                           KEY!BDATE_Y_1997           
       e2857r2                        YSCH-2857                  
       e3112r2                        YSCH-3112                  
       e3878r2                        YSCH-3878                  
       encatr2                        CV_ENROLLSTAT              
       hgcr2                          CV_HGC_EVER                
       doicmr2                        CV_INTERVIEW_CMONTH        
       RNIr2                          RNI_1998                   
       e2857r3                        YSCH-2857                  
       e3112r3                        YSCH-3112                  
       e3878r3                        YSCH-3878                  
       encatr3                        CV_ENROLLSTAT              
       hgcr3                          CV_HGC_EVER                
       doicmr3                        CV_INTERVIEW_CMONTH        
       RNIr3                          RNI_1999                   
       e2857r4                        YSCH-2857                  
       e3112r4                        YSCH-3112                  
       e3878r4                        YSCH-3878                  
       encatr4                        CV_ENROLLSTAT              
       hgcr4                          CV_HGC_EVER                
       doicmr4                        CV_INTERVIEW_CMONTH        
       RNIr4                          RNI_2000                   
       e2857r5                        YSCH-2857                  
       e3112r5                        YSCH-3112                  
       e3878r5                        YSCH-3878                  
       encatr5                        CV_ENROLLSTAT              
       hgcr5                          CV_HGC_EVER                
       doicmr5                        CV_INTERVIEW_CMONTH        
       RNIr5                          RNI_2001                   
       e2857r6                        YSCH-2857                  
       e3112r6                        YSCH-3112                  
       e3878r6                        YSCH-3878                  
       encatr6                        CV_ENROLLSTAT              
       hgcr6                          CV_HGC_EVER                
       doicmr6                        CV_INTERVIEW_CMONTH        
       RNIr6                          RNI_2002                   
       e2857r7                        YSCH-2857                  
       e3112r7                        YSCH-3112                  
       e3878r7                        YSCH-3878                  
       encatr7                        CV_ENROLLSTAT              
       hgcr7                          CV_HGC_EVER                
       doicmr7                        CV_INTERVIEW_CMONTH        
       RNIr7                          RNI_2003                   
       e2857r8                        YSCH-2857                  
       e3112r8                        YSCH-3112                  
       e3878r8                        YSCH-3878                  
       encatr8                        CV_ENROLLSTAT              
       hgcr8                          CV_HGC_EVER                
       doicmr8                        CV_INTERVIEW_CMONTH        
       RNIr8                          RNI_2004                   
       e2857r9                        YSCH-2857                   
       e3112r9                        YSCH-3112                   
       e3878r9                        YSCH-3878                   
       doicmr9                        CV_INTERVIEW_CMONTH         
       encatR9                        CV_ENROLLSTAT               
       hgcYR9                         CV_HGC_0506                 
       cvc_hgcR9                      CVC_HGC_EVER_2005           
       RNIr9                          RNI_2005                   
       e2857r10                       YSCH-2857                          
       e3112r10                       YSCH-3112                          
       e3878r10                       YSCH-3878                          
       doicmr10                       CV_INTERVIEW_CMONTH                
       encatr10                       CV_ENROLLSTAT                      
       hgcYr10                        CV_HGC_0607                        
       cvc_hgcr10                     CVC_HGC_EVER_2006_XRND             
       cvc_hdgr10                     CVC_HIGHEST_DEGREE_EVER_2006_XRND  
       RNIr10                         RNI_2006                          
       doicmR11                       CV_INTERVIEW_CMONTH_2007          
       e2857r11                       YSCH-2857_2007                    
       e3112r11                       YSCH-3112_2007                    
       e3878r11                       YSCH-3878_2007                    
       RNIr11                         RNI_2007                          
       encatr11                       CV_ENROLLSTAT_2007                
       hgcYr11                        CV_HGC_0708_2007                  
       cvc_hgcr11                     CVC_HGC_EVER_2007_XRND            
       cvc_hdgr11                     CVC_HIGHEST_DEGREE_EVER_2007_XRND
       hs_lft_r11                     CVC_HS_LEFT_DATE_2007             
       hs_lft_hgc_r11                 CVC_HS_LEFT_HGC_2007              
       hs_lft_hga_r11                 CVC_HS_LEFT_HGA_2007              
       doicmR12                       CV_INTERVIEW_CMONTH_2008          
       e2857r12                       YSCH-2857_2008                    
       e3877r12                       YSCH-3877_2008                    
       e3877A1r12                     YSCH-3877A1_2008                  
       e3112r12                       YSCH-3112_2008                    
       RNIr12                         RNI_2008                          
       encatr12                       CV_ENROLLSTAT_2008                
       hgcYr12                        CV_HGC_0809_2008                   
       doicmR13                       CV_INTERVIEW_CMONTH_2009          
       e2857R13                       YSCH-2857_2009                    
       e3112R13                       YSCH-3112_2009                    
       e3878R13                       YSCH-3878_2009                    
       RNIR13                         RNI_2009                          
       encatR13                       CV_ENROLLSTAT_2009                
       hgcYR13                        CV_HGC_0910                       
       cvc_hgcR13                     CVC_HGC_EVER_2009_XRND            
       cvc_hdgR13                     CVC_HIGHEST_DEGREE_EVER_2009_XRND
       hs_lft_R13                     CVC_HS_LEFT_DATE_2009             
       hs_lft_hgc_R13                 CVC_HS_LEFT_HGC_2009              
       hs_lft_hga_R13                 CVC_HS_LEFT_HGA_2009              
       INTDr14                        YINTDATE~D_2010                 
       INTMr14                        YINTDATE~M_2010                 
       INTYr14                        YINTDATE~Y_2010                 
       e3112r14                       YSCH-3112_2010                  
       e3113r14                       YSCH-3113_2010                  
       e2857r14                       YSCH-2857_2010                 
       e3061r14                       YSCH-3061_2010                 
       e3877r14                       YSCH-3877_2010                 
       e3877A1r14                     YSCH-3877A1_2010               
       scodeR14_1                     NEWSCHOOL_SCHCODE.01_2010
       scodeR14_2                     NEWSCHOOL_SCHCODE.02_2010
       scodeR14_3                     NEWSCHOOL_SCHCODE.03_2010
       scodeR14_4                     NEWSCHOOL_SCHCODE.04_2010
       scodeR14_5                     NEWSCHOOL_SCHCODE.05_2010
       RNIr14                         RNI_2010                      
       pubid                          pubid_XRND    

SAS Code for Variable Creation

** Defining all arrays used in the program;
array e285   (*) e3500r1 e2857r2-e2857r14;
array hgal   (*) hgaloopr1-hgaloopr13 hgaloop;
array RNI    (*) RNIr1-RNIr14; * no RNIr1;
array gra    (*) hgcr1 hgcYr2-hgcYr13 graug;
array grsF   (*) grsurvFr1-grsurvFr13 grsurvF;
array doic   (*) doicmr1-doicmr14;
array dli    (*) dli1-dli14;
array enc    (*) encatr1-encatr13 encat;
array att    (*) attsch1-attsch13 attsch;

array stpcm  (*) stpcm11-stpcm15 stpcm21-stpcm23 stpcm31-stpcm32;
array scode  (*) scoder14_1-scoder14_5 scoder14_1-scoder14_3 scoder14_1-scoder14_2;

***** Computing date of birth in continuous month scheme (cmb).;
cmb=((doby-1980)*12)+dobm;

***** Computing DLI round;
do i=1 to dim(e285);
      do j=1 to i-1;
         if e285(j)~=-5 then dli(i)=j;
      end;
   if e285(i)~=-5 then do;
      ageLI=round((doic(i)-cmb)/12);
      encatLI=enc(i);
      DLI_RND=i;
   end;
   if RNI(i) in (80, 98) then DECEASED=1;
end;

if cdths>-4 then HSD=1;
if cdths=-4 then HSD=0;
if cdtgd>-4 then GED=1;
if cdtgd=-4 then GED=0;

***** cv creation criteria;
if cdths>-4 or grsurv_cvc>=12 or encatLI in (4,5,6,7,9,10,11) or deceased=1 or ageLI>20 then created=1;
** when to use school stop dates;
if encatLI in (4,5,6,7,9,10,11) or deceased=1 or ageLI>20 then usestop=1;

***** Imputing e2857;
   if 0<e2857r14<=6 & grsurv_cvc>12 then do;
      e2857r14=12+e2857r14;
      imp1=13;
   end;

***** Computing Highest Grade Completed: - HGCa, HGC.;
HGC=grsurvF;

do i=1 to dim(e285);
   if e285(i)~=-5 then HGCa=gra(i);
end;
do i=1 to dim(grsF);
   if grsF(i)=HGC then do;
      HGC_rnd=i;
      i=dim(grsF);
   end;
end;

***** Computing Highest grade attended in school: HGA.;
HGA=hs_lft_hga_r13;
loc_hga=loc_hga_r13;

if HGA=-4 then HGA=hga_old_r13;
    if e3877a1r14 not in (0, -5) & HGA ne 12 &
      (attsch=1 or scoder14_1 in (-1,-2,-3) or scoder14_2 in (-1,-2,-3) or scoder14_3 in (-1,-2,-3)
       or scoder14_4 in (-1,-2,-3) or scoder14_5 in (-1,-2,-3))then do ;
      if e2857r14=hgaloop & (0<=e2857r14<=12 | e2857r14=95) & (e2857r14>HGA | HGA=95) then do;
         HGA=e2857r14;
         LOC_HGA=2;
         hga_rnd=14;
      end;
      if e2857r14~=hgaloop then do;
         if (0<=hgaloop<=12 | hgaloop=95) & 95>e2857r14>12 & (hgaloop>HGA | HGA=95)  then do;
            HGA=hgaloop;
            if grsurvF<=12 & grsurvF>hgaloop then HGA=grsurvF;
            LOC_HGA=3;
            hga_rnd=14;
         end;
         if 95>hgaloop>12  & (0<=e2857r14<=12 | e2857r14=95) & (e2857r14>HGA | HGA=95) then do;
            HGA=e2857r14;
            if grsurvF<=12 & grsurvF>e2857r14 then HGA=grsurvF;
            LOC_HGA=4;
            hga_rnd=14;
         end;
         if (0<=hgaloop<=12|hgaloop=95) & (0<=e2857r14<=12|e2857r14=95) then do;
            if grsurvF>hgaloop  & grsurvF<=e2857r14 & (e2857r14>HGA | HGA=95) then do;
               HGA=e2857r14;
               LOC_HGA=5;
               hga_rnd=14;
            end;
            if grsurvF<=hgaloop & grsurvF>e2857r14 & (hgaloop>HGA | HGA=95) then do;
               HGA=hgaloop;
               LOC_HGA=6;
               hga_rnd=14;
            end;
            if grsurvF=hgaloop & grsurvF<e2857r14 & (e2857r14>HGA | HGA=95) then do;
               HGA=e2857r14;
               LOC_HGA=7;
               hga_rnd=14;
            end;
            if grsurvF=e2857r14 & grsurvF<hgaloop & (hgaloop>HGA | HGA=95) then do;
               HGA=hgaloop;
               LOC_HGA=8;
               hga_rnd=14;
            end;
            if (0<=grsurvF<hgaloop & 0<=grsurvF<e2857r14)|(grsurvF>hgaloop>=0 & grsurvF>e2857r14>=0) then do;
               if abs(hgaloop-grsurvF)<abs(e2857r14-grsurvF) & (hgaloop>HGA | HGA=95) then do;
                  HGA=hgaloop;
                  LOC_HGA=9;
                  hga_rnd=14;
               end;
               if abs(hgaloop-grsurvF)>abs(e2857r14-grsurvF) & (e2857r14>HGA | HGA=95) then do;
                  HGA=e2857r14;
                  LOC_HGA=10;
                  hga_rnd=14;
               end;
            end;
                if grsurvF<0 then do;
               if max(hgaloop, e2857r14)>HGA | HGA=95 then HGA= max(hgaloop, e2857r14);
               LOC_HGA=16;
                     hga_rnd=14;
                  end;    
         end;
          
         if hgaloop<0 & (0<=e2857r14<=12|e2857r14=95) & (e2857r14>HGA | HGA=95) then do;
            HGA=e2857r14;
            LOC_HGA=11;
            hga_rnd=14;
         end;
         if (0<=hgaloop<=12|hgaloop=95) & e2857r14<0 & (hgaloop>HGA | HGA=95) then do;
            HGA=hgaloop;
            LOC_HGA=12;
            hga_rnd=14;
         end;
      end;
   end;

** Computing Date Left High School (1) - DATE_RECD_HSD;

DATE_RECD_HSD=cdths;

** Computing Date Left High School (2) - DATE_COMP_HGC, starting from the same var created
                                                        in last round;

if DATE_COMP_HGC=-4 & grsurv_cvc<12 then never_comp_12=1;

** Computing Date Left High School (2) - DATE_SCH_STOP, starting from the same var created
                                                        in last round;

do i=1 to dim(scode);
   if scode(i) in (1,2,3) then do;
      if  stpcm(i)>0 & DATE_SCH_STOP<stpcm(i) then DATE_SCH_STOP=stpcm(i);
      if -4<stpcm(i)<=0 & DATE_SCH_STOP<-3 then DATE_SCH_STOP=-3;
   end;
end;

** Date left school from R1 - SCH_STOP_R1 - created in prev round;

** Date graduated from High School from Transcripts - DATE_LEFT_TRS-created in prev round;

** Computing Date Left High School - DATE_LEFT_SCH
   using DATE_RECD_HSD, DATE_SCH_STOP and DATE_COMP_HGC.;

DATE_LEFT_SCH=-4;
if e2857r14=-5 then do;
  date_left_sch=hs_lft_r13;
  loc_dt=0;
end;
if DATE_RECD_HSD>-4 & DATE_LEFT_SCH<0 then do;
   DATE_LEFT_SCH=DATE_RECD_HSD;
   LOC_DT=1;
end;
if DATE_COMP_HGC>-4 & DATE_LEFT_SCH<0 then do;
   DATE_LEFT_SCH=DATE_COMP_HGC;
   LOC_DT=2;
end;
if DATE_SCH_STOP>-4 & DATE_LEFT_SCH<0 & DECEASED=1 then do;
   DATE_LEFT_SCH=DATE_SCH_STOP;
   LOC_DT=3.1;
end;
if DATE_SCH_STOP>-4 & DATE_LEFT_SCH<0 & encatLI in (4,5,6,7,9,10,11) then do;
   DATE_LEFT_SCH=DATE_SCH_STOP;
   LOC_DT=3.2;
end;
if DATE_SCH_STOP>-4 & DATE_LEFT_SCH<0 & ageLI>20 then do;
   DATE_LEFT_SCH=DATE_SCH_STOP;
   LOC_DT=3.3;
end;
if DATE_LEFT_TRS>-4 & DATE_LEFT_SCH<0 then do;
   DATE_LEFT_SCH=DATE_LEFT_TRS;
   LOC_DT=4.1;
end;
if DATE_LEFT_TRS>-4 & DATE_LEFT_SCH>-4 & LOC_DT in (3.1,3.2,3.3) & DATE_LEFT_TRS<DATE_LEFT_SCH then do;
   DATE_LEFT_SCH=DATE_LEFT_TRS;
   LOC_DT=4.2;
end;
if SCH_STOP_r1>-4 & DATE_LEFT_SCH<0 & usestop=1 then do;
   DATE_LEFT_SCH=sch_stop_r1;
   LOC_DT=5;
end;

if DATE_SCH_STOP>-4 & DATE_LEFT_SCH=-4 & ageLI>20 then LOC_DT_a=1;
if DATE_SCH_STOP>-4 & DATE_LEFT_SCH=-3 & ageLI>20 then LOC_DT_a=2;
if DATE_LEFT_SCH=-4 & GED=1 then LOC_DT_b=1;

* Consistency checks;
if DATE_SCH_STOP>-4 & DATE_COMP_HGC>-4 & DATE_RECD_HSD>-4 then do;
   consis=30;
   if DATE_SCH_STOP=DATE_COMP_HGC  & DATE_SCH_STOP=DATE_RECD_HSD  then consis=33;
   if DATE_SCH_STOP=DATE_COMP_HGC  & DATE_SCH_STOP~=DATE_RECD_HSD then consis=32;
   if DATE_SCH_STOP=DATE_RECD_HSD  & DATE_SCH_STOP~=DATE_COMP_HGC then consis=32;
   if DATE_COMP_HGC=DATE_RECD_HSD  & DATE_SCH_STOP~=DATE_COMP_HGC then consis=32;
end;

if DATE_SCH_STOP>-4 & DATE_RECD_HSD=-4 & DATE_COMP_HGC=-4 then consis=1;
if DATE_SCH_STOP=-4 & DATE_RECD_HSD>-4 & DATE_COMP_HGC=-4 then consis=1;
if DATE_SCH_STOP=-4 & DATE_RECD_HSD=-4 & DATE_COMP_HGC>-4 then consis=1;

if DATE_SCH_STOP>-4 & DATE_RECD_HSD>-4 & DATE_COMP_HGC=-4 then do;
   consis=22;
   if DATE_SCH_STOP~=DATE_RECD_HSD then consis=20;
end;
if DATE_SCH_STOP>-4 & DATE_RECD_HSD=-4 & DATE_COMP_HGC>-4 then do;
   consis=22;
   if DATE_SCH_STOP~=DATE_COMP_HGC then consis=20;
end;
if DATE_SCH_STOP=-4 & DATE_RECD_HSD>-4 & DATE_COMP_HGC>-4 then do;
   consis=22;
   if DATE_RECD_HSD~=DATE_COMP_HGC then consis=20;
end;

age_jan12=round((385-cmb)/12);

*********************** HE;
if pubid in (3355 3452 6007) then do;
  hga=12;
  loc_hga=99;
  hga_rnd=14;
end;
if pubid=2001 then do;
  date_left_sch=hs_lft_r11; loc_dt=15;
  hga=hs_lft_hga_r11; loc_hga=99;
end;
if pubid=5324 then do;
  date_left_sch=374; loc_dt=15;
end;
if pubid in (466 2175 2800 3921 4554 5324 5376 6020 6084 7722 7823) then do;
  hga=hs_lft_hga_r13; loc_hga=99;
end;
if pubid=8843 then do;
  hga=8; loc_hga=99;
end;
if pubid in (7652,8778) then do;
 date_left_sch=-3;
 loc_dt=15;
end;
if pubid=3291 then do;
 date_left_sch=371;
 loc_dt=15;
end;
if pubid=3301 then do;
 hga=hs_lft_hga_r13; loc_hga=99;
end;
if pubid=6922 then do;
 hga=hs_lft_hga_r13; loc_hga=99;
end;
if pubid=8371 then do;
 hga=hs_lft_hga_r13; loc_hga=99;
end;
if pubid=8855 then do;
 hga=-3; loc_hga=99;
end;
if pubid=6010 then do;
 hga=-3; loc_hga=99;
end;

************************************/;

if created ne 1 then do;
   date_left_sch_old=date_left_sch;
   hga_old=hga;
   hgc_old=hgc;
   date_left_sch=-4;
   hga=-4;
   hgc=-4;
end;
endsas;