You are here
Home › Cohorts › NLSY97 › Other Documentation › Codebook Supplement › Appendix 1: Education Variable Creation ›Number of Schools Attended - Appendix 1
Number of Schools Attended - Appendix 1
These variables were last created in round 13.
Variables Created
- CVC_SCH_ATTEND_EVER (NUMS)
- CVC_SCH_ATTEND_YR (NUMJ)
This program is used to count the number of regular schools that the youth ever attended as of the survey date and as of the summer before the current survey round began.
Variables Used
/* Variable Names in program Variable Names in Gator*/
PUBID_1997 PUBID
e3500r1 YSCH-3500
numr1 CV_SCH_ATTEND_EVER
e2857r2 YSCH-2857
e2857r3 YSCH-2857
e2857r4 YSCH-2857
e2857r5 YSCH-2857
e2857r6 YSCH-2857
e2857r7 YSCH-2857
e2857r8 YSCH-2857
e2857r9 YSCH-2857
e2857r10 YSCH-2857
e2857r11 YSCH-2857
e2857r12 YSCH-2857
e2857r13 YSCH-2857
e3112r13 YSCH-3112
e8416r13_11 YSCH-8416.01.01
e8416r13_12 YSCH-8416.01.02
e8416r13_21 YSCH-8416.02.01
pubid PUBID
schintr13_1 NEWSCHOOL_INTERVIEW.01
schintr13_2 NEWSCHOOL_INTERVIEW.02
schintr13_3 NEWSCHOOL_INTERVIEW.03
strtmr13_11 NEWSCHOOL_START1.01~M
strtyr13_11 NEWSCHOOL_START1.01~Y
strtmr13_12 NEWSCHOOL_START1.02~M
strtyr13_12 NEWSCHOOL_START1.02~Y
strtmr13_13 NEWSCHOOL_START1.03~M
strtyr13_13 NEWSCHOOL_START1.03~Y
stopmr13_11 NEWSCHOOL_STOP1.01~M
stopyr13_11 NEWSCHOOL_STOP1.01~Y
stopmr13_12 NEWSCHOOL_STOP1.02~M
stopyr13_12 NEWSCHOOL_STOP1.02~Y
stopmr13_13 NEWSCHOOL_STOP1.03~M
stopyr13_13 NEWSCHOOL_STOP1.03~Y
strtmr13_21 NEWSCHOOL_START2.01~M
strtyr13_21 NEWSCHOOL_START2.01~Y
strtmr13_22 NEWSCHOOL_START2.02~M
strtyr13_22 NEWSCHOOL_START2.02~Y
stopmr13_21 NEWSCHOOL_STOP2.01~M
stopyr13_21 NEWSCHOOL_STOP2.01~Y
stopmr13_22 NEWSCHOOL_STOP2.02~M
stopyr13_22 NEWSCHOOL_STOP2.02~Y
strtmr13_31 NEWSCHOOL_START3.01~M
strtyr13_31 NEWSCHOOL_START3.01~Y
stopmr13_31 NEWSCHOOL_STOP3.01~M
stopyr13_31 NEWSCHOOL_STOP3.01~Y
schidr13_1 NEWSCHOOL_PUBID.01
schidr13_2 NEWSCHOOL_PUBID.02
schidr13_3 NEWSCHOOL_PUBID.03
numr12_cvc CVC_SCH_ATTEND_EVER
cvcrnd CVC_RND
SAS Code for Variable Creation
** Grades attended in each school.
Note: In R13 we ask only the 1st grade enrolled in each period;
array gratnd (2,2) e8416r13_11 e8416r13_12
e8416r13_21 dum;
** Enrollment start dates at each school;
array startm (*) strtmr13_11-strtmr13_13;
array starty (*) strtyr13_11-strtyr13_13;
array stopm (*) stopmr13_11-stopmr13_13;
array stopy (*) stopyr13_11-stopyr13_13;
array start (*) start1-start3;
** The round R first reported each school;
array schint (*) schintr13_1-schintr13_3;
** Pubid for each school;
array schid (*) schidr13_1-schidr13_3;
** Dummy variables used in the program;
array DUMGRD (*) DUMGRD1-DUMGRD3;
array AGAIN (*) AGAIN1-AGAIN3;
** Create DUMGRD: Dummy variable to indicate whether R attended grades 7 - 12 in each school.;
do i=1 to dim(gratnd,1);
DUMGRD(i)=0;
do j=1 to dim(gratnd,2);
if DUMGRD(i)~=1 & -3<=gratnd(i,j)<=-1 then DUMGRD(i)=-3;
if 7<=gratnd(i,j)<=12 then DUMGRD(i)=1;
end;
end;
** Create AGAIN: Dummy variable indicates whether R reported attending the school > than once;
do i=1 to dim(schid);
AGAIN(i)=0;
do j=i+1 to dim(schid);
if schid(i)>0 and DUMGRD(i)=1 & DUMGRD(j)=1 & schid(i)=schid(j) then AGAIN(i)=1;
end;
end;
** Calculate the accumulated month of the enrollment start date.;
do i=1 to dim(schid);
if starty(i)>0 and startm(i)>0 then start(i)=12*(starty(i)-1980)+startm(i);
end;
** Next, calculate prenum;
prenum=0; numjr13=0; numr13=0;
if numr12_cvc>0 then prenum=numr12_cvc;
** Count the new schools R was enrolled in grades 7 thru 12 - numjr13 and numr13;
do i=1 to dim(schid);
if schint(i)=13 & AGAIN(i)=0 & DUMGRD(i)=1 then do;
numr13=numr13+1;
if 0<start(i)<=354|0<starty(i)<2009 then numjr13=numjr13+1;
end;
end;
do i=1 to dim(schid);
if -3<=schint(i)<=-1 & dumgrd(i) in (1,-3) then do;
numr13=-3;
numjr13=-3;
end;
end;
** If CVC_SCH_ATTEND_EVER_2007 is in (0,-4), then count all the schools;
flagprev=0;
if numr12_cvc in (-4,0) then do;
numr13=0;
numjr13=0;
flagprev=1;
do i=1 to dim(schid);
if DUMGRD(i)=1 & AGAIN(i)=0 then do;
if numr13 ge 0 then numr13=numr13+1;
if (0<start(i)<=354|0<starty(i)<2009|schint(i) in (1,2,3,4,5,6,7,8,9,10,11)) & numjr13 ge 0
then numjr13=numjr13+1;
end;
if dumgrd(i)=-3 then do;
flagprev=2;
numr13=-3;
numjr13=-3;
end;
if AGAIN(i)=0 & DUMGRD(i)=1 & ((starty(i)=2009 & -4<startm(i)<0)|(-4<starty(i)<0))
& (-4<stopy(i)<0|(stopy(i)>2008 & -4<stopm(i)<0)|(stopy(i)=2009 & stopm(i)>6)|(stopy(i)>2009))
then do;
flagprev=3;
numjr13=-3;
end;
end;
end;
** If grades enrolled in each school cannot be determined;
do i=1 to dim(schid);
if DUMGRD(i)=-3 & schint(i)=13 then do;
numr13=-3;
numjr13=-3;
end;
end;
** If schools are reported but with bad enrollment start dates;
do i=1 to dim(schid);
if schint(i)=13 & AGAIN(i)=0 & DUMGRD(i)=1 & ((starty(i)=2009 & -4<startm(i)<0)|(-4<starty(i)<0))
& (-4<stopy(i)<0|(stopy(i)>2008 & -4<stopm(i)<0)|(stopy(i)=2009 & stopm(i)>6)|(stopy(i)>2009))
then numjr13=-3;
end;
** We then add the above two numbers to the corresponding variables from the previous round;
if numjr13>=0 then NUMJ=numjr13+prenum;
if numr13>=0 then NUMS=numr13+prenum;
** 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 R1 is <=7 and the 'highest grade attended' in R12 >= 7,
we use the number created from the current round.
2) If both the 'grade currently attended' in R1 and the 'highest grade attended' in R12 are <7,
we use -4 for the total number.
3) If the 'grade currently attended' in R1 >7, we use -4 for the total number.;
if numr1 in (0,-4) & cvcrnd=1 then do;
if e3500r1<=7 then do;
NUMJ=NUMJR13;
NUMS=NUMR13;
loc=1;
end;
if e3500r1<7 & -4<e2857r13<7 then do;
NUMJ=-4;
NUMS=-4;
loc=2;
end;
end;
if numr1 in (-4,0) and e3500r1>7 then do;
NUMS=-4;
NUMJ=-4;
loc=3;
end;
if numr12_cvc=-3 | numr13=-3 then do;
NUMJ=-3;
NUMS=-3;
end;
if numjr13=-3 then NUMJ=-3;
** Respondents incorrectly report "year of college" instead of "number of years of school";
if -4<e2857r13<7 then do;
if e3112r13>12 & e2857r13+12>=e3112r13 then hgachk=1;
else if e2857r12 ne -4 & e2857r12>12 then hgachk=2;
else if e2857r12 in (-4, -5) & e2857r11 ne -4 and e2857r11>12 then hgachk=2;
end;
if -4<e2857r13<7 & numr1 ne 0 & hgachk not in (1, 1.1, 2) then do;
NUMJ=-4;
NUMS=-4;
loc=4;
end;
** Check these cases and handedit them;
if NUMS<numr12_cvc & NUMS~=-3 then do;
flagcheck=1;
end;
** not interviewed;
if e8416r13_11=-5 then do;
numjr13=-5;
numr13=-5;
NUMJ=-5;
NUMS=-5;
end;
CNUMS=numr12_cvc;
if nums ne -5 then cnums=nums;
if cnums in (-1,-2,-3) then cnums=-3;
if (e8416r13_11>-4 and schidr13_1>1299) or (e8416r13_12>-4 and schidr13_1>1299) or (e8416r13_21>-4 and schidr13_2>1299) then eligible=1;
if cnums ne numr12_cvc then change=1;
endsas;