Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
[Preprint]. 2023 Aug 9:2023.08.07.548466.
doi: 10.1101/2023.08.07.548466.

Dietaryindex: A User-Friendly and Versatile R Package for Standardizing Dietary Pattern Analysis in Epidemiological and Clinical Studies

Affiliations

Dietaryindex: A User-Friendly and Versatile R Package for Standardizing Dietary Pattern Analysis in Epidemiological and Clinical Studies

Jiada James Zhan et al. bioRxiv. .

Abstract

Background: Few 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.

Objective: The primary aim is to develop and validate dietaryindex, a user-friendly and versatile R package that standardizes the calculation of dietary indexes.

Methods: Dietaryindex 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.

Results: Dietaryindex 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.

Conclusions: Dietaryindex 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).

Keywords: Dietary Inflammatory Index; Healthy Eating Index-2020; NHANES; R package; dietary index; dietary pattern.

PubMed Disclaimer

Figures

Figure 1.
Figure 1.
Comparison of Accuracy: dietaryindex-calculated vs. hand-calculated Dietary Index Values using the simulation datasets (sample sizes range from 10 to 26).
Figure 2.
Figure 2.
Accuracy of HEI2015 in NHANES: dietaryindex-calculated vs. SAS-calculated results from National Cancer Institute using the NHANES 2017–2018 data (n=7122).
Figure 3.
Figure 3.
Accuracy of HEI2015 in ASA24: dietaryindex-calculated vs. SAS-calculated results from National Cancer Institute using the ASA24 example data (n=21).
Figure 4.
Figure 4.
Accuracy of HEI2015 in DHQ3: dietaryindex-calculated vs. internal-calculated results from National Cancer Institute using the DHQ3 example data (n=23).
Figure 5.
Figure 5.
DASHI and MEDI dietary indexes in DASH and PREDIMED trials and NHANES in 2017–18
Figure 6.
Figure 6.
HEI2020 from 2005 to 2018 in toddlers and non-toddlers (children and adults) using NHANES data
Figure 7.
Figure 7.
Multiple Dietary indexes, using the NHANES data in 2017–2018

Similar articles

Cited by

References

    1. Hu FB, Manson JE, Stampfer MJ, et al. Diet, Lifestyle, and the Risk of Type 2 Diabetes Mellitus in Women. N Engl J Med. 2001;345(11):790–797. doi:10.1056/NEJMoa010492 - DOI - PubMed
    1. Arnett DK, Blumenthal RS, Albert MA, et al. 2019 ACC/AHA Guideline on the Primary Prevention of Cardiovascular Disease: A Report of the American College of Cardiology/American Heart Association Task Force on Clinical Practice Guidelines. Circulation. 2019;140(11):e596–e646. doi:10.1161/CIR.0000000000000678 - DOI - PMC - PubMed
    1. Kushi LH, Doyle C, McCullough M, et al. American Cancer Society guidelines on nutrition and physical activity for cancer prevention. CA Cancer J Clin. 2012;62(1):30–67. doi:10.3322/caac.20140 - DOI - PubMed
    1. Appel LJ, Moore TJ, Obarzanek E, et al. A Clinical Trial of the Effects of Dietary Patterns on Blood Pressure. N Engl J Med. 1997;336(16):1117–1124. doi:10.1056/NEJM199704173361601 - DOI - PubMed
    1. Determinants and Consequences of Obesity | AJPH | Vol. 106 Issue 9. Accessed June 13, 2023. 10.2105/AJPH.2016.303326 - DOI

Publication types