/***************************************************************************** This do file creates z scores for anthropometric indicators in routine monitoring data collected in endline survey. Updated on 6/17/2024 *****************************************************************************/ clear set more off capture log close ** Prepare data for z-score construction ** use "${el_processed}/household_el.dta",clear keep folio fecha_ini T1 T2 Control tratamiento_hogar merge 1:m folio using "${el_raw}/sec_16.dta" // 371 master only -- almost all are those that didn't complete the survey * keep those with anthro data keep if _merge==3 * gen birthday gen fecha_nacimiento = mdy(q02_07m, q02_07d, q02_07a) format fecha_nacimiento %d label var q02_07d "Fecha de nacimiento - DIA" label var q02_07m "Fecha de nacimineto - MES" label var q02_07a "Fecha de nacimiento - AÑO" label var fecha_nacimiento "Fecha de nacimiento" * identify target children by birthdays gen target1 = inrange(fecha_nacimiento, td(23apr2018), td(13sep2019)) replace target1=. if fecha_nacimiento==. tab target1, m // 1,217 in range // 103 out of range * Calculate how many days the out of range kids are from bday interval gen startint = mdy(04, 23, 2018) format startint %d gen daysbetween = . replace daysbetween = fecha_nacimiento - startint replace daysbetween = . if target1==1 sum daysbetween tab daysbetween histogram daysbetween, bin(20) frequency xtitle(Days born outside of age interval) * ~ 70% of these are within 52 days of this interval, pretty close to protocol; keep replace target1 =1 if daysbetween < 0 & daysbetween >= -53 // 30 children that are too old or too young * Interval: March 1, 2018 - Sep 1, 2019 gen target2 = inrange(fecha_nacimiento, td(01mar2018), td(01sep2019)) // matches target1 * Sex target children / sec16 rename q02_03 sexo lab define sexo 1 "MASCULINO" 2 "FEMENINO" tab sexo * Weight / sec16 gen peso= q16_05 label var peso "Peso (kg)" label var q16_05 "Peso (kg) (bl=P0215B)" * Height / sec 16 gen talla=(q16_04) label var talla "Talla (cm)" * Date of measurement replace q16_01d=. if q16_01d==42 tab q16_01a replace q16_01a=. if q16_01a>2022 gen fecha_medicion = mdy(q16_01m, q16_01d, q16_01a) format fecha_medicion %d label var fecha_medicion "Fecha de medida antropometrica" tab fecha_medicion * kdensity fecha_medicion, xla(, format("%td")) // this date looks like it has some typos // use endline interview date for exact age calculation instead * Calculate age of target child at time of measurement (in days) gen edad_dias= fecha_ini - fecha_nacimiento label var edad_dias "Edad en dias" * Age in years gen edad_anos = edad_dias/(365.25) label var edad_anos "Edad en años" keep folio sexo fecha_nacimiento fecha_medicion peso talla edad_dias edad_anos id_s16_ni id_persona T1 T2 Control tratamiento_hogar comunidad tratamiento_hogar id_s16_ma target1 q16_09 save "$el_processed/z_score_surveydata.dta", replace *** Anthropometrics (construct z scores)** clear all set more 1 *set maxvar 10000 use "$el_processed/z_score_surveydata.dta", clear * use "${el_processed}/z_score_surveydata.dta", clear set more off * Tell Stata where igrowup_restricted.ado is located */ // note: the pathnames in igrowup_restricted.ado may need to be updated for use on Mac adopath + "$dir/igrowup_update-master" /* Generate first three paramaeters: reflib, datalib & datalab */ gen str60 reflib="$dir/igrowup_update-master" lab var reflib "Directory of reference tables" gen str60 datalib="$dir/igrowup_update-master" lab var datalib "Directory for datafiles" gen str30 datalab="mysurvey" lab var datalab "Working file" /* Check parameters */ tab edad_dias // month is rounded here, paramater expects an exact age gen str6 ageunit="days" lab var ageunit "days" tab peso, m tab talla, m gen str1 measure=" " label var measure "Posicion al medir" gen str1 oedema=" " label var oedema "Oedema" gen sw=1 /* Fill in macro parameters to execute command - [note: using updated ado file to run on mac, use _windows if using windows] */ igrowup_restricted reflib datalib datalab sexo edad_dias ageunit peso talla measure oedema sw /* Load the created data*/ use "$dir/igrowup_update-master/mysurvey_z_rc.dta", clear drop reflib datalib datalab sum _z* *Set extreme values to missing replace _zlen=. if _flen==1 replace _zwei=. if _fwei==1 replace _zwf=. if _fwfl==1 replace _zbmi=. if _fbmi==1 ******************************************************************************** * SEVERE OR MODERATE MALNUTRITION * ******************************************************************************** * Height for age gen hfa_2sd=_zlen<-2 replace hfa_2sd=. if _zlen==. | _flen==1 label var hfa_2sd "Stunted (HAZ < -2SD)" *label var hfa_2sd "Severe or moderate chronic malnutrition (Height for age)" * Weight for age gen wfa_2sd=_zwei<-2 replace wfa_2sd=. if _zwei==. | _fwei==1 *label var wfa_2sd "Severe or moderate malnutrition (Weight for age)" label var wfa_2sd "Underweight (WAZ < -2SD)" * Weight for height gen wfh_2sd=_zwfl<-2 replace wfh_2sd=. if _zwfl==. | _fwfl==1 *label var wfh_2sd "Severe or moderate acute malnutrition (Weight for height)" label var wfh_2sd "Wasted (WHZ < -2SD)" * Weight for height HIGH gen wfh_2sdplus = _zwfl> 2 replace wfh_2sdplus=. if _zwfl==. | _fwfl==1 label var wfh_2sdplus "Overweight or obese (WFH > 2SD)" * BMI (BMI-for-age z-score) gen bmi_2sd= _zbmi> 2 replace bmi_2sd=. if _zbmi==. | _fbmi==1 label var bmi_2sd "Overweight or obese (BAZ > 2SD)" ******************************************************************************** * SEVERE MALNUTRITION * ******************************************************************************** * Height for age gen hfa_3sd=_zlen<-3 replace hfa_3sd=. if _zlen==. | _flen==1 *label var hfa_3sd "Severe chronic malnutrition (Height for age)" label var hfa_3sd "Severely stunted (HAZ < -3SD)" * Weight for age gen wfa_3sd=_zwei<-3 replace wfa_3sd=. if _zwei==. | _fwei==1 *label var wfa_3sd "Severe malnutrition (Weight for age)" label var wfa_3sd "Severely underweight (WAZ < -3SD)" * Weight for height gen wfh_3sd=_zwfl<-3 replace wfh_3sd=. if _zwfl==. | _fwfl==1 *label var wfh_3sd "Severe acute malnutrition (Weight for height)" label var wfh_3sd "Severely wasted (WHZ < -3SD)" * BMI,(BMI-for-age z-score) gen bmi_3sd= _zbmi> 3 replace bmi_3sd=. if _zbmi==. | _fbmi==1 label var bmi_3sd "Obese (BAZ > 3SD)" drop oedema measure sw ageunit order folio comunidad id* fecha_nacimiento sexo fecha_medicion edad_dias edad_anos tratamiento_hogar T1 T2 Control talla peso _cbmi _z* *_2sd *_3sd ** Relabel variables ** label var _zwfl "Weight-for-height z-score (WHZ)" label var _zwei "Weight-for-age z-score (WAZ)" label var _zlen "Height-for-age z-score (HAZ)" label var _zbmi "BMI-for-age z-score (BAZ)" ** Anemia/Haemoglobin ** ** WHO 2024 haemoglobin cutoffs to define anemia: https://iris.who.int/bitstream/handle/10665/376196/9789240088542-eng.pdf?sequence=1 * Adjust anemia for altitude // 1-499m, no adjustment // 500-999, subtract 4 g/L // 1000-1499m, subtract 8 g/L // 1500m-1999m, subtract 11 g/L // 2000m-2499m, subtract 14 g/L merge m:1 folio using "${el_raw}/SPOON_altitude.dta" // 371 from using drop if _merge==2 drop _merge * altitude missing for 33 households, impute with community average egen avg_altitude = mean(q00_06), by(comunidad) gen altitude=q00_06 replace altitude=avg_altitude if altitude==. sum altitude gen haemoglobin = q16_09 * 10 //convert from g/dL to g/L gen adj_haemoglobin=haemoglobin if altitude<500 replace adj_haemoglobin= (haemoglobin-4) if (altitude>= 500 & altitude<=999) replace adj_haemoglobin= (haemoglobin-8) if (altitude>= 1000 & altitude<=1499) replace adj_haemoglobin= (haemoglobin-11) if (altitude>= 1500 & altitude<=1999) replace adj_haemoglobin= (haemoglobin-14) if (altitude>= 2000 & altitude<=2499) label var adj_haemoglobin "Altitude-adjusted hemoglobin concentration (g/L)" ** Anemia categories * cutoffs vary by age, can use exact years (6-23 months = <2 years ; 24-59 = >=2 & <5 years) sum edad_anos // no children above 5; sum edad_anos if edad_anos < 2 // 21 kids less than 24 months at endline gen anemia =. replace anemia = 1 if adj_haemoglobin <70 // same for both age ranges replace anemia = 2 if adj_haemoglobin >=70 & adj_haemoglobin <95 & edad_anos<2 // 6-23 months replace anemia = 2 if adj_haemoglobin >=70 & adj_haemoglobin <100 & edad_anos>=2 // 24-59 months replace anemia = 3 if adj_haemoglobin >=95 & adj_haemoglobin <105 & edad_anos<2 // 6-23 months replace anemia = 3 if adj_haemoglobin >=100 & adj_haemoglobin <110 & edad_anos>=2 // 24-59 months replace anemia = 4 if adj_haemoglobin >=105 & edad_anos<2 // 6-23 months replace anemia = 4 if adj_haemoglobin >=110 & edad_anos>=2 // 24-59 months replace anemia =. if adj_haemoglobin==. // make sure missing levels are still coded as missing label var anemia "Anemia severity" label define anemia_labs 1 "Severe anemia" 2 "Moderate anemia" 3 "Mild anemia" 4 "No anemia" label values anemia anemia_labs sum adj_haemoglobin sum anemia // no kids with severe anemia in this sample * create dummies for table 1 gen anemia_moderate = (anemia==2) replace anemia_moderate =. if anemia==. gen anemia_mild = (anemia==3) replace anemia_mild =. if anemia==. gen no_anemia = (anemia==4) replace no_anemia =. if anemia==. label var no_anemia "No anemia" label var anemia_mild "Mild anemia" label var anemia_moderate "Moderate anemia" * Generate binary anemia gen anemia_d = (anemia==2 | anemia==3) replace anemia_d=. if anemia==. lab var anemia_d "Anemia" ** Calculate prevelance of Anemia by treatment status bysort tratamiento_hogar: sum anemia_d gen male = (sexo==1) lab var male "Hombre=1" save "$el_processed/endline_anthro.dta", replace