Quantitative Analysis - Nutritional Benchmarking
Quantitative Analysis - Nutritional Benchmarking
This directory contains quantitative analysis scripts that compare ideal menus co-designed in participatory workshops with Colombian nutritional references.
� Quick Start
Option 1: Interactive Quarto Report (Recommended)
View the complete analysis in an interactive HTML report:
quarto render analysis.qmd
open analysis.html
The analysis.qmd document integrates all scripts with narrative explanations, visualizations, and key findings in a reproducible format.
Option 2: Run Scripts Individually
Follow the sequential workflow described below to run each script separately.
�📊 Analysis Flow
The analysis follows a sequential 4-step flow:
graph TD
A[Bases de datos.xlsx] --> B[01_GenDataSet.R]
B --> C[DS_Talleres_RIEN.rds]
B --> D[DS_Talleres_GABAS.rds]
C --> E[02_Gen_Graph_RIEN.R]
D --> F[03_Gen_Graph_GABAS.R]
C --> G[04_Gen_Graph_Nutrients.R]
E --> H[RIEN Graphs]
F --> I[GABAS Graphs]
G --> J[Nutritional Heatmap]
📁 Main Scripts
0. Required Libraries (# Required libraries.r)
Install and load necessary libraries:
# Main libraries
library(tidyverse) # Data manipulation and graphics
library(hrbrthemes) # ggplot themes
library(readxl) # Excel file reading
library(reshape2) # Data reshaping
Run first: This script ensures all dependencies are available.
1. Dataset Generation (01_GenDataSet.R)
Purpose: Processes raw workshop data and generates structured datasets comparable with Colombian nutritional references.
Input:
Bases de datos.xlsx- Raw workshop data (“Gramaje” sheet)- GABAS equivalence table (“equiv_table_GABAS” sheet)
- RIEN references (“RIEN” sheet)
- GABAS references (“GABAS_Referencias” sheet)
Process:
- Reads food weight data selected in workshops
- Assigns each food to a GABAS group (Food-Based Dietary Guidelines)
- Calculates total servings by region and age group
- Compares with GABAS references (recommended servings)
- Calculates nutritional adequacy vs RIEN (Recommended Intake of Energy and Nutrients)
Output:
DS_Talleres_GABAS.rds/.xlsx- Dataset with servings by food groupDS_Talleres_RIEN.rds/.xlsx- Dataset with nutritional adequacy
Run:
source("01_GenDataSet.R")
2. RIEN Visualization (02_Gen_Graph_RIEN.R)
Purpose: Generates nutritional adequacy graphs comparing co-designed menus with RIEN requirements.
Input:
DS_Talleres_RIEN.rds
Generated graphs:
reg_Calorias.png- Energy adequacy by region and age groupreg_Proteina.png- Protein adequacyreg_CHO.png- Carbohydrate adequacyreg_Grasas.png- Fat adequacyreg_Fibra.png- Fiber adequacyreg_Calcio.png- Calcium adequacyreg_Hierro.png- Iron adequacyreg_Sodio.png- Sodium adequacyALL_Macronutrientes.png- Macronutrient comparison (all groups)ALL_Micronutrientes.png- Micronutrient comparison (all groups)
Interpretation:
- Green point: Lower recommendation limit (EAR - Estimated Average Requirement)
- Red point: Upper recommendation limit (RDA - Recommended Dietary Allowance)
- Black diamond: Average value of co-designed menus
- Gray line: Adequacy range
Run:
source("02_Gen_Graph_RIEN.R")
3. GABAS Visualization (03_Gen_Graph_GABAS.R)
Purpose: Generates graphs of servings by food group comparing with Colombian Food-Based Dietary Guidelines (GABAS).
Input:
DS_Talleres_GABAS.rds
GABAS food groups:
- Fruits
- Vegetables
- Cereals and tubers
- Legumes
- Animal-source proteins
- Dairy
- Fats and sugars
Generated graphs:
reg_GABAS.png- Servings by food group by regionALL_GABAS.png- Aggregated comparison of all groups
Interpretation:
- Compares daily selected servings vs GABAS recommendations
- Identifies under-represented or over-represented food groups
Run:
source("03_Gen_Graph_GABAS.R")
4. Nutritional Heatmap (04_Gen_Graph_Nutrients.R)
Purpose: Generates a nutritional adequacy heatmap by age group, visualizing the complete nutritional profile in an integrated way.
Input:
DS_Talleres_RIEN.rds
Generated graph:
panel_b_heatmap.pdf- Heatmap of % RIEN adequacy by nutrient and age group
Color interpretation:
- 🔴 Dark red: < 70% or > 130% (inadequacy)
- 🟡 Yellow: 70-90% or 110-130% (suboptimal)
- 🟢 Green: 90-110% (adequate)
Nutrients analyzed:
- Carbohydrates
- Proteins
- Fats
- Fiber
- Calcium
- Iron
- Sodium
Run:
source("04_Gen_Graph_Nutrients.R")
🔄 Run Complete Analysis
To reproduce the entire analysis from scratch:
# 1. Install required libraries
source("# Required libraries.r")
# 2. Generate datasets
source("01_GenDataSet.R")
# 3. Generate RIEN visualizations
source("02_Gen_Graph_RIEN.R")
# 4. Generate GABAS visualizations
source("03_Gen_Graph_GABAS.R")
# 5. Generate nutritional heatmap
source("04_Gen_Graph_Nutrients.R")
Estimated time: ~2-3 minutes
📂 Data Files
Inputs
| File | Description |
|---|---|
Bases de datos.xlsx |
Primary workshop data with foods, servings, and nutritional composition |
Tabla de gramajes.xlsx |
Reference table for serving size estimation |
Outputs
| File | Type | Description |
|---|---|---|
DS_Talleres_GABAS.rds |
RDS | Processed dataset with GABAS servings |
DS_Talleres_GABAS.xlsx |
Excel | Excel version of GABAS dataset |
DS_Talleres_RIEN.rds |
RDS | Processed dataset with RIEN adequacy |
DS_Talleres_RIEN.xlsx |
Excel | Excel version of RIEN dataset |
📈 Available Graphs
All graphs are saved in the graphs/ folder:
By Region and Age Group
reg_Calorias.pngreg_Proteina.pngreg_CHO.pngreg_Grasas.pngreg_Fibra.pngreg_Calcio.pngreg_Hierro.pngreg_Sodio.pngreg_GABAS.png
Aggregated
ALL_Macronutrientes.pngALL_Micronutrientes.pngALL_GABAS.pngALL_Otros.pngpanel_b_heatmap.pdf(used in the article)
🔍 Nutritional References
RIEN (Recommended Intake of Energy and Nutrients)
Source: Colombian Institute of Family Welfare (ICBF), 2015
- Energy: Healthy adult 70kg, light-moderate activity
- Proteins: 0.8-1.0 g/kg/day (EAR-RDA)
- Carbohydrates: 130-175 g/day (EAR-RDA)
- Fats: 20-35% of total energy (AI)
- Fiber: 25-38 g/day (men-women average)
- Calcium: 800-1000 mg/day (EAR-RDA)
- Iron: 6-8 mg/day (EAR-RDA)
- Sodium: 1500 mg/day (AI - Adequate Intake)
GABAS (Food-Based Dietary Guidelines)
Source: Colombian Ministry of Health and Social Protection, 2015
Daily serving recommendations by food group for Colombian adult population.
🛠️ System Requirements
- R: version 4.0 or higher
- RStudio: recommended for interactive execution
- R libraries: see
# Required libraries.r
📝 Methodological Notes
- Servings: Estimated using visual food models adapted from Nelson et al. (1997)
- Nutritional composition: Colombian Food Composition Table (ICBF)
- Aggregation: Averages by age group and region when multiple workshops
- Benchmarking: Co-designed menus represent perceived ideals, not habitual intake
⚠️ Limitations
- Data represent co-designed ideal menus, not actually consumed diets
- Servings are estimates based on visual models
- Nutritional composition may vary according to local preparation
- Small sample size per subgroup (exploratory analysis)
📧 Contact
For technical questions about the analyses, contact:
- Quantitative analysis: Harold Cardona-Trujillo (hcardonat@eafit.edu.co) / Juan Carlos Muñoz-Mora (jmunozm1@eafit.edu.co)
- Repository: https://github.com/jcmunozmora/food-perception-rural-colombia
Last updated: February 2026