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)
How can I combine many data sets into one having a common variable in each one?Hi all, I 'm dealing with panel data (monthly based) , having 7 different data sets it's difficult …
pc_simulate invalid syntax errorDear all, I am trying to use the command pc_simulate from the package PC_PANEL. I get a "syntax erro…
deleting variables with the same valuesHello everyone, I would like to delete all variables of a dataset, in which all observations have t…
A really basic thing for <= and <, why returning the same result?Hi! I have a really basic question here, it's so strange, can someone help to identify where the pro…
Extract alphanumeric ids from textDear STATAlisters, I have a column of text, which also contains number(s). It has some peculiaritie…
Subscribe to:
Post Comments (Atom)
0 Response to Calcultating Household Diet score(HDDS)
Post a Comment