Home » Topics » Nutrition and Anthropometry » Replicating table counts for children under 5 in Bangladesh DHS
Re: Replicating table counts for children under 5 in Bangladesh DHS [message #1594 is a reply to message #1557] |
Sun, 16 March 2014 00:45 |
Liz-DHS
Messages: 1516 Registered: February 2013
|
Senior Member |
|
|
Dear User,
I am not a programmer, but looked through our CSPro programs for table 11.7 for Bangladesh 2004. It is called table 10.13 in our standard applications but I think might help in figuring things out. Note what the table definition excludes. Look through this code and use your recode manual and dictionary distributed with your data. Good luck. If you still need assistance, please feel free to post again.
Thank you!
table float(1) t1013 chage2+sex2+border2+pinter2+bsize+v102w+v101w+v106wt+
agem+chintw+chnotew+v190w+total
hghtage+wghthght+wghtage+numchild
exclude(rowzero,colzero,totals,percents,specval)
{+US}
title("Table 10.13 Nutritional status of children"," ",
" Percentage of children under five years classified as",
" malnourished according to three anthropometric indices of",
" nutritional status: height-for-age, weight-for-height, and",
" weight-for-age, by background characteristics, Bangladesh 2004")
stub ("Background",
"characterisitic");
{ check if a type of food was given to a child }
function given( xvar )
given = 0;
if !special(xvar) & xvar > 0 & xvar < 8 then
given = xvar
endif;
end
end
PROC RECODE4_FF
preproc
eb = 0;
total = 0;
numwom = 0;
numhh = 0;
numchild = 0;
meanpi = notappl;
med1st = 0.75;
totmiss = 0;
totchild = 1;
tothh = 1;
emsample = 1; { 0 - All woman sample, 1 - Ever married woman sample }
unweight = ( sysparm()[1:1] = "U" ); { 1 - run unweighted tables }
maxhght = 2200; { maximum height 220 cms }
maxwght = 2000; { maximum weight 200 Kgs }
maxarmc = 500; { maximum arm-circum 50 cms }
maxbmi = 600; { maximum BMI 60 (implicit in V445) }
minhght = 1300; { minimum height 130 cms }
minwght = 350; { minimum weight 35 Kgs }
minarmc = 200; { minimum arm-circum 20 cms }
minbmi = 120; { minimum BMI 12 (implicit in V445) }
{ Table 10.13 processing }
jtot = tblcol( t1013 );
jmax = jtot - 1;
j = 0;
while j <= jmax do
if j <> 2 & j <> 5 & j <> 8 then
t1013[*,j] = 100 * t1013[*,j] / t1013[*,jtot]; { percents }
else
t1013[*,j] = (t1013[*,j] / t1013[*,jtot]) - 10; { means }
endif;
j = j + 1
enddo;
{ Rounding weighted Ns }
itot = tblrow( t1013 );
i = 0;
while i <= itot do
t1013(i,jtot) = int( t1013(i,jtot)+0.5 );
i = i + 1
enddo;
{ table 10.13, 10.13a }
{ children's anthropometry }
numchild = notappl;
hghtage = notappl;
wghthght = notappl;
wghtage = notappl;
if !special( HC5(i) ) & HC5(i) <> 9998 then
hghtage = 1;
if HC5(i) < (-300) then
t = xtab( t1013, rweight );
endif;
hghtage = 2;
t = xtab( t1013aw, rweight );
if HC5(i) < (-200) then
t = xtab( t1013, rweight );
t = xtab( t1013a, rweight );
endif;
hghtage = 3;
zw = HC5(i) / 100 + 10;
t = xtab( t1013, zw*rweight );
hghtage = notappl;
wghthght = 1;
if HC11(i) < (-300) then
t = xtab( t1013, rweight );
endif;
wghthght = 2;
t = xtab( t1013aw, rweight );
if HC11(i) < (-200) then
t = xtab( t1013, rweight );
t = xtab( t1013a, rweight );
endif;
wghthght = 3;
zw = HC11(i) / 100 + 10;
t = xtab( t1013, zw*rweight );
wghthght = notappl;
wghtage = 1;
if HC8(i) < (-300) then
t = xtab( t1013, rweight );
endif;
wghtage = 2;
t = xtab( t1013aw, rweight );
if HC8(i) < (-200) then
t = xtab( t1013, rweight );
t = xtab( t1013a, rweight );
endif;
wghtage = 3;
zw = HC8(i) / 100 + 10;
t = xtab( t1013, zw*rweight );
wghtage = notappl;
numchild = 0; { all children }
t = xtab( t1013, rweight );
|
|
|
Goto Forum:
Current Time: Wed Nov 27 18:44:26 Coordinated Universal Time 2024
|