Private or Parochial School - Appendix 1

Private or Parochial School - Appendix 1

This variable was last created in round 13.

Variable Created

  • CV_SCHOOL_TYPE (SLTYPE)

This program is used to create the school type variables, i.e. to indicate whether the current or most recent schools that the youth attended are public (code 1), private (2), parochial (3) or other (4). 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 ending date for different enrollment periods.
  2. We can get the school type from the new school roster. However, in the program, these two steps cannot be separated.

Variables Used

/**Variable Names in Program          Variable Names from Gator**/

   'STYPE1'n                          YSCH-3400.01.01
   'STYPE2'n                          YSCH-3400.02.01
   'PUBID'n                           PUBID
   'SCODE1'n                          NEWSCHOOL_SCHCODE.01
   'SCODE2'n                          NEWSCHOOL_SCHCODE.02
   'SCODE3'n                          NEWSCHOOL_SCHCODE.03
   'SSTOP1M1'n                        NEWSCHOOL_STOP1.01~M
   'SSTOP1Y1'n                        NEWSCHOOL_STOP1.01~Y
   'SSTOP1M2'n                        NEWSCHOOL_STOP1.02~M
   'SSTOP1Y2'n                        NEWSCHOOL_STOP1.02~Y
   'SSTOP1M3'n                        NEWSCHOOL_STOP1.03~M
   'SSTOP1Y3'n                        NEWSCHOOL_STOP1.03~Y
   'SSTOP2M1'n                        NEWSCHOOL_STOP2.01~M
   'SSTOP2Y1'n                        NEWSCHOOL_STOP2.01~Y
   'SSTOP2M2'n                        NEWSCHOOL_STOP2.02~M
   'SSTOP2Y2'n                        NEWSCHOOL_STOP2.02~Y
   'SSTOP3M1'n                        NEWSCHOOL_STOP3.01~M
   'SSTOP3Y1'n                        NEWSCHOOL_STOP3.01~Y
   'SPERIOD1'n                        NEWSCHOOL_PERIODS.01
   'SPERIOD2'n                        NEWSCHOOL_PERIODS.02
   'SPERIOD3'n                        NEWSCHOOL_PERIODS.03

SAS Code for Variable Creation

/* create the array variables.*/

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

* ending date for each period;
array sstop1m sstop1m1-sstop1m3;
array sstop1y sstop1y1-sstop1y3;
array sstop2m sstop2m1-sstop2m3;
array sstop2y sstop2y1-sstop2y3;
array sstop3m sstop3m1-sstop3m3;
array sstop3y sstop3y1-sstop3y3;

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

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

* ending time for each school;
array srecm srecm1-srecm3;
array srecy srecy1-srecy3;

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

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

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

do i=1 to 3;

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

maxyleng=max(ylength1,ylength2,ylength3);
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 3;
 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 3;
  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 3;
  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 3;
  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 3;
    if ylength[i]=maxyleng then type1=stype[i];
 end;
end;

if invalidm ge 2 then type1=-3;

* flag the cases which have 98.02 and 98.-3;
flag=0;
if maxyeq ge 2 and invalidm ge 1 then flag=1;

if flag=1 then type1=-3;

* fix the case such as 99.12, 99.-2 99.-3 or 2000.12 2000.-2;

if maxyeq ge 2 then do;
 do i=1 to 3;
  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 3;
    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) 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)) then type1=-3;

        * if the respondent only goes to one school in r13,input that school type;
        if scode1 in (1,2,3) and scode2 in (-4, 4, 5) and scode3 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 scode1=-4 & scode2=-4 & scode3=-4 then sltype=-4;
        if stype1=-5 then sltype=-5;
endsas;