Skip to contents

Calculate the MEDI for the NHANES_MPED data (before 2005, 1999-2004) within 1 step for day 1, day 2, or day 1 and 2 combined (age >= 2 only)

Usage

MEDI_NHANES_MPED(
  MPED_PER_100_GRAM_PATH = NULL,
  WJFRT = NULL,
  NUTRIENT_PATH = NULL,
  NUTRIENT_IND_PATH = NULL,
  DEMO_PATH,
  NUTRIENT_PATH2 = NULL,
  NUTRIENT_IND_PATH2 = NULL,
  SWEETS_code = NULL,
  FAT_OIL_code = NULL,
  SSB_code = NULL,
  OLIVE_OIL_code = NULL
)

Arguments

MPED_PER_100_GRAM_PATH

The file path for the MPED per 100 gram data for the day 1 and day 2 data. The file name should be like: pyr_tot_d1.sas7bdat

WJFRT

The file path for the WJFRT data for the day 1 and day2 data. The file name should be like: wjfrt.sas7bdat

NUTRIENT_PATH

The file path for the NUTRIENT data for the day 1 data. The file name should be like: DR1TOT_J.XPT or DRXTOT_B.XPT

NUTRIENT_IND_PATH

The file path for the NUTRIENT_IND data for the day 1 data. The file name should be like: DR1IFF_J.XPT

DEMO_PATH

The file path for the DEMOGRAPHIC data. The file name should be like: DEMO_J.XPT

NUTRIENT_PATH2

The file path for the NUTRIENT2 data for the day 2 data. The file name should be like: DR2TOT_J.XPT

NUTRIENT_IND_PATH2

The file path for the NUTRIENT_IND2 data for the day 2 data The file name should be like: DR2IFF_J.XPT

SWEETS_code

The code for sweets in the FPED data. The default food codes are from the FPED data for NHANES 2017-2018

FAT_OIL_code

The code for fat and oil in the FPED data. The default food codes are from the FPED data for NHANES 2017-2018

SSB_code

The code for sugar-sweetened beverages in the FPED data. The default food codes are from the FPED data for NHANES 2017-2018

OLIVE_OIL_code

The code for olive oil in the FPED data. The default food codes are from the FPED data for NHANES 2017-2018

Value

The MEDI and its component scores and serving sizes

Examples

data("NHANES_20032004")
MEDI_NHANES_MPED(MPED_PER_100_GRAM_PATH = NHANES_20032004$MPED_PER_100_GRAM, WJFRT = NHANES_20032004$WJFRT, NUTRIENT_PATH = NHANES_20032004$NUTRIENT, NUTRIENT_IND_PATH = NHANES_20032004$NUTRIENT_IND, DEMO_PATH = NHANES_20032004$DEMO, NUTRIENT_PATH2 = NHANES_20032004$NUTRIENT2, NUTRIENT_IND_PATH2 = NHANES_20032004$NUTRIENT_IND2)
#> Since no SSB code is provided, the default SSB code from 17-18 FNDDS file is used.
#> Since no SWEETS code is provided, the default SSB code from 17-18 FNDDS file is used
#> Since no FAT_OIL code is provided, the default FAT_OIL code from 17-18 FNDDS file is used
#> Since no OLIVE_OIL code is provided, the default OLIVE_OIL code from 17-18 FNDDS file is used
#> # A tibble: 7,650 × 14
#>     SEQN MEDI_ALL MEDI_NOETOH MEDI_OLIVE_OIL MEDI_FRT MEDI_VEG MEDI_LEGUMES
#>    <dbl>    <dbl>       <dbl>          <dbl>    <dbl>    <dbl>        <dbl>
#>  1 21005      1.5         1.5              0        0        0          0  
#>  2 21006      3.5         3.5              0        0        0          0  
#>  3 21007      2           2                0        0        0          0  
#>  4 21008      2.5         2.5              0        0        0          0  
#>  5 21009      2.5         2.5              0        0        0          0  
#>  6 21010      4           3                0        0        0          0.5
#>  7 21012      2.5         1.5              0        0        0          0.5
#>  8 21013      1.5         1.5              0        0        0          0  
#>  9 21014      4           4                0        0        0          0.5
#> 10 21015      3           3                0        0        0          0  
#> # ℹ 7,640 more rows
#> # ℹ 7 more variables: MEDI_NUTS <dbl>, MEDI_FISH <dbl>, MEDI_ALCOHOL <dbl>,
#> #   MEDI_SSB <dbl>, MEDI_SWEETS <dbl>, MEDI_DISCRET_FAT <dbl>,
#> #   MEDI_REDPROC_MEAT <dbl>