Skip to contents

Calculate the MED for the NHANES_FPED data (after 2005) within 1 step

Usage

MED_NHANES_FPED(
  FPED_PATH = NULL,
  NUTRIENT_PATH = NULL,
  DEMO_PATH,
  FPED_PATH2 = NULL,
  NUTRIENT_PATH2 = NULL
)

Arguments

FPED_PATH

The file path for the FPED data. The file name should be like: fpre_dr1tot_1718.sas7bdat

NUTRIENT_PATH

The file path for the NUTRIENT data. The file name should be like: DR1TOT_J.XPT

DEMO_PATH

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

FPED_PATH2

The file path for the FPED data. The file name should be like: fpre_dr2tot_1718.sas7bdat

NUTRIENT_PATH2

The file path for the NUTRIENT data. The file name should be like: DR2TOT_J.XPT

Value

The MED and its component scores

Examples

data("NHANES_20172018")
MED_NHANES_FPED(FPED_PATH = NHANES_20172018$FPED, NUTRIENT_PATH = NHANES_20172018$NUTRIENT, DEMO_PATH = NHANES_20172018$DEMO, FPED_PATH2 = NHANES_20172018$FPED2, NUTRIENT_PATH2 = NHANES_20172018$NUTRIENT2)
#> [1] "Reminder: this MED index uses medians to rank participants' food/drink serving sizes and then calculate MED component scores, which may generate results that are specific to your study population but not comparable to other populations."
#> # A tibble: 6,174 × 12
#>     SEQN MED_ALL MED_NOETOH MED_FRT MED_VEG MED_WGRAIN MED_LEGUMES MED_NUTS
#>    <dbl>   <dbl>      <dbl>   <dbl>   <dbl>      <dbl>       <dbl>    <dbl>
#>  1 93704     6.5        6.5     1       0          1             1        1
#>  2 93705     5.5        5.5     0       0.5        0.5           1        1
#>  3 93707     5          5       0       0.5        1             1        1
#>  4 93708     6          6       0.5     0.5        0.5           1        1
#>  5 93711     7          7       1       1          0.5           1        1
#>  6 93712     6          6       0.5     1          1             1        1
#>  7 93713     6.5        6.5     1       1          1             1        1
#>  8 93714     4          4       0       0          0.5           1        1
#>  9 93715     4          4       0       0          0.5           1        1
#> 10 93716     7.5        7.5     1       1          1             1        1
#> # ℹ 6,164 more rows
#> # ℹ 4 more variables: MED_FISH <dbl>, MED_REDPROC_MEAT <dbl>,
#> #   MED_MONSATFAT <dbl>, MED_ALCOHOL <dbl>