* Last updated by A Prost: 8TH JULY 2019 clear * We include all children potentially alive at 6 months (i.e. who. have not migrated and are not known to be dead at 6 months keep if availability_six==1 * We generate variables to identify children who completed follow-up and those lost to follow-up (did not die or migrate permanently) capture drop any_migrate gen any_migrate=1 if migrated_six==1| migrated_nine==1 | migrated_twelve==1 tab any_migrate, m ** Figure 1: Study profile tab availability_six, m tab confirm_end_form_six, m count if wlz2!=. & anthro_wlz_flag_six!=1 count if muac2!=. tab migrated_nine, m replace availability_nine=1 if case_id=="fcb3f0b7-1441-499c-b857-0d1167c537b5" tab availability_nine, m tab confirm_end_form_nine, m count if wlz3!=. & anthro_wlz_flag_nine!=1 count if muac3!=. tab migrated_twelve, m tab availability_twelve, m tab confirm_end_form_twelve, m count if wlz4!=. & anthro_wlz_flag_twelve!=1 count if muac4!=. tab availability_eighteen, m tab confirm_end_form_eighteen, m count if wlz5!=. & anthro_wlz_flag_eighteen!=1 count if muac5!=. *** Table 1: Characteristics of participants capture drop known_status gen known_status=. replace known_status=1 if confirm_end_form_eighteen==1 | (death_timing>=1 & death_timing!=.) replace known_status=0 if known_status==. tab known_status, m tab district known_status, m col freq chi tab tribe_caste known_status, m col freq chi tab assetquintile known_status, m col freq chi tab child_sex known_status, m col freq chi * 2 is male; 1 is female bys known_status: tabstat mean_mat_height_cm, stat (me sd) ttest mean_mat_height_cm, by(known_status) bys known_status: tabstat mother_age, stat (me sd) ttest mother_age, by(known_status) preserve keep if parity!=0 bys known_status: tabstat parity, stat (me sd min max) ttest parity, by(known_status) restore bys known_status: tabstat mean_birth_weight, stat (me sd) ttest mean_birth_weight, by(known_status) tab literacy known_status, m col freq chi ***** Supplementary table 1: Deaths, survival and recovery following moderate and severe acute malnutrition by WLZ, MUAC and bilateral pitting oedema ** Count prevalent cases at the start of each age group follow-up tranche capture drop prev_three gen prev_three=. replace prev_three=2 if (wlz1<-3 & wlz1!=. & anthro_wlz_flag_three!=1) replace prev_three=1 if (wlz1>=-3 & wlz1<-2 & wlz1!=. & anthro_wlz_flag_three!=1) replace prev_three=0 if (wlz1>=-2 & anthro_wlz_flag_three!=1) tab prev_three, m capture drop prev_six gen prev_six=. replace prev_six=1 if (wlz2<-2 & wlz2!=. & wlz2>=-3 & anthro_wlz_flag_six!=1) | ( muac2>=11.5 & muac2<12.5 & muac2!=.) replace prev_six=2 if (wlz2<-3 & wlz2!=. & anthro_wlz_flag_six!=1) | (muac2<11.5 & muac2!=.) | edema2==1 replace prev_six=0 if (wlz2>=-2) & (muac2>=12.5 & muac2!=.) & edema2!=1 tab prev_six if availability_six==1, m count if prev_six==. & confirm_end_form_six==1 capture drop prev_nine gen prev_nine=. replace prev_nine=0 if (wlz3>=-2) & (muac3>=12.5 & muac3!=.) & edema3!=1 replace prev_nine=1 if (wlz3>=-3 & wlz3<-2 & wlz3!=. & anthro_wlz_flag_nine!=1) | (muac3<12.5 & muac3>=11.5 & muac3!=.) replace prev_nine=2 if (wlz3<-3 & wlz3!=. & anthro_wlz_flag_nine!=1) | (muac3<11.5 & muac3!=.) | edema3==1 tab prev_nine if availability_nine==1, m freq capture drop prev_twelve gen prev_twelve=. replace prev_twelve=0 if (wlz4>=-2) & (muac4>=12.5 & muac4!=.) & edema4!=1 replace prev_twelve=1 if (wlz4>=-3 & wlz4<-2 & wlz4!=. & anthro_wlz_flag_twelve!=1) | (muac4<12.5 & muac4>=11.5 & muac4!=.) replace prev_twelve=2 if (wlz4<-3 & wlz4!=. & anthro_wlz_flag_twelve!=1) | (muac4<11.5 & muac4!=.) | edema4==1 tab prev_twelve if availability_twelve==1, m freq capture drop prev_eighteen gen prev_eighteen=. replace prev_eighteen=0 if (wlz5>=-2) & (muac5>=12.5 & muac5!=.) & edema5!=1 replace prev_eighteen=1 if (wlz5>=-3 & wlz5<-2 & wlz5!=. & anthro_wlz_flag_eighteen!=1) | (muac5<12.5 & muac5>=11.5 & muac5!=.) replace prev_eighteen=2 if (wlz5<-3 & wlz5!=. & anthro_wlz_flag_eighteen!=1) | (muac5<11.5 & muac5!=.) | edema5==1 tab prev_eighteen if availability_eighteen==1, m freq ** Check that all prevalences and deaths are correctly recorded list prev_nine death_timing if case_id=="178a0fcb-0c58-42b6-9fd9-3e4ec5c855c1" * Correct list prev_nine death_timing if case_id=="190e9177-846c-478c-aa3a-e5a91e127265" * Correct list prev_twelve death_timing if case_id=="1b7dbde7-5cc1-496f-8094-930272c32a8c" * Correct list prev_six death_timing if case_id=="4ce17424-4060-4842-a86d-c0a427cc6974" * Correct list prev_six death_timing if case_id=="530f9e1c-86c8-40af-a221-829e796f0e40" * Correct list prev_nine death_timing if case_id=="59f0f276-1d4a-413b-a803-fc088551b45f" * Correct list prev_nine death_timing if case_id=="77db08fe-9d26-4710-ae58-90a5511f90a8" * Correct list prev_six death_timing if case_id=="84193b9b-2901-4bd0-ad4b-fa1d7c61a775" * Correct list prev_six death_timing if case_id=="8598d22e-1dfa-4620-8936-3b99638909a0" * Correct list prev_nine death_timing if case_id=="89b97b11-194e-4cdc-a78f-a37379b1f13f" * Correct list prev_six death_timing if case_id=="99791188-0904-4e77-9c71-afdb37e565c0" * Correct list prev_six death_timing if case_id=="abf42c86-c26b-4009-9764-f4b22d283a5a" * Correct - was prevalent at three and died after six list prev_nine death_timing if case_id=="b314eacd-378e-4ea3-b36e-6a0f51991d3c" * COrrect list prev_six death_timing if case_id=="c1a02262-7934-4739-8bd4-98cf8ab51f8e" * Correct list prev_nine death_timing if case_id=="d0ae8ece-b527-43ae-b311-eee545195e7a" * Ok list prev_twelve death_timing if case_id=="e72ec69d-94bc-40ed-be78-8214b5509e1f" * Ok list prev_nine death_timing if case_id=="fcb3f0b7-1441-499c-b857-0d1167c537b5" capture drop death_sam_next_fu gen death_sam_next_fu=. replace death_sam_next_fu=1 if case_id=="178a0fcb-0c58-42b6-9fd9-3e4ec5c855c1" replace death_sam_next_fu=1 if case_id=="59f0f276-1d4a-413b-a803-fc088551b45f" replace death_sam_next_fu=1 if case_id=="8598d22e-1dfa-4620-8936-3b99638909a0" replace death_sam_next_fu=1 if case_id=="fcb3f0b7-1441-499c-b857-0d1167c537b5" tab death_sam_next_fu, m capture drop death_mam_next_fu gen death_mam_next_fu=. replace death_mam_next_fu=1 if case_id=="4ce17424-4060-4842-a86d-c0a427cc6974" replace death_mam_next_fu=1 if case_id=="84193b9b-2901-4bd0-ad4b-fa1d7c61a775" replace death_mam_next_fu=1 if case_id=="89b97b11-194e-4cdc-a78f-a37379b1f13f" replace death_mam_next_fu=1 if case_id=="99791188-0904-4e77-9c71-afdb37e565c0" replace death_mam_next_fu=1 if case_id=="e72ec69d-94bc-40ed-be78-8214b5509e1f" tab death_mam_next_fu, m *** Dead at next follow-up? count if prev_six==2 & death_sam_next_fu==1 & availability_six==1 count if prev_six==2 & death_sam_next_fu==. & death_after_sam==1 & death_timing>4 & availability_six==1 count if prev_six==1 & death_mam_next_fu==1 count if prev_six==0 & death_timing==4 & availability_six==1 count if prev_six==. & death_timing==4 & availability_six==1 count if prev_nine==2 & death_sam_next_fu==1 & availability_nine==1 count if prev_nine==1 & death_mam_next_fu==1 & availability_nine==1 count if prev_nine==0 & death_timing==5 & availability_nine==1 count if prev_nine==. & death_timing==5 & availability_nine==1 count if prev_twelve==2 & death_sam_next_fu==1 & availability_twelve==1 count if prev_twelve==1 & death_mam_next_fu==1 & availability_twelve==1 count if prev_twelve==0 & death_timing==6 & availability_twelve==1 count if prev_twelve==. & death_timing==6 & availability_twelve==1 * Alive at next follow-up? count if prev_six==2 & (whether_alive_nine==1 | whether_alive_twelve==1 | whether_alive_eighteen==1) count if prev_six==1 & (whether_alive_nine==1 | whether_alive_twelve==1 | whether_alive_eighteen==1) count if prev_six==0 & (whether_alive_nine==1 | whether_alive_twelve==1 | whether_alive_eighteen==1) count if prev_six==. & (whether_alive_nine==1 | whether_alive_twelve==1 | whether_alive_eighteen==1) count if prev_nine==2 & (whether_alive_twelve==1 | whether_alive_eighteen==1) count if prev_nine==1 & (whether_alive_twelve==1 | whether_alive_eighteen==1) count if prev_nine==0 & (whether_alive_twelve==1 | whether_alive_eighteen==1) count if prev_nine==. & (whether_alive_twelve==1 | whether_alive_eighteen==1) count if prev_twelve==2 & (whether_alive_eighteen==1) count if prev_twelve==1 & (whether_alive_eighteen==1) count if prev_twelve==0 & (whether_alive_eighteen==1) count if prev_twelve==. & (whether_alive_eighteen==1) *** Remained or became malnourished at next follow-up - this is used to fill out Table 2 not these are not individual incident cases, which are calculated further below) tab prev_six prev_nine, m row freq tab prev_nine prev_twelve if availability_nine==1, m row freq tab prev_twelve prev_eighteen if availability_twelve==1 & prev_six!=2 & prev_nine!=2, m row freq * How many cases of SAM from 6-18 months? * Prevalent cases of SAM at 6 months count if prev_six==2 *230 cases * Incident cases of SAM at 6 months tab prev_three prev_six, m col freq * 135 incident cases at six months * Cases who are not SAM at 6 months or missing, not dead before 9 months, and prevalent with SAM at 9 months count if prev_six!=2 & prev_nine==2 & availability_nine==1 * 202 cases - matching * Cases who are not SAM at 6 or 9 months, missing at both of these time points, not dead before 12 months, and prevalent with SAM at 12 months count if prev_six!=2 & prev_nine!=2 & prev_twelve==2 & availability_twelve==1 * 152 cases di 135+202+152 * 489 incident cases of SAM from 6-18 months * Prevalent cases of MAM at 6 months count if prev_six==1 *628 cases * Incident cases of MAM at 6 months * Cases who are not MAM at 6 months or missing, not dead before 9 months, and prevalent with MAM at 9 months count if prev_six!=1 & prev_nine==1 & availability_nine==1 * Cases who are not MAM at 6 or 9 months, missing at both of these time points, not dead before 12 months, and prevalent with MAM at 12 months count if prev_six!=1 & prev_nine!=1 & prev_twelve==1 & availability_twelve==1 *MAM incidence rate di 1258/2686*1000 count if prev_six!=. & prev_nine==. & prev_twelve!=. & availability_nine==1 count if prev_six==. & prev_nine!=. & prev_twelve!=. & availability_nine==1 count if prev_six!=. & prev_nine==. & prev_twelve!=. & availability_twelve==1 capture drop n_sam_episode egen n_sam_episodes=anycount(prev_six prev_nine prev_twelve prev_eighteen), v(2) tab n_sam_episodes, m capture drop n_mam_episode egen n_mam_episodes=anycount(prev_six prev_nine prev_twelve prev_eighteen), v(1) tab n_mam_episodes, m count if n_sam_episodes>1 | n_mam_episodes>1 count if n_sam_episodes>1 | n_mam_episodes>1 & death!=1 ** How many incident cases referred to MTC count if prev_six==2 & mtc_refer_nine==1 * Cases who are not SAM at 6 months or missing, not dead before 9 months, and prevalent with SAM at 9 months count if prev_six!=2 & prev_nine==2 & availability_nine==1 count if prev_six!=2 & prev_nine==2 & mtc_refer_twelve==1 & availability_nine==1 * Cases who are not SAM at 6 or 9 months, missing at both of these time points, not dead before 12 months, and prevalent with SAM at 12 months count if prev_six!=2 & prev_nine!=2 & prev_twelve==2 & availability_twelve==1 count if prev_six!=2 & prev_nine!=2 & prev_twelve==2 & mtc_refer_eighteen & availability_twelve==1 * Create a variable for survival time capture drop stime_days gen stime_days=. replace stime_days=eighteen_months_interview_daten-date_six_birthday if confirm_end_form_eighteen==1 & death!=1 replace stime_days=twelve_months_interview_daten-date_six_birthday if confirm_end_form_eighteen!=1 & confirm_end_form_twelve==1 & death!=1 replace stime_days=nine_months_interview_daten-date_six_birthday if confirm_end_form_eighteen!=1 & confirm_end_form_twelve!=1 & confirm_end_form_nine==1 & death!=1 replace stime_days=six_months_interview_daten-date_six_birthday if confirm_end_form_eighteen!=1 & confirm_end_form_twelve!=1 & confirm_end_form_nine!=1 & confirm_end_form_six==1 & death!=1 replace stime_days= dod_num-dob if death==1 replace dod_num=six_months_interview_daten if case_id=="84193b9b-2901-4bd0-ad4b-fa1d7c61a775" replace stime_days=dod_num-dob if case_id=="84193b9b-2901-4bd0-ad4b-fa1d7c61a775" count if stime_days==. capture drop stime_months capture drop stime_weeks capture drop stime_years gen stime_months=stime_days/30.42 gen stime_weeks=stime_days/52.1429 gen stime_years=stime_days/365 ** Table 2: Associations between indicators of malnutrition and all-cause mortality stset, clear keep row wlz0 wlz1 wlz2 wlz3 wlz4 wlz5 muac2 muac3 muac4 muac5 edema2 edema3 edema4 edema5 age0 age1 age2 age3 age4 age5 death stime_days child_sex alloc district village_unit * drop if no wlz measurements - no information to impute drop if wlz0==. & wlz1==. & wlz2==. & wlz3==. & wlz4==. & wlz5==. * 10 deleted drop if muac2==. & muac3==. & muac4==. * 55 deleted * drop also if immediately censored - i.e. first visit and no subsequent visit - as no real follow-up time for analysis drop if age0==stime_days * 3 deleted ** A total of 68 cases deleted prior to imputation * define age at visit for all infants and visits - these can be defined even if no visit occured and do not need to be imputed recode age0 .=1 recode age1 .=91 recode age2 .=182 recode age3 .=273 recode age4 .=365 recode age5 .=547 * start process to impute missing values of wlz, muac and edema mi set flong mi register imputed wlz0 wlz1 wlz2 wlz3 wlz4 wlz5 muac2 muac3 muac4 muac5 edema2 edema3 edema4 edema5 mi describe mi misstable patterns, frequency * missing wlz values are imputed conditional on wlz at other times for the infant and also on whether infant subsequently died * and time of death/censoring * note this will impute wlz after death, but these can be subsequently deleted mi impute chained /// (regress) wlz0 /// (regress) wlz1 /// (regress) wlz2 /// (regress) wlz3 /// (regress) wlz4 /// (regress) wlz5 /// (regress) muac2 /// (regress) muac3 /// (regress) muac4 /// (regress) muac5 /// (logit, augment) edema2 /// (logit, augment) edema3 /// (logit, augment) edema4 /// (logit, augment) edema5=death stime_days, add(30) rseed(190418) force mi reshape long wlz muac edema age, i(row) j(vis) * before we do the formal survival analysis need to do simple analysis of cumulative mortality and recovery from SAM * look into simple measures of recovery, ongoing or dead over time * make a compsite measure of SAM, intermediate (effectively MAM), recovered or dead gen hasdied=1 if death==1 & age>=stime_days gen alive6=1 if death==0 | (death==1 & stime_days>180) * make indicators of malnutition gen nwasted=wlz recode nwasted min/-3.0001=2 -3/-2.00001=1 -2/max=0 gen nlow_muac=muac recode nlow_muac min/11.49999=2 11.5/12.49999=1 12.5/max=0 * now composite at each time point: SAM, MAM, healthy or dead gen sam=1 if (nwasted==2 | edema==1 | nlow_muac==2) recode sam .=2 if (nwasted==1 | nlow_muac==1) recode sam .=3 if (nwasted==0 & edema==0 & nlow_muac==0) replace sam=4 if hasdied==1 label def sams 1 "SAM" 2 "MAM" 3 "healthy" 4 "dead" label val sam sams * return to wide format to look tabes and charts of cumulative effect of SAM on subsequent health drop hasdied nlow_muac nwasted mi reshape wide wlz muac edema age sam, i(row) j(vis) label var sam2 "SAM status 6/12" label var sam3 "SAM status 9/12" label var sam4 "SAM status 12/12" label var sam5 "SAM status 18/12" tab sam2 sam3 if _mi_m>0 & alive6==1, row tab sam2 sam4 if _mi_m>0 & alive6==1, row tab sam2 sam5 if _mi_m>0 & alive6==1, row * Andrew: stacked bar chart would be great, but can't figure out how to do in Stata. * AP: Ok, I did this in excel and rechecked it following your comment about the % of deaths seeming too high. * move on to formal survival analysis, first reshape back to long mi reshape long wlz muac edema age sam, i(row) j(vis) * need to reformat data to match what is expected for survival data * for example wlz at visit 0 (birth) applies really to survival up to 3 months, and * wlz at 18 months is not relevant - we use wlz to predict the future not the past sort row _mi_m age by row _mi_m: gen wlz2 = wlz[_n-1] if _n>1 by row _mi_m: gen muac2 = muac[_n-1] if _n>1 by row _mi_m: gen edema2 = edema[_n-1] if _n>1 by row _mi_m: gen sam2 = sam[_n-1] if _n>1 * now make a time variable, also drop the first row for each infant and also drop any rows after death * which exist because I defined visit times and imputed wlz after death gen time = age sort row _mi_m age by row _mi_m: replace time=stime_days if death==1 & time>stime_days & time[_n-1]stime_days * now make a death indicator that is zero for censored and 1 if died at the time point capture drop died gen died=0 sort row _mi_m by row _mi_m: replace died=1 if death==1 & _n==_N * we now focus on events after 6 months, so drop the rows for 3 and 6 month measurement drop if vis==1 | vis==2 * make indicator of moderate and severe malnutrition capture drop wasted assert wlz2 ~=. if _mi_m>0 gen wasted = wlz2 replace wasted=0 if wasted>=-2 replace wasted=1 if wasted<-2 & wasted>=-3 replace wasted=2 if wasted<-3 * next step not appropriate for imputed z-scores - if imputed to be extreme can be interpreted as real not mistakes * replace wasted=. if wlz2<-6 | wlz2>6 tab wasted if _mi_m>0 capture drop low_muac assert muac2~=. if _mi_m>0 gen low_muac = muac2 replace low_muac=2 if muac2<11.5 replace low_muac=0 if muac2>=12.5 replace low_muac=1 if muac2<12.5 & muac2>=11.5 tab low_muac if _mi_m>0 capture drop edema_sam assert (edema2==0 | edema2==1) if _mi_m>0 gen edema_sam = edema2 *replace edema_sam=1 if edema2==1 *replace edema_sam=0 if edema2<1 & edema2!=. tab edema_sam if _mi_m>0 * look at a composite measure of MAM or SAM capture drop all_sam gen all_sam = 1 if wasted>=1 | edema_sam==1 | low_muac>=1 recode all_sam .=0 * stset the data ready for survival analysis mi stset time, failure(died) id(row) * Table 2: Associations between anthropometric indicators of moderate or severe acute malnutrition and short-term a all-cause mortality mi estimate, hr: stcox i.all_sam, vce(cluster village_unit) mi estimate, hr: stcox i.all_sam i.child_sex i.alloc i.district, vce(cluster village_unit) strate all_sam if _mi_m>0 di 0.0000251*365250 di 0.0000533*365250 ** Control arm only: *0.0000230 0.0000199 0.0000266 * 0.0000676 0.0000603 0.0000757 di 0.0000230*365250 di 0.0000676*365250 * Effect with wasting only mi estimate, hr: stcox i.wasted, vce(cluster village_unit) mi estimate, hr: stcox wasted, vce(cluster village_unit) mi estimate, hr: stcox i.wasted i.child_sex i.alloc i.district, vce(cluster village_unit) mi estimate, hr: stcox wasted i.child_sex i.alloc i.district, vce(cluster village_unit) mi test 1.wasted 2.wasted strate wasted if _mi_m>0 di 0.0000255*365250 di 0.0000580*365250 di 0.0000696*365250 mi estimate, hr: stcox i.wasted, vce(cluster village_unit) mi estimate, hr: stcox i.wasted child_sex alloc district, vce(cluster village_unit) * Effect with MUAC only mi estimate, hr: stcox i.low_muac, vce(cluster village_unit) mi estimate, hr: stcox i.low_muac i.child_sex i.alloc i.district, vce(cluster village_unit) mi estimate, hr: stcox low_muac, vce(cluster village_unit) mi estimate, hr: stcox low_muac i.child_sex i.alloc i.district, vce(cluster village_unit) mi test 1.low_muac 2.low_muac strate low_muac if _mi_m>0 di 0.0000279*365250 di 0.0000671*365250 mi estimate, hr: stcox low_muac, vce(cluster village_unit) mi estimate, hr: stcox low_muac i.child_sex alloc district, vce(cluster village_unit) * Effect with edema only mi estimate, hr: stcox edema_sam, vce(cluster village_unit) mi estimate, hr: stcox edema_sam i.child_sex i.alloc i.district, vce(cluster village_unit) strate edema_sam if _mi_m>0 di 0.0000334 *365250 mi estimate, hr: stcox edema_sam, vce(cluster village_unit) mi estimate, hr: stcox edema_sam child_sex alloc district, vce(cluster village_unit) * Effect of MAM and SAM separately as defined earlier gen newsam=sam2 recode newsam 3=0 2=1 1=2 4=. label def newsams 2 "SAM" 1 "MAM" 0 "healthy" label val newsam newsams mi estimate, hr: stcox i.newsam, vce(cluster village_unit) mi estimate, hr: stcox i.newsam i.child_sex i.alloc i.district, vce(cluster village_unit) mi test 1.newsam 2.newsam strate newsam if _mi_m>0 strate newsam if _mi_m>0 & child_sex==1 strate newsam if _mi_m>0 & child_sex==2 mi estimate, hr: stcox i.newsam, vce(cluster village_unit) mi estimate, hr: stcox i.newsam child_sex alloc district, vce(cluster village_unit) mi estimate, hr: stcox newsam, vce(cluster village_unit) mi estimate, hr: stcox newsam child_sex alloc district, vce(cluster village_unit)