DII
DII.Rd
Calculate the DII dietary index, Dietary Inflammation Index, using given the serving sizes of foods and nutrients consumed per 1 day. Not all parameters are needed. You can give as many parameters as you have, and the results will only include scores for the parameters you included.
Usage
DII(
SERV_DATA,
RESPONDENTID,
REPEATNUM = 1,
ALCOHOL_DII = NULL,
VITB12_DII = NULL,
VITB6_DII = NULL,
BCAROTENE_DII = NULL,
CAFFEINE_DII = NULL,
CARB_DII = NULL,
CHOLES_DII = NULL,
KCAL_DII = NULL,
EUGENOL_DII = NULL,
TOTALFAT_DII = NULL,
FIBER_DII = NULL,
FOLICACID_DII = NULL,
GARLIC_DII = NULL,
GINGER_DII = NULL,
IRON_DII = NULL,
MG_DII = NULL,
MUFA_DII = NULL,
NIACIN_DII = NULL,
N3FAT_DII = NULL,
N6FAT_DII = NULL,
ONION_DII = NULL,
PROTEIN_DII = NULL,
PUFA_DII = NULL,
RIBOFLAVIN_DII = NULL,
SAFFRON_DII = NULL,
SATFAT_DII = NULL,
SE_DII = NULL,
THIAMIN_DII = NULL,
TRANSFAT_DII = NULL,
TURMERIC_DII = NULL,
VITA_DII = NULL,
VITC_DII = NULL,
VITD_DII = NULL,
VITE_DII = NULL,
ZN_DII = NULL,
TEA_DII = NULL,
FLA3OL_DII = NULL,
FLAVONES_DII = NULL,
FLAVONOLS_DII = NULL,
FLAVONONES_DII = NULL,
ANTHOC_DII = NULL,
ISOFLAVONES_DII = NULL,
PEPPER_DII = NULL,
THYME_DII = NULL,
ROSEMARY_DII = NULL
)
Arguments
- SERV_DATA
The raw data file that includes all the serving sizes of foods and nutrients
- RESPONDENTID
The unique participant ID for each participant
- REPEATNUM
The number of repeated record with each participant, 1st collection=1, 2nd collection =2, etc. If no repeat number is given, the default is 1
- ALCOHOL_DII
Unit=g
- VITB12_DII
Unit=μg
- VITB6_DII
Unit=mg
- BCAROTENE_DII
Unit=μg
- CAFFEINE_DII
Unit=g
- CARB_DII
Unit=g
- CHOLES_DII
Unit=mg
- KCAL_DII
Unit=KCAL_DII
- EUGENOL_DII
Unit=mg
- TOTALFAT_DII
Unit=g
- FIBER_DII
Unit=g
- FOLICACID_DII
Unit=μg
- GARLIC_DII
Unit=g
- GINGER_DII
Unit=g
- IRON_DII
Unit=mg
- MG_DII
Unit=mg
- MUFA_DII
Unit=g
- NIACIN_DII
Unit=mg
- N3FAT_DII
Unit=g
- N6FAT_DII
Unit=g
- ONION_DII
Unit=g
- PROTEIN_DII
Unit=g
- PUFA_DII
Unit=g
- RIBOFLAVIN_DII
Unit=mg
- SAFFRON_DII
Unit=g
- SATFAT_DII
Unit=g
- SE_DII
Unit=μg
- THIAMIN_DII
Unit=mg
- TRANSFAT_DII
Unit=g
- TURMERIC_DII
Unit=mg
- VITA_DII
Unit=RE
- VITC_DII
Unit=mg
- VITD_DII
Unit=μg
- VITE_DII
Unit=mg
- ZN_DII
Unit=mg
- TEA_DII
Unit=g
- FLA3OL_DII
Unit=mg
- FLAVONES_DII
Unit=mg
- FLAVONOLS_DII
Unit=mg
- FLAVONONES_DII
Unit=mg
- ANTHOC_DII
Unit=mg
- ISOFLAVONES_DII
Unit=mg
- PEPPER_DII
Unit=g
- THYME_DII
Unit=mg
- ROSEMARY_DII
Unit=mg
Examples
data("DHQ3_exp")
DII(DHQ3_exp, DHQ3_exp$`Respondent ID`, 1, DHQ3_exp$`Alcohol (g)`, DHQ3_exp$`Vitamin B12 (mcg)`, DHQ3_exp$`Vitamin B6 (mg)`)
#> It is normal to see warnings if you do not provide all arguments using DII. The algorithm will only count the arguments you enter to calculate the DII. All warnings are about the first column you don't use. For example, if you only entered alcohol, vitamin b12, and vitamin b6, all warnings would remind you that bcarotene is not found.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> Warning: Unknown or uninitialised column: `BCAROTENE_DII`.
#> # A tibble: 23 × 49
#> # Groups: RESPONDENTID [23]
#> RESPONDENTID DII_ALL DII_NOETOH REPEATNUM ALCOHOL_DII VITB12_DII VITB6_DII
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 0.0479 -0.230 1 0.278 -0.0232 -0.207
#> 2 2 0.208 -0.0697 1 0.278 -0.0855 0.0157
#> 3 3 -0.115 -0.384 1 0.270 -0.0361 -0.348
#> 4 4 0.0194 -0.258 1 0.278 -0.0486 -0.210
#> 5 5 0.277 0.0425 1 0.234 -0.0760 0.119
#> 6 6 0.448 0.170 1 0.278 -0.0949 0.265
#> 7 7 0.348 0.0699 1 0.278 -0.0869 0.157
#> 8 8 -0.0124 -0.286 1 0.274 -0.0574 -0.229
#> 9 9 0.101 -0.0525 1 0.153 -0.0682 0.0157
#> 10 10 0.170 -0.108 1 0.277 -0.0297 -0.0778
#> # ℹ 13 more rows
#> # ℹ 42 more variables: BCAROTENE_DII <dbl>, CAFFEINE_DII <int>, CARB_DII <int>,
#> # CHOLES_DII <int>, KCAL_DII <int>, EUGENOL_DII <int>, TOTALFAT_DII <int>,
#> # FIBER_DII <int>, FOLICACID_DII <int>, GARLIC_DII <int>, GINGER_DII <int>,
#> # IRON_DII <int>, MG_DII <int>, MUFA_DII <int>, NIACIN_DII <int>,
#> # N3FAT_DII <int>, N6FAT_DII <int>, ONION_DII <int>, PROTEIN_DII <int>,
#> # PUFA_DII <int>, RIBOFLAVIN_DII <int>, SAFFRON_DII <int>, …