Code: Select all
crosstab float(1) t1101 chage2+sex2+pinter2+bsize+mothstat+mothbmi+v102w+{}V101+v106w+s_educ2+v190w+total
hghtage+wghthght+wghtage+numchild
exclude(rowzero,colzero,totals,percents,specval)
title( "Table 11.1 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, Countryxxxx" )
stub( "Background characteristic" );
Code: Select all
TxTab("t1101", rweight)
For example:
Code: Select all
function Txtab( alpha(15) TabName, tabweight )
do tally_t = 0 while tally_t <= tally_n
if tally_t then
s_region(tally_t,xregion);
endif;
if strip(TabName) = "t1101" then xtab( t1101, tabweight )
elseif strip(TabName) = "t1102" then xtab( t1102, tabweight )
etc....
............
...........
end;
Code: Select all
TxTab(Tab_Name, rweight)
Code: Select all
function Txtab( TableName, tabweight )
do tally_t = 0 while tally_t <= tally_n
if tally_t then
s_region(tally_t,xregion); // sets applicable row variables to not applicable
endif;
xtab( TableName, tabweight );
enddo;
if tally_n then s_region(0,xregion) endif; // resets the row variables
end;
Thanks for your help.
Han.