The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Bangladesh » question on net attendance rate (NAR)
Re: question on net attendance rate (NAR) [message #902 is a reply to message #722] Thu, 31 October 2013 15:40 Go to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User,

I am not a programmer, but here is some code from our standard tables to calculate School Attendance Ratios. It's in CSPro, but may provide some guidance by looking at some of the logic.

crosstab float(1) t213 hv025w+hv024w+hv270w+total attrat*(hhsex+total+gparity) schlev
exclude(rowzero,colzero,percents,totals,specval)

title( "Table 2.13 School attendance ratios"," ",
"Net attendance ratios (NAR) and gross attendance ratios (GAR)",
"for the de facto household population by sex and level of schooling; and the",
"Gender Parity Index (GPI), according to background characteristics, Country 2011" )
stub( "Background characteristic" );


{ table 2.13, 2.13a (figure 2.2) }

{ adjust the the country's CMC school year when the survey goes across two school calendar years }
cmceducf = cmceduci;
if HV008 >= cmceduci+12 then cmceducf = cmceduci + 12 endif;
for i in RECH1_EDT do
hhsex = HV104;
hsex = HV104;
{ calculate age at the beginning of country's school year }
if cmcbirth(i) <> 0 then
ageatsch = int( (cmceducf-cmcbirth(i)) / 12 );
else
{ impute an age at the beginnig of the school year when CMC of birth unknown }
xtemp = HV008 - HV105*12;
cmctemp = random( xtemp-11, xtemp );
ageatsch = int( (cmceducf-cmctemp) / 12 );
endif;
if HV103 = 1 & HV105 in 5:24 then { de facto population 5-24 ( !! check if country asks for 6-24) }
{ !! check primary school age for the country and adjust it }
if ageatsch in 7:12 then
schlev = 1; { primary }
attrat = 2; { denominator kids 7-12 for gross }
xtab( t213w, rweight );
attrat = 1; { denominator kids 7-12 for net }
xtab( t213w, rweight );
if HV122 = 1 then { in primary }
xtab( t213, rweight ); { numerator 7-12 for net }
endif;
endif;
{ !! check secondary school age for the country and adjust it }
if ageatsch in 13:18 then
schlev = 2; { secondary }
attrat = 2; { denominator kids 13-18 for gross }
xtab( t213w, rweight );
attrat = 1; { denominator kids 13-18 for net }
xtab( t213w, rweight );
if HV122 = 2 then { in secondary }
xtab( t213, rweight ); { numerator 13-18 for net }
endif;
endif;
{ numerator all in school for gross attendance ratio }
schlev = notappl;
attrat = 2;
if HV122 = 1 then { in primary }
schlev = 1;
elseif HV122 = 2 then { in secondary }
schlev = 2;
endif;
xtab( t213, rweight );

{ table 2.13a for figure 2.2 }
agehhs = HV105;
colt213a = 2;
xtab( t213a, rweight );
if HV121 in 1,2 & HV122 <> 0 then
colt213a = 1;
xtab( t213a, rweight );
endif;
endif; { end de facto 5-24 }
enddo;

 
Read Message
Read Message
Previous Topic: Fasting blood sugar
Next Topic: Child Nutrition data set
Goto Forum:
  


Current Time: Mon Jan 27 10:22:08 Coordinated Universal Time 2025