I trying to calculate an HDDS score which is basically a sum of food types that a household has consumed in the last 24hr. Each food type is coded 1 for Yes or 0 for No where calculating it by hand is just adding all the ones for each household; the max score number should be 12 for 12 food types. Using this principle I thought it was simply creating an HDDS variable and then replacing it with an addition of all the food types but it doesn't seem to be that simple.
This is what I did but it returns fewer observations than expected
gen HDDS =.
replace HDDS = FD_CEREAL+FD_SUGAR+FD_OIL+FD_PULSES+FD_FISH.......
Thanks for your help
Mona
Related Posts with Calcultating Household Diet score(HDDS)
"codebook, compact" with complete names of variables?Hi all, I use STATA 17 and I do like the "codebook, compact" command to generate a log-file with inf…
Predict residuals after running a FE / RE modelHow can residual centering be done after running a panel data regression? It can be done easily aft…
Inverted U-Shape combined with moderationHello everyone, for the analysis of my data I identified a inverted U-shape as suitable for my mode…
Percentage explained by the standard deviation of linear combination of independent variablesHello, everyone, I have a question about using standard deviation to explain changes in the dependen…
Using margins command after medeffHi all, I used medeff comand to see mediation effects. Because my outcome variable and mediator var…
Subscribe to:
Post Comments (Atom)
0 Response to Calcultating Household Diet score(HDDS)
Post a Comment