Hi everyone,
Am doing a study and my outcome variable is Multiple forms of undernutrition. I have calculated my z scores and gotten variables for stunting, wasting, underweight, and anemia. I need to generate a variable ( Coexisted) that will mean a child that experiences at least two or more of the forms of undernutrition concurrently so I can continue with my analysis.
I tried this syntax but it didn't work
//generate Coexisted=1. if stunting=1|wasting=1|underweight=1|anemia=1
replace Coexisted=0 if stunting=0|wasting=0|underweight=0|anemia=0
replace Coexisted=. if stunting==.|wasting==.|underweight==.|anemia=.
label define 1 “Coexisted “ 0 “Not Coexisted”, replace
label values Coexisted Coexisted //
Am doing a study and my outcome variable is Multiple forms of undernutrition. I have calculated my z scores and gotten variables for stunting, wasting, underweight, and anemia. I need to generate a variable ( Coexisted) that will mean a child that experiences at least two or more of the forms of undernutrition concurrently so I can continue with my analysis.
I tried this syntax but it didn't work
//generate Coexisted=1. if stunting=1|wasting=1|underweight=1|anemia=1
replace Coexisted=0 if stunting=0|wasting=0|underweight=0|anemia=0
replace Coexisted=. if stunting==.|wasting==.|underweight==.|anemia=.
label define 1 “Coexisted “ 0 “Not Coexisted”, replace
label values Coexisted Coexisted //
Comment