set more off
use e:\DHS\DHS_data\KR_files\BDKR72FL.dta, clear
log using e:\DHS\scratch\logtemp.smcl, replace
* Child:
* hw70 int %8.0g HW70 height/age standard deviation (new who)
* hw71 int %8.0g HW71 weight/age standard deviation (new who)
* hw72 int %8.0g HW72 weight/height standard deviation (new who)
* Mother:
* v445 int %8.0g V445 body mass index
* Note that v445 is bmi x 10
gen stunted=.
replace stunted=0 if hw70>-600 & hw70<600
replace stunted=100 if hw70>-600 & hw70<-200
gen bmi_category=1
replace bmi_category=2 if v445>=1700
replace bmi_category=3 if v445>=1850
replace bmi_category=4 if v445>=2300
replace bmi_category=5 if v445>=2500
replace bmi_category=6 if v445>=3000
* recommend omitting implausibly high values but this is optional
replace bmi_category=. if v445>6000
label define bmi_category 1 "<17" 2 ">=17 and <18.5" 3 ">=18.5 & <23" 4 ">=23 & <25" 5 ">=25 & <30" 6 ">=30"
label values bmi_category bmi_category
tab bmi_category stunted [iweight=v005/1000000],m
svyset [pweight=v005]
svy: mean stunted,over(bmi_category)
]]>