The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Malaria » How to calculate 'households with at least one ITN'
Re: How to calculate 'households with at least one ITN' [message #744 is a reply to message #656] Fri, 06 September 2013 08:25 Go to previous messageGo to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User,
I am not a programmer but I looked through some of our programs to create the table on Use of mosquito nets by pregnant women. Look through this. I think it might help identify the variables and denominators you need to use. Note: T1205 is the table name. V102w through total are the row variables. Col1205a+col1250b are the column variables. These are all working variables but you can get an idea of where they came from. For example V102w comes from V102 Type of residence (urban, rural). Our Standard Recode Manual http://www.measuredhs.com/pubs/pdf/DHSG4/Recode6_DHS_22March 2013_DHSG4.pdf and our Guide to DHS Statistics http://www.measuredhs.com/pubs/pdf/DHSG1/Guide_to_DHS_Statis tics_29Oct2012_DHSG1.pdf should be of some assistance as well.

crosstab float(1) t1205 v102w+v101w+v106w+v190w+total col1205a+col1205b
exclude(colzero,rowzero,totals,percents,specval)

title( "Table 12.5 Use of mosquito nets by pregnant women","",
"Percentages of pregnant women age 15-49 who, the night before the survey, slept under a mosquito net",
"(treated or untreated), under an insecticide-treated net (ITN), under a long-lasting insecticidal net (LLIN),",
"and under an ITN or in a dwelling in which the interior walls have been sprayed against mosquitoes (IRS) in the",
"past 12 months; and among pregnant women age 15-49 in households with at least one ITN, the percentage who",
"slept under an ITN the night before the survey, by background characteristics, country, 2011" )
stub( "Background Characteristic" );

PROC RECODE6_FF
preproc

total = 0;
numwom2 = 1;
numhh = 1;
percent = 0;

unweight = ( sysparm()[1:1] = "U" ); { 0-Weighted, 1-unweighted }

postproc

{ constructs table to determine whether run is weighted/unweighted }
txxx(unweight,0) = sysdate( "dd" ); { day }
txxx(unweight,1) = sysdate( "mm" ); { month }
txxx(unweight,2) = sysdate( "yyyy" ); { year }

{ table 12.5 }
jtot1 = tblcol( t1205, col1205a );
jmax = jtot1 - 1;
do j = 0 while j <= jmax
t1205[*,j] = 100 * t1205[*,j] / t1205[*,jtot1];
enddo;
jtot2 = tblcol( t1205, col1205b );
jmax = jtot2 - 1;
do j = jtot1 + 1 while j <= jmax
t1205[*,j] = 100 * t1205[*,j] / t1205[*,jtot2];
enddo;

PROC HOUSEHOLD
preproc

if HV015 <> 1 then skip case endif;

{ initialize array for education variable to properly pouplate it in level 2 }
do i = 1 while i <= 50
educat(i) = notappl;
enddo;

postproc

if unweight then
rweight = 1;
else
rweight = HV005/1000000;
endif;

v102w = HV025;
v101w = HV024;
v190w = HV270;

hhitn = ( count( RECHML_EDT where HML10 = 1 ) > 0 ); { HH has an ITN net }
sprayed = ( HV253 = 1 & ( HV253A = 1 | HV253B = 1 | HV253C = 1 ) ); { households sprayed by a government agency, private company or NGO }

{ table 12.5 }

for i in RECHMH_EDT do
if HV103(i) = 1 & HML18 = 1 & HV104(i) = 2 & HML16 in 15:49 then { de-facto pregnant women age 15-49 }
{ education is coming from level 2 for women with complete interviews }
v106w = educat(i);
if v106w = notappl then
v106w = HV106(i); { make sure to recode it as it is done at level 2 }
endif;
if v106w in 8,missing then v106w = 9 endif;
anynet = ( HML12 in 1:3 ); { Any net }
llinet = ( HML20 = 1 ); { LLIN net }
itnnet = ( HML12 in 1:2 ); { ITN net }
col1205b = notappl;
col1205a = 5;
xtab( t1205, rweight );
if anynet then
col1205a = 1; { any net }
xtab( t1205, rweight );
endif;
if itnnet then
col1205a = 2; { ITN nets }
xtab( t1205, rweight );
endif;
if llinet then
col1205a = 3; { LLIN net }
xtab( t1205, rweight );
endif;
if itnnet | sprayed then
col1205a = 4; { ITN net | IRS household }
xtab( t1205, rweight );
endif;
{ for households with ITN }
col1205a = notappl;
if hhitn then
col1205b = 2;
xtab( t1205, rweight );
if itnnet then
col1205b = 1;
xtab( t1205, rweight );
endif;
endif;
endif;
enddo;
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: RURAL/URBAN
Next Topic: Help with unique identifier in SPA data?
Goto Forum:
  


Current Time: Mon Jan 13 03:41:09 Coordinated Universal Time 2025