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)
Help file verificationHi all, This might be obvious for most of you, but since I just detected it, I thought to share it …
Understanding gsemDear all, maybe these questions are a bit silly but i am new to sem and gsem and want to use it to t…
Transform decimal to hexadecimalHello, I would like to transform a column of RGB colors codes to hexadecimals codes. In Excel ther …
Error with outreg2 appendDear everybody, I would like to ask for help. I use the outreg2 command, but there is an error like…
Automating command argumentHi All, I am looking for a way to automate writing a command so that it adapts if I change the cova…
Subscribe to:
Post Comments (Atom)
0 Response to Calcultating Household Diet score(HDDS)
Post a Comment