Dietaryindex: A User-Friendly and Versatile R Package for Standardizing Dietary Pattern Analysis in Epidemiological and Clinical Studies
Jiada James ZhaniD, Rebecca A. HodgeiD, Anne Lang DunlopiD, Matthew M. LeeiD, Linh BuiiD, Donghai LiangiD, Erin Poe FerrantiiD
Abstract
BackgroundFew standardized and open-source tools exist for calculating dietary pattern indexes from dietary intake data in epidemiological and clinical studies. Miscalculations of dietary indexes, with suspected erroneous findings, are occasionally noted in the literature. ObjectiveThe primary aim is to develop and validate dietaryindex, a user-friendly and versatile R package that standardizes the calculation of dietary indexes. MethodsDietaryindex utilizes a two-step process: an initial calculation of serving size for each food and nutrient category, followed by the calculation of individual dietary indexes. It includes generic functions that accept any preprocessed serving sizes of food groups and nutrients, with the standard serving sizes defined according to the methodologies used in well-known prospective cohort studies. For ease of use, dietaryindex also offers one-step functions that directly reference common datasets and tools, including the National Health and Nutrition Examination Survey (NHANES) and Block Food Frequency Questionnaire, eliminating the need for data preprocessing. At least two independent researchers validated the serving size definitions and scoring algorithms of dietaryindex. ResultsDietaryindex can calculate multiple dietary indexes of high interest in research, including Healthy Eating Index (HEI) - 2020, Alternative Healthy Eating Index 2010, Dietary Approaches to Stop Hypertension Index, Alternate Mediterranean Diet Score, Dietary Inflammatory Index, American Cancer Society 2020 dietary index, and Planetary Health Diet Index from the EAT-Lancet Commission. In our validation process, dietaryindex demonstrated full accuracy (100%) in all generic functions with two-decimal rounding precision in comparison to hand-calculated results. Similarly, using NHANES 2017-2018 data and ASA24 and DHQ3 example data, the HEI2015 outputs from dietaryindex aligned (99.95% - 100%) with results using the SAS codes from the National Cancer Institute. ConclusionsDietaryindex is a user-friendly, versatile, and validated informatics tool for standardized dietary index calculations. We have open-sourced all the validation files and codes with detailed tutorials on GitHub (https://github.com/jamesjiadazhan/dietaryindex).
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 155
- FWCI
- 63.93
- Field percentile
- top 1%
- Research Focus
- Approach
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Development of a metabolomics-based index to monitor dietary effects on chronic inflammation: The Dietary Metabolomics Inflammation Index
Jiada James Zhan, Chin-An Yang, … Dean P. Jones·bioRxiv·Jul 6, 2026
- Nutritional redundancy in the human diet and its application in phenotype association studies
Xu‐Wen Wang, Yang Hu, … Yang‐Yu Liu·Nature CommunicationsPeer-reviewed·Jul 18, 2023
- Optimization-based dietary recommendations for healthy eating
Xu‐Wen Wang, Scott T. Weiss, … Yang‐Yu Liu·European Journal of Clinical NutritionPeer-reviewed·Aug 13, 2025
- Objective versus Self-Reported Energy Intake Changes During Low-Carbohydrate and Low-Fat Diets
J. Guo, J. L. Robinson, … K. D. Hall·bioRxiv·Sep 20, 2018
- Multimodal phenotyping reveals plant-food-related dietary information in serum Raman spectra of community-dwelling Japanese adults
Kenichi Hiraga, Takafumi Miyamoto, … Motohiro Sekiya·bioRxiv·Oct 15, 2026
- Improving Heart disease risk through quality-focused diet logging: pre-post study of a diet quality tracking app
Courtland VanDam, Bum Chul Kwon, … Jina Huh·JMIR mhealth and uhealthPeer-reviewed·Dec 23, 2020