Skip to contents

This function computes nutrient adequacy using the Estimated Average Requirement (EAR) cutoff method for individuals based on their age and specified life-stage group. It references Dietary Reference Intake (DRI) EAR values from the Institute of Medicine (IOM) and applies the cut-point approach to determine whether each individual meets or fails the EAR for each nutrient.

Usage

compute_ear_adequacy(
  data,
  age_col,
  life_group,
  nutrients,
  include_ear_values = FALSE
)

Arguments

data

A data frame containing age and nutrient intake data.

age_col

Character string. Column name for age (in years or months depending on life group).

life_group

Character string indicating the life-stage group. Must be one of "Female", "Male", "Child", "Pregnant", or "Lactating".

nutrients

A named character vector where names are nutrient names (e.g. "Protein") and values are corresponding column names in the dataset.

include_ear_values

Logical. If TRUE, includes EAR value columns in the output. Defaults to FALSE.

Value

A tibble containing the original data plus adequacy columns. If include_ear_values = TRUE, EAR columns are also included.

Details

For each individual, the function:

  1. Looks up the EAR based on the provided age and life-stage group.

  2. Compares the individual’s intake to that EAR.

  3. Returns adequacy = 1 if intake >= EAR, otherwise 0.

The function currently supports these nutrients: Calcium, CHO, Protein, Vitamin A, Vitamin C, Vitamin D, Vitamin E, Thiamin, Riboflavin, Niacin, Vitamin B6, Folate, Vitamin B12, Copper, Iodine, Iron, Magnesium, Molybdenum, Phosphorus, Selenium, Zinc.

Each nutrient produces two additional columns: one for EAR values and one for adequacy indicators (1/0), each prefixed with the life group for clarity. (e.g. Female_Protein_g_ear, Female_Protein_g_adequacy)

Note

Ensure that the age column is expressed in years for adults and months for children, as EAR reference values are age-unit specific.

References

Institute of Medicine (US). Dietary Reference Intakes Tables, Appendix J. 2006. https://www.ncbi.nlm.nih.gov/books/NBK545442/

Examples

df <- tibble::tibble(
  age = c(10, 25, 35, 45),
  Protein_g = c(1.2, 0.7, 0.6, 0.8),
  Calcium_mg = c(900, 850, 700, 950)
)
nutrients <- c("Protein" = "Protein_g", "Calcium" = "Calcium_mg")
compute_ear_adequacy(df, age_col = "age", life_group = "Female", nutrients = nutrients)
#> # A tibble: 4 × 5
#>     age Protein_g Calcium_mg Female_Protein_g_adequacy Female_Calcium_mg_adequ…¹
#>   <dbl>     <dbl>      <dbl>                     <dbl>                     <dbl>
#> 1    10       1.2        900                         1                         0
#> 2    25       0.7        850                         1                         1
#> 3    35       0.6        700                         0                         0
#> 4    45       0.8        950                         1                         1
#> # ℹ abbreviated name: ¹​Female_Calcium_mg_adequacy