View source: R/get_foodscore.R
get_foodscore | R Documentation |
Identification of individual 6-23 months old children who meet the minimum dietary diversity requirement require the information about how many food groups the child consumed yesterday (8 groups in total).
get_foodscore(
breastmilk,
grains,
pulses,
dairy,
meat,
eggs,
vita_fruveg,
oth_fruveg
)
breastmilk |
child received breastfeeding or not |
grains |
child consumed grains food group or not |
pulses |
child consumed pulses food group or not |
dairy |
child consumed diary and milk product food group or not |
meat |
child consumed meat food group or not |
eggs |
child consumed eggs food group or not |
vita_fruveg |
child consumed vitamin A-rich fruits and vegetables or not |
oth_fruveg |
child consumed fruits and vegetables or not |
the integer value at continuous scale (0-8 as the IYCF food groups have 8 food groups).
Nicholus Tint Zaw
# Individual Food Group Variable Construction
df <- iycfData
# General Dummy variable generator function
breastmilk <- round(runif(nrow(df), min = 0, max = 1), 0)
grains <- round(runif(nrow(df), min = 0, max = 1), 0)
pulses <- round(runif(nrow(df), min = 0, max = 1), 0)
dairy <- round(runif(nrow(df), min = 0, max = 1), 0)
meat <- round(runif(nrow(df), min = 0, max = 1), 0)
eggs <- round(runif(nrow(df), min = 0, max = 1), 0)
vita_fruveg <- round(runif(nrow(df), min = 0, max = 1), 0)
oth_fruveg <- round(runif(nrow(df), min = 0, max = 1), 0)
# Calculate Food Consumption Score
food_score <- get_foodscore(breastmilk, grains, pulses, dairy, meat,
eggs, vita_fruveg, oth_fruveg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.