Sign in
BioinformaticsAmerican Journal of Clinical Nutrition
Peer-reviewed journal article

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%

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.

Similarity Map
SelectedSame fieldCross-field
THISZhan '26Wang '23Wang '25Guo '18Hiraga '26VanDam '20
53% semantic matchBiochemistry
Jiada James Zhan, Chin-An Yang, Mary Nellis+8 more·bioRxiv·Jul 6, 2026