format_nut_health_indicators: Format Nutrition and Health Indicators

View source: R/format_nut_health_indicators.R

format_nut_health_indicatorsR Documentation

Format Nutrition and Health Indicators

Description

This function allows for standardization of variable names and values for technical nutrition and health indicators. The function additionally calls helper functions to reformat, calculate indicators, and create data quality flags for each of the sets of indicators.

Usage

format_nut_health_indicators(
  df,
  file_path = NULL,
  use_flags_yn = NULL,
  hhid = NULL,
  date_of_dc = NULL,
  enum = NULL,
  cluster = NULL,
  id,
  date_of_birth = NULL,
  age_years_var = NULL,
  age_months_var = NULL,
  age_proxy_var = NULL,
  age_days = NULL,
  sex_var,
  oedema_var,
  plw_status_var = NULL,
  muac_var = NULL,
  weight_var = NULL,
  height_var = NULL,
  type_interview = NULL,
  wgss_seeing = NULL,
  wgss_hearing = NULL,
  wgss_walking = NULL,
  wgss_remembering = NULL,
  wgss_selfcare = NULL,
  wgss_communicating = NULL,
  health_barriers = NULL,
  delivery_location = NULL,
  birth_assistant = NULL,
  iycf_caregiver = NULL,
  iycf_1 = NULL,
  iycf_2 = NULL,
  iycf_3 = NULL,
  iycf_4 = NULL,
  iycf_5 = NULL,
  iycf_6a = NULL,
  iycf_6b = NULL,
  iycf_6b_num = NULL,
  iycf_6c = NULL,
  iycf_6c_num = NULL,
  iycf_6c_swt = NULL,
  iycf_6d = NULL,
  iycf_6d_num = NULL,
  iycf_6d_swt = NULL,
  iycf_6e = NULL,
  iycf_6f = NULL,
  iycf_6g = NULL,
  iycf_6h = NULL,
  iycf_6h_swt = NULL,
  iycf_6i = NULL,
  iycf_6j = NULL,
  iycf_6j_swt = NULL,
  iycf_7a = NULL,
  iycf_7a_num = NULL,
  iycf_7b = NULL,
  iycf_7c = NULL,
  iycf_7d = NULL,
  iycf_7e = NULL,
  iycf_7f = NULL,
  iycf_7g = NULL,
  iycf_7h = NULL,
  iycf_7i = NULL,
  iycf_7j = NULL,
  iycf_7k = NULL,
  iycf_7l = NULL,
  iycf_7m = NULL,
  iycf_7n = NULL,
  iycf_7o = NULL,
  iycf_7p = NULL,
  iycf_7q = NULL,
  iycf_7r = NULL,
  iycf_7s = NULL,
  iycf_8 = NULL,
  monthly_expenditures = NULL,
  period_expenditures = NULL,
  num_period_months = NULL,
  health_exp_col = NULL,
  food_exp_col = NULL,
  vaccine_card_yn = NULL,
  penta = NULL,
  penta_date1 = NULL,
  penta_date2 = NULL,
  penta_date3 = NULL,
  penta_count = NULL,
  measles = NULL,
  measles_date1 = NULL,
  measles_date2 = NULL,
  fcs_cereal = NULL,
  fcs_legumes = NULL,
  fcs_dairy = NULL,
  fcs_meat = NULL,
  fcs_veg = NULL,
  fcs_fruit = NULL,
  fcs_oil = NULL,
  fcs_sugar = NULL,
  hdds_cereals = NULL,
  hdds_tubers = NULL,
  hdds_veg = NULL,
  hdds_fruit = NULL,
  hdds_meat = NULL,
  hdds_eggs = NULL,
  hdds_fish = NULL,
  hdds_legumes = NULL,
  hdds_dairy = NULL,
  hdds_oils = NULL,
  hdds_sugars = NULL,
  hdds_condiments = NULL,
  hhs_nofoodhh_1 = NULL,
  hhs_nofoodhh_1a = NULL,
  hhs_sleephungry_2 = NULL,
  hhs_sleephungry_2a = NULL,
  hhs_alldaynight_3 = NULL,
  hhs_alldaynight_3a = NULL,
  rcsi_lesspreferred_1 = NULL,
  rcsi_borrowfood_2 = NULL,
  rcsi_limitportion_3 = NULL,
  rcsi_restrict_4 = NULL,
  rcsi_reducemeals5 = NULL,
  lcs_variables = NULL,
  livelihood_variables = NULL
)

Arguments

df

Inputs a dataframe with nutrition and health data of interest.

file_path

Optional input of a character file path. If included will save an excel sheet of the new dataframe.

use_flags_yn

Optional input if you want to exclude flagged values from the final indicator calculations. If "yes" then records with data quality flags will be treated differently in the calculations.

hhid

Input of a character value specifying the column name for household id. Can use the uuid here as well.

date_of_dc

Input of a character value specifying the column name for date of data collection.

enum

Input of a character value specifying the column name for enumerator or team id.

cluster

Input of a character value specifying the column name for cluster number or id.

id

Input of a character value specifying the column name for an individual id within the household.

date_of_birth

Input of a character value specifying the column name for date of birth

age_years_var

Input of a character value specifying the column name for age in years of the individual

age_months_var

Input of a character value specifying the column name for age in months of the individual

age_proxy_var

Input of a character value specifying the column name for proxy age of children. That is, whether the child is 6-23 months of age, or 24-59 months of age. For use with some MUAC only related data collection.

age_days

Input of a character value specifying the column name for age in days of children under-5 years of age

sex_var

Input of a character value specifying the column name for sex of the individual.

oedema_var

Input of a character value specifying the column name for nutritional oedema

plw_status_var

Input of a character value specifying the column name for pregnant and/or breastfeeding status for women of reproductive age

muac_var

Input of a character value specifying the column name for MUAC measurements in mm or cm

weight_var

Input of a character value specifying the column name for weight measurements in kilograms

height_var

Input of a character value specifying the column name for length and/or height measurements in cm

type_interview

Input of a character value specifying the column name for direct or proxy interviews for Washington Group questions

wgss_seeing

Input of a character value specifying the column name for seeing domain of Washington Group Short Set of questions

wgss_hearing

Input of a character value specifying the column name for hearing domain of Washington Group Short Set of questions

wgss_walking

Input of a character value specifying the column name for walking domain of Washington Group Short Set of questions

wgss_remembering

Input of a character value specifying the column name for remembering domain of Washington Group Short Set of questions

wgss_selfcare

Input of a character value specifying the column name for self-care domain of Washington Group Short Set of questions

wgss_communicating

Input of a character value specifying the column name for communicating domain of Washington Group Short Set of questions

health_barriers

Inputs a character vector of column names for self-reported health barriers.

delivery_location

Input of a character value specifying the column name for child delivery location

birth_assistant

Input of a character value specifying the column name for who attended the woman's birth

iycf_caregiver

Input of a character value specifying the column name for if the primary caregiver or mother of the child was interviewed for the IYCF questions (y/n)

iycf_1

Input of a character value specifying the column name for ever breastfed (y.n)

iycf_2

Input of a character value specifying the column name for how long after birth breastfed

iycf_3

Input of a character value specifying the column name for given anything to eat/drink in first 2 days after delivery

iycf_4

Input of a character value specifying the column name for breastfed yesterday during the day or night (y/n)

iycf_5

Input of a character value specifying the column name for drink anything from bottle with a nipple (y/n)

iycf_6a

Input of a character value specifying the column name for plain water

iycf_6b

Input of a character value specifying the column name for infant formula (y/n)

iycf_6b_num

Input of a character value specifying the column name for infant formula (number)

iycf_6c

Input of a character value specifying the column name for milk from animals, fresh tinned powder (y/n)

iycf_6c_num

Input of a character value specifying the column name for milk form animals, fresh, tinned, pwder (number)

iycf_6c_swt

Input of a character value specifying the column name for milk was sweetened (y/n)

iycf_6d

Input of a character value specifying the column name for yoghurt drinks (y/n)

iycf_6d_num

Input of a character value specifying the column name for yoghurt drinks (number)

iycf_6d_swt

Input of a character value specifying the column name for yoghurt drink was sweetened (y/n)

iycf_6e

Input of a character value specifying the column name for chocolate flavoured drinks, including from syrup / powders (y/n)

iycf_6f

Input of a character value specifying the column name for Fruit juice or fruit-flavoured drinks including those made from syrups or powders? (y/n)

iycf_6g

Input of a character value specifying the column name for sodas, malt drinks, sports and energy drinks (y/n)

iycf_6h

Input of a character value specifying the column name for tea, coffee, herbal drinks (y/n)

iycf_6h_swt

Input of a character value specifying the column name for tea coffee herbal drinks were sweetened (y/n)

iycf_6i

Input of a character value specifying the column name for clear broth / soup (y/n)

iycf_6j

Input of a character value specifying the column name for other liquids (y/n)

iycf_6j_swt

Input of a character value specifying the column name for other drinks were sweetened (y/n)

iycf_7a

Input of a character value specifying the column name for yoghurt (NOT yoghurt drinks) (y/n)

iycf_7a_num

Input of a character value specifying the column name for yoghurt (NOT yoghurt drinks) (number)

iycf_7b

Input of a character value specifying the column name for porridge, bread, rice, nooodles (y/n)

iycf_7c

Input of a character value specifying the column name for vitamin a rich vegetables (pumpkin, carrots, sweet red peppers, squash or yellow/orange sweet potatoes) (y/n)

iycf_7d

Input of a character value specifying the column name for white starches (plaintains, white potatoes, white yams, manioc, cassava) (y/n)

iycf_7e

Input of a character value specifying the column name for dark green leafy vegetables (y/n)

iycf_7f

Input of a character value specifying the column name for other vegetables (y/n)

iycf_7g

Input of a character value specifying the column name for vitamin a rich fruits (ripe mangoes, ripe papayas) (y/n)

iycf_7h

Input of a character value specifying the column name for other fruits (y/n)

iycf_7i

Input of a character value specifying the column name for organ meats (liver ,kidney, heart) (y/n)

iycf_7j

Input of a character value specifying the column name for processed meats (sausages, hot dogs, ham, bacon, salami, canned meat) (y/n)

iycf_7k

Input of a character value specifying the column name for any other meats (beef, chicken, pork, goat, chicken, duck) (y/n)

iycf_7l

Input of a character value specifying the column name for eggs (y/n)

iycf_7m

Input of a character value specifying the column name for fish (fresh or dried fish or shellfish) (y/n)

iycf_7n

Input of a character value specifying the column name for legumes (beans, peas, lentils, seeds, chickpeas) (y/n)

iycf_7o

Input of a character value specifying the column name for cheeses (hard or soft cheeses) (y/n)

iycf_7p

Input of a character value specifying the column name for sweets (chocolates, candies, pastries, cakes) (y.n)

iycf_7q

Input of a character value specifying the column name for fried or empty carbs (chips, crisps, french fries, fried dough, instant noodles) (y/n)

iycf_7r

Input of a character value specifying the column name for Any other solid, semi-solid, or soft foods

iycf_7s

Input of a character value specifying the column name for did child eat solid/semi-solid foods (y/n) for list based questionnaires

iycf_8

Input of a character value specifying the column name for times child ate solid/semi-solid foods (number)

monthly_expenditures

Inputs a character vector of column names for monthly expenditures over 30 days

period_expenditures

Inputs a character vector of column names for period expenditures of a period of time

num_period_months

Inputs a number for the number of months of the period expenditures for health expediture calculations

health_exp_col

Inputs a character value specifying the column name for health expenditures

food_exp_col

Inputs a character value specifying the column name for food expenditures

vaccine_card_yn

Inputs a character value specifying the column name for vaccine card yes no question

penta

Inputs a character value specifying the column name for pentavalent vaccine

penta_date1

Inputs a character value specifying the column name for date of penta dose 1

penta_date2

Inputs a character value specifying the column name for date of penta dose 2

penta_date3

Inputs a character value specifying the column name for date of penta dose 3

penta_count

Inputs a character value specifying the column name for number of penta doses reported

measles

Inputs a character value specifying the column name for measles vaccine

measles_date1

Inputs a character value specifying the column name for date of measles dose 1

measles_date2

Inputs a character value specifying the column name for date of measles dose 2

fcs_cereal

Input of a character value specifying the column name for number of days of cereals food consumption in the household

fcs_legumes

Input of a character value specifying the column name for number of days of legumes food consumption in the household

fcs_dairy

Input of a character value specifying the column name for number of days of dairy food consumption in the household

fcs_meat

Input of a character value specifying the column name for number of days of meats food consumption in the household

fcs_veg

Input of a character value specifying the column name for number of days of vegetables food consumption in the household

fcs_fruit

Input of a character value specifying the column name for number of days of fruits food consumption in the household

fcs_oil

Input of a character value specifying the column name for number of days of oils food consumption in the household

fcs_sugar

Input of a character value specifying the column name for number of days of sugars food consumption in the household

hdds_cereals

Input of a character value specifying the column name for yes/no if cereals consumed yesterday in the household

hdds_tubers

Input of a character value specifying the column name for yes/no if tubers consumed yesterday in the household

hdds_veg

Input of a character value specifying the column name for yes/no if vegetables consumed yesterday in the household

hdds_fruit

Input of a character value specifying the column name for yes/no if fruits consumed yesterday in the household

hdds_meat

Input of a character value specifying the column name for yes/no if meats consumed yesterday in the household

hdds_eggs

Input of a character value specifying the column name for yes/no if eggs consumed yesterday in the household

hdds_fish

Input of a character value specifying the column name for yes/no if fish consumed yesterday in the household

hdds_legumes

Input of a character value specifying the column name for yes/no if legumes consumed yesterday in the household

hdds_dairy

Input of a character value specifying the column name for yes/no if dairy consumed yesterday in the household

hdds_oils

Input of a character value specifying the column name for yes/no if oils consumed yesterday in the household

hdds_sugars

Input of a character value specifying the column name for yes/no if sugars consumed yesterday in the household

hdds_condiments

Input of a character value specifying the column name for yes/no if condiments consumed yesterday in the household

hhs_nofoodhh_1

Input of a character value specifying the column name for household hunger scale question 1

hhs_nofoodhh_1a

Input of a character value specifying the column name for household hunger scale question 2

hhs_sleephungry_2

Input of a character value specifying the column name for household hunger scale question 3

hhs_sleephungry_2a

Input of a character value specifying the column name for household hunger scale question 4

hhs_alldaynight_3

Input of a character value specifying the column name for household hunger scale question 5

hhs_alldaynight_3a

Input of a character value specifying the column name for household hunger scale question 6

rcsi_lesspreferred_1

Input of a character value specifying the column name for rcsi less preffered foods

rcsi_borrowfood_2

Input of a character value specifying the column name for rcsi borrow foods

rcsi_limitportion_3

Input of a character value specifying the column name for rcsi limit portion size

rcsi_restrict_4

Input of a character value specifying the column name for rcsi restrict consumption for adults

rcsi_reducemeals5

Input of a character value specifying the column name for rcsi reduce meals per day

lcs_variables

Inputs a character vector of column names specifying all the livelihood coping strategy columns.

livelihood_variables

Inputs a character vector of column names specifying all the livelihood activities for which income is received. These should be numerical columns with estimated income per livelihood activity. As per MSNA core indicator bank 2023.

Value

Returns a data frame with standardized variable names and values, additional columns for calculated indicators, and additional columns for data quality flags.

Examples

## Not run: format_nut_health_indicators(df = dfanthro, age_months = "age_in_months",
muac_var = "muac", ...)
## End(Not run)


SaeedR1987/healthyr documentation built on July 4, 2023, 11:17 p.m.