Code Monkey home page Code Monkey logo

love520lfh / dietaryindex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yikeshu0611/dietaryindex

1.0 0.0 0.0 207.88 MB

R Package for Calculating Healthy Eating Index-2020 (HEI2020), Alternative Healthy Eating Index (AHEI), Dietary Approaches to Stop Hypertension (DASH), Mediterranean Diet (MED), Dietary Inflammation Index (DII), and Planetary Health Diet Index from the EAT-Lancet Commission (PHDI) for the NHANES, ASA24, DHQ, and other dietary assessments

Home Page: https://jamesjiadazhan.github.io/dietaryindex_manual/

License: MIT License

R 94.78% SAS 5.21% HTML 0.01%

dietaryindex's Introduction

dietaryindex


Overview


dietaryindex is an R package that provides user-friendly, streamlined methods for standardizing the compilation of dietary intake data into index-based dietary patterns to enable the assessment of adherence to these patterns in epidemiologic and clinical studies, promoting precision nutrition.

If you are using the Dietaryindex package in your research, please be sure to cite our original work. By doing so, you not only add credibility to your findings but also recognize and appreciate our intellectual efforts and contributions. The appropriate citation is as follows:

  • Jiada James Zhan, Rebecca A Hodge, Anne Dunlop, et al. Dietaryindex: A User-Friendly and Versatile R Package for Standardizing Dietary Pattern Analysis in Epidemiological and Clinical Studies. bioRxiv. Published online August 07, 2023:2023.08.07.548466. doi:10.1101/2023.08.07.548466
  • https://www.biorxiv.org/content/10.1101/2023.08.07.548466v2

As of version 1.0.3, the package supports the latest version of the Healthy Eating Index (HEI2020 and HEI-Toddlers 2020) for National Health and Nutrition Examination Survey (NHANES) data and ASA24. Now ASA24 can generate flexible outputs, depending on if RECALL_SUMMARIZE is TRUE or FALSE. If RECALL_SUMMARIZE is TRUE, all dietary recall results will be summarized via average. If not, all individual recall results will be shown. Also, all NHANES functions allow users to enter the first day data, or the second day data, or first day + second day data and return the results accordingly.

The dietaryindex package performs calculations in two steps:

  1. Computation of the serving size of each food and nutrient category.
  2. Computation of the individual dietary index using the serving size information.

This package can calculate the following dietary pattern indexes:

  • Healthy Eating Index 2020 (HEI2020 & HEI-Toddlers-2020)
  • Healthy Eating Index 2015 (HEI2015)
  • Alternative Healthy Eating Index (AHEI)
  • Dietary Approaches to Stop Hypertension Index (DASH)
  • DASH Index in serving sizes from the DASH trial (DASHI)
  • Alternate Mediterranean Diet Score (aMED)
  • MED Index in serving sizes from the PREDIMED trial (MEDI)
  • Dietary Inflammation Index (DII)
  • American Cancer Society 2020 diet score (ACS2020_V1 and ACS2020_V2)
  • Planetary Health Diet Index from the EAT-Lancet Commission (PHDI)

Installation


Currently, dietaryindex is not available on [CRAN]

To install from this GitHub repository, use the devtools package:

install.packages("devtools") #If you don't have "devtools" installed already
devtools::install_github("jamesjiadazhan/dietaryindex") # Install the package from GitHub

If the previous steps are not working, you can try the following steps:

library(devtools) # Load devtools
install_github("jamesjiadazhan/dietaryindex")

If something happens like the following, first try to enter 1 in the terminal (lower box). If not successful, then try to enter 2. It will take a while if you are a new R user.

  These packages have more recent versions available.
  It is recommended to update all of them.
  Which would you like to update?

  1: All                          
  2: CRAN packages only           
  3: None                         
  4: tzdb  (0.3.0 -> 0.4.0) [CRAN]
  5: vroom (1.6.1 -> 1.6.3) [CRAN]

Getting Started


To start using dietaryindex, load the dependency packages first and then load the dietaryindex package after installation:

library(dplyr)
library(haven)
library(readr)
# Loading dependency packages first can help avoid the namespace conflict if you want to use dplyr by yourself later in addition to the internal use of dplyr within the diataryindex package
library(dietaryindex)

For a detailed explanation of all dietary indexes available, please check the attached Excel files:

dietaryindex has been thoroughly validated for accuracy and reliability. We've ensured that all functions within dietaryindex perform as expected. Validation files and R codes can be found here:

Package dependencies: dplyr, readr, haven (automatically installed).

Manual:


Detailed function descriptions, examples, and NHANES data access instructions are provided here

Demonstrations

We included complex survey design when analzying NHANES data so all results are weighted accordingly to represent US population.


Case study 1. A comparative analysis of results derived from clinical trials (i.e., The Dietary Approaches to Stop Hypertension (DASH) trial and Prevención con Dieta Mediterránea (PREDIMED) trial) juxtaposed with findings from an epidemiological study (i.e., NHANES) from 2017-2018, utilizing DASHI and MEDI dietary indexes. Figure 5  DASHI and MEDI dietary indexes comparison

Case study 2. A time series of cross-sectional computation of the HEI2020 in the NHANES dataset spanning 2005 to 2018, stratifying into toddler and non-toddler populations. Figure 6  HEI2020 from 2005 to 2018

Case study 3. A comprehensive calculation of multiple dietary indexes—HEI2020, AHEI, DASHI, MEDI, DII—within a single year (2017-2018), leveraging data from the NHANES study. Figure 7  Multiple Dietary indexes, using the NHANES 17-18

All the R codes for the demonstrations can be found here:

NHANES data and functions

dietaryindex has compiled NHANES data from 1999 - 2020 for your convenience. This includes NHANES 1999-2000, 2001-2002, 2003-2004, 2005-2006, 2007-2008, 2009-2010, 2011-2012, 2013-2014, 2015-2016, 2017-2018, 2017-2020. To retrieve the data:

Then, use the following codes to load the data:

# set up working dictionary
setwd("/Users/james/Desktop/NHANES_combined")

# Load the NHANES data from 1999 to 2020
## NHANES 1999-2000
load("NHANES_19992000.rda")

## NHANES 2001-2002
load("NHANES_20012002.rda")

## NHANES 2003-2004
load("NHANES_20032004.rda")

## NHANES 2005-2006
load("NHANES_20052006.rda")

## NHANES 2007-2008
load("NHANES_20072008.rda")

## NHANES 2009-2010
load("NHANES_20092010.rda")

## NHANES 2011-2012
load("NHANES_20112012.rda")

## NHANES 2013-2014
load("NHANES_20132014.rda")

## NHANES 2015-2016
load("NHANES_20152016.rda")

## NHANES 2017-2018 from dietaryindex package
data("NHANES_20172018")

## NHANES 2017-2020
load("NHANES_20172020.rda")

For NHANES data:

Related Work


dietaryindex is mainly intended as a versatile tool to help for calculating different dietary indexes conveniently. It is designed to be flexible to work for almost all types of dietary assessment tools, including food frequency questionnaires, 24-hour dietary recalls, and even food records, while it also supports many 1-step dietary index calculations for NHANES, ASA24, and DHQ3. Please follow the instruction of your specific dietary assessment tools and relevant articles regarding how to accurately define the serving size (see above) if it is not provided in our package, as they are the key to obtaining high-quality dietary indexes. dietaryindex also provides some help in defining the serving size in the help file, argument section. Note: some very specific dietary index components (low-fat dairy products and sugar-sweetened beverages) are not easily available and thus are difficult to assess. The author used individual-level food data to compute the population-level food group data. For example, the sugar-sweetened beverage serving is estimated by dividing the total added sugar intake in grams from beverages by 26, because 1 bottle (8 oz) of Coke has 26 g added sugars and this is used as the benchmark, as different sugar-sweetened beverages have largely different added sugar contents. Please use your own judgment to determine if the dietary indexes calculated using the dietaryindex package is appropriate for your research.

Contributing & Notes

dietaryindex is licensed under the MIT License. Please check out the Contribution guide for questions, feature requests, and bug reports. The maintainer will review pull requests and incorporate contributions at his discretion. You may also reach out to the maintainer, Jiada (James) Zhan, via his email: [email protected]. Jiada (James) Zhan home page at Emory is: https://www.sph.emory.edu/phd-students/profile/index.php?FID=jiada-zhan-12906. Becky Hodge at the American Cancer Society provided substantial contributions to validate this package. Michael L Orr at Dean Jones/ Young-Mi Go Lab at Emory University helped design the dietaryindex logo. Thanks a lot for their help.

dietaryindex's People

Contributors

jamesjiadazhan avatar

Stargazers

liam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.