* Procedure to construct the equivalent to hc71 in the 5 states of NFHS-1 that * did not include height but did include weight * Tom Pullum, tom.pullum@icf.com, May 20, 2024, revised June 4 * Specify a work space cd e:\DHS\DHS_data\IA * Merge the HW and KR files for this survey use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\IAHW22FL.DTA", clear rename hwcaseid caseid rename hwline bidx gen in_HW=1 save HW.dta, replace use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\IAKR23FL.DTA", clear gen in_KR=1 merge 1:1 caseid bidx using HW.dta tab _merge drop _merge tab in*,m * We have a complete match of HW and KR cases drop in_HW * Several steps to improve the calculation of days of age * mdy of interview: v006, v016, v007 * mdy of measurement: hw18, hw17, hw19 * mdy of birth: b1, hw16, b2 * Fix some 99's in mdy of measurement replace hw18=v006 if hw18==99 replace hw17=v016 if hw17==99 replace hw19=v007 if hw19==99 * Years in this survey are missing the leading digits 19 replace v007=v007+1900 if v007<100 replace hw19=hw19+1900 if hw19<100 replace b2=b2+1900 if b2<100 * b8 is years of age * Day of birth is often missing (98 or 99) * Replace with 15 unless the birth month is the current month; give priority to age gen fix_hw16=0 if hw16>31 * Child has already had birthday within birth month; birthday is earlier in month replace fix_hw16=1 if fix_hw16==0 & b1==hw18 & b8==v007-b2 * Child has not yet had birthday within birth month; birthday is later in month replace fix_hw16=2 if fix_hw16==0 & b1==hw18 & b8==v007-b2-1 tab fix_hw16,m gen delta=hw19-b2 tab delta b8 if b1==hw18 drop delta tab b8 replace hw16=int(hw16+1/2) if fix_hw16==1 replace hw16=int(hw16+31/2) if fix_hw16==2 replace hw16=15 if fix_hw16==0 drop fix* * days is days of age on the day of measurement gen days=mdy(hw18,hw17,hw19)-mdy(b1,hw16,b2) summarize days histogram days list b1 hw16 b2 hw18 hw17 hw19 b8 if days<0, table clean * There are about 45 cases with negative age; just give them a 9999 type of code gen sex=b4 gen wt=hw2 * Reduce to the states in which hc71 was not originally calculated keep if v024==2 | v024==8 | v024==12 | v024==22 | v024==23 sort sex days wt tab in_KR,m save temp.dta, replace * Merge with a reference file of WAZ scores already prepared and sorted use e:\DHS\Anthropometry\reference_files_haz_waz_whz\waz_reference.dta gen in_waz_reference=1 sort sex days wt merge sex days wt using temp.dta tab in*,m tab _merge keep if in_KR==1 tab v024 if hw2==999 tab v024 if hw2<999 * Multiply by 100 to match scale of hc71 replace waz=100*waz replace waz=9999 if hw2==999 replace waz=9998 if waz<-600 | waz>500 * Rename this version of the waz to be hc71 replace hc71=waz * Go back to the identifier names in the original HW file rename caseid hwcaseid rename bidx hwline keep hwcaseid hwline v024 hc71 hw2 hw3 * Save supplementary file of waz scores (hw71) for just the 5 states (2, 8, 12, 22, 23) save iahw22fl_supp_waz.dta, replace histogram hc71 if hc71<9996