Didier Brassard
- Introduction
- 1. Requirements and file structure
- 2. Description of analyses and codes
- Reference
- Session Info
This repository presents the analysis code for the study Relationship between adherence to the 2019 Canada’s Food Guide recommendations on healthy food choices and nutrient intakes in older adults published in the Journal of Nutrition (Brassard & Chevalier, 2023).
The general objective was to assess the relationship between adherence to CFG recommendations on healthy food choices, measured using the HEFI-2019 (Brassard et al, 2022a; 2022b), and intake of key nutrients in adults 65 years and older from the Canadian Community Health Survey (CCHS) 2015 - Nutrition.
- McGill Press Release
- Journal of Nutrition: official article
- medRxiv: Pre-print version of the study
- GitHub: Main article code, text, figures and tables
- GitHub: Supplemental material code, text, figures and tables
- OSF: Raw and processed data used for this study
All data used for this project are available on OSF in a
repository. To run analyses, all data from the
OSF repository should first be downloaded and placed in the same folder
as the project’s codes. More precisely, data in the /data/
and in the
/NCI/
folder from OSF should be put in the same folder as the codes
1.0-Data_preparation.sas
, 2.1-NCI_multi_pro_mcmc.sas
, etc.
The main analyses were executed in SAS studio (v3.81). The manuscript and supplemental file were successfully executed using Quarto and R (version 4.2.2) on macOS Big Sur 10.16 (64-bit; see complete session information details below). Analyses were conducted partly in SAS since the National Cancer Institute (NCI) method is only available in SAS codes at the moment.
A copy of all raw data used in this study can also be obtained elsewhere:
- Free sugars estimate of foods (Rana et al. 2021);
- HEFI-2019 categories and grams equivalent to one reference amount (Health Canada, 2023)
- Canadian Community Health Survey 2015 - Nutrition (Statistics Canada, 2018)
SAS macros made by the NCI were used to perform measurement error
correction (Zhang et al., 2011). The macros are available on the NCI
website,
but are included in the present repository in the /Macros/
folder.
boxcox_survey.macro.v1.2.sas
std_cov_boxcox24hr_conday_minamt_macro_v2.0.sas
multivar_mcmc_macro_v2.1.sas
multivar_distrib_macro_v2.1.sas
percentiles_survey.macro.v1.1.sas
Please note that small modifications were made vs. the original macros
for efficiency purpose, i.e., a relative path is used in
multivar_mcmc_macro_v2.1.sas
to save trace plots and the default
cut-point probability was modified in
percentiles_survey.macro.v1.1.sas
to
The HEFI-2019 scoring algorithm SAS macro hefi2019.scoring.macro.sas
was used (available in a GitHub
repository) and is included
in the /Macros/
folder.
The boot_auxiliary.sas
file includes a suite of macros used to observe
and analyze bootstrap data. These macros are used in
7.0-Bootstrap_variance.sas to calculate bootstrap variance.
Details are provided within the R script for the two functions made for
this project: statDistrib.R
and post_mcmc_auxiliary.R
.
statDistrib.R
performs the same operations as
percentiles_survey.macro.v1.1.sas
except cut-point probabilities.
post_mcmc_auxiliary.R
load data generated by the
multivar_distrib_macro_v2.1.sas
macros (MCMC output) and calculates
energy-adjusted correlations for HEFI-2019 dietary constituents.
Key steps of the main analysis are performed in separate .sas
files.
Each file would need to be executed in sequential order for successful
execution, as indicated by the numerical prefix.
The flowchart below illustrates the relationship between codes, data and folders in more details.
%%{init: {'theme': 'neutral' } }%%
flowchart TB
data1[(Data/Raw)]
data2[(Data/Processed)]
data3[(NCI/)]
code1[1-Data_preparation.sas]
code2[2, 3, ... 6-NCI_multi_*.sas]
code3[7.0-Bootstrap_variance.sas]
qmd1(<b>9.1-HEFI19-NUT_ARTICLE.qmd)
qmd2(<b>9.2-HEFI19-NUT_OSM.qmd)
out("<b>Text, figures, tables")
data1 --> code1 --> data2
data2 --> code2 --> data3
data3 --> code3
code3 --> data3
data1 --> code2
macros1["Macros/*.sas"]
macros1 --> code2
data2 --> qmd1
data3 --> qmd1
data4[(Data/Results)]
data4 --> qmd2
qmd1 --> data4
data4 --> qmd1
data3 --> qmd2
qmd1 --> out
qmd2 --> out
Summary statistics output of each step are provided in the OSF repository. Thus, the *9.1-HEFI19-NUT_ARTICLE.qmd * Quarto document can be used to generate the manuscript including tables and figures directly, without having to run all analyses beforehand. The 9.2-HEFI19-NUT_OSM.qmd Quarto document generates the supplemental material file.
Available on GitHub (here):
- Macros/: SAS macros (i.e., scripts) needed for main analysis based
on
.sas
files 1 to 7. R functions for repetitive steps are also included in this folder; - docs/: text output of the quarto documents.
- Data/: raw datafile (unedited), processed data and additional results generated by the Quarto documents;
- NCI/: results data generated by the NCI methods (see
.sas
files 1 to 7); - Manuscript/: manuscript tables and figures generated by the Quarto document.
The flowchart below presents a generic overview of the main analyses in this study. Complete details about analyses are provided in the article.
%%{init: {'theme': 'neutral' } }%%
flowchart TB
A["1) Measurement error correction<br>(<I>NCI multivariate method</I>)"]
B["2) Continuous relationship<br>(<I>Linear regression</I>)"]
C["3) Nutrient intake adequacy<br>(<I>Logistic regression</I>)"]
D["4) Bootstrap variance estimation<br>(<I>bootstrap replicate weights</I>)"]
A-->B
B-->C
C-->D
D-."500<br>repetitions".->A
Description of SAS and QMD codes | ||
Name | Description | Link |
---|---|---|
1.0-Data_preparation.sas | Based on CCHS 2015 - Nutrition PUMF data, calculate intakes of HEFI-2019 dietary constituents per respondent and recall. Prepare an input data for the NCI MCMC multivariate method. Look at proportion of respondents with zero intake |
Open code |
2.1-NCI_multi_pro_mcmc.sas | Apply the multivariate measurement error correction model to HEFI-2019 dietary constituents and protein intakes |
Open code |
2.2-NCI_multi_pro_res.sas | Estimate usual intakes distribution, relationship between variables and prevalence of inadequacy among pseudo-individual (example code of original sample only) |
Open code |
3.1-NCI_multi_ca_vit_d_mcmc.sas | Apply the multivariate measurement error correction model to HEFI-2019 dietary constituents, calcium and vitamin D intakes |
Open code |
3.2-NCI_multi_ca_vit_d_res.sas | Estimate usual intakes distribution, relationship between variables and prevalence of inadequacy among pseudo-individual (example code of original sample only) |
Open code |
4.1-NCI_multi_miscA_mcmc.sas | Apply the multivariate measurement error correction model to HEFI-2019 dietary constituents, iron, zinc, vitamin B6 and B12 |
Open code |
4.2-NCI_multi_miscA_res.sas | Estimate usual intakes distribution, relationship between variables and prevalence of inadequacy among pseudo-individual (example code of original sample only) |
Open code |
5.1-NCI_multi_miscB_mcmc.sas | Apply the multivariate measurement error correction model to HEFI-2019 dietary constituents, folate, magnesium, fibers and potassium |
Open code |
5.2-NCI_multi_miscB_res.sas | Estimate usual intakes distribution, relationship between variables and prevalence of inadequacy among pseudo-individual (example code of original sample only) |
Open code |
6.1-NCI_multi_vit_a_mcmc.sas | Apply the multivariate measurement error correction model to HEFI-2019 dietary constituents and vitamin A |
Open code |
6.2-NCI_multi_vit_a_res.sas | Estimate usual intakes distribution, relationship between variables and prevalence of inadequacy among pseudo-individual (example code of original sample only) |
Open code |
7.0-Bootstrap_variance.sas | Parametric bootstrap variance estimation (i.e., 95%CI) based on the previous analyses repeated in 500 bootstrap replicate weights. The repetition is not shown, but statistical estimates obtained with each bootstrap sample are available within the NCI/ folders on OSF |
Open code |
9.1-HEFI19-NUT_ARTICLE.qmd | Quarto document used to generate the text, figures and tables of the article |
Open code | View document |
9.2-HEFI19-NUT_OSM.qmd | Quarto document used to generate the supplemental material |
Open code | View document |
CCHS-2015, Canadian Community Health Survey 2015; HEFI-2019, Healthy Eating Food Index 2019; MCMC, Markov Chain Monte Carlo; NCI, National Cancer Institute; PUMF, Public Use Microdata File |
Of note, due to model complexity and sample size, the main analysis is computationally intensive. For example, a single run of codes 4.1-NCI_multi_miscA_mcmc.sas and 4.2-NCI_multi_miscA_res.sas on a dedicated SAS studio server took approximately 97 minutes. To obtain correct variance due to the multistep modelling approach and survey data, this analysis had to be repeated 500 times with each bootstrap weight replicate.
Brassard D, Chevalier S. Relationship between adherence to the 2019 Canada’s Food Guide recommendations on healthy food choices and nutrient intakes in older adults. J Nutr 2023. doi: 10.1016/j.tjnut.2023.07.005.
Pre-print version of this manuscript: Brassard D, Chevalier S. Relationship between adherence to the 2019 Canada’s Food Guide recommendations on healthy food choices and nutrient intakes in older adults. medRxiv 2023:2023.02.13.23285868. doi: 10.1101/2023.02.13.23285868.
Brassard D, Elvidge Munene LA, St-Pierre S, et al. Development of the Healthy Eating Food Index (HEFI)-2019 measuring adherence to Canada’s Food Guide 2019 recommendations on healthy food choices. Appl Physiol Nutr Metab 2022a;47:595-610. doi: 10.1139/apnm-2021-0415.
Brassard D, Elvidge Munene LA, St-Pierre S, et al. Evaluation of the Healthy Eating Food Index (HEFI)-2019 measuring adherence to Canada’s Food Guide 2019 recommendations on healthy food choices. Appl Physiol Nutr Metab 2022b;47(5):582-94. doi: 10.1139/apnm-2021-0416.
Health Canada. The Healthy Eating Food Index 2019. https://open.canada.ca/data/en/dataset/29892c85-2ff5-484c-873c-f494ffba6e1b : Open Government Portal, 2023.
Health Canada. Reference Guide to Understanding and Using the Data: 2015 Canadian Community Health Survey - Nutrition. https://www.canada.ca/en/health-canada/services/food-nutrition/food-nutrition-surveillance/health-nutrition-surveys/canadian-community-health-survey-cchs/reference-guide-understanding-using-data-2015.html : 2017.
Rana H, Mallet M-C, Gonzalez A, et al. Free Sugars Consumption in Canada. Nutrients 2021;13(5):1471. doi: 10.3390/nu13051471
Zhang S, Midthune D, Guenther PM, et al. A New Multivariate Measurement Error Model with Zero-Inflated Dietary Data, and Its Application to Dietary Assessment. Ann Appl Stat 2011;5(2B):1456-87. doi: 10.1214/10-AOAS446.
Expand for details
[1] "2024-01-10 09:37:54 EST"
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur ... 10.16
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] gt_0.9.0 purrr_1.0.1 tidyr_1.3.0 dplyr_1.1.2
loaded via a namespace (and not attached):
[1] pillar_1.9.0 compiler_4.2.2 forcats_1.0.0 tools_4.2.2
[5] digest_0.6.33 jsonlite_1.8.7 evaluate_0.21 lifecycle_1.0.3
[9] tibble_3.2.1 pkgconfig_2.0.3 rlang_1.1.1 cli_3.6.1
[13] rstudioapi_0.15.0 commonmark_1.9.0 yaml_2.3.7 haven_2.5.3
[17] xfun_0.39 fastmap_1.1.1 withr_2.5.0 knitr_1.43
[21] xml2_1.3.5 generics_0.1.3 vctrs_0.6.3 sass_0.4.7
[25] hms_1.1.3 rprojroot_2.0.3 tidyselect_1.2.0 glue_1.6.2
[29] here_1.0.1 R6_2.5.1 fansi_1.0.4 rmarkdown_2.23
[33] readr_2.1.4 tzdb_0.4.0 magrittr_2.0.3 htmltools_0.5.5
[37] utf8_1.2.3 markdown_1.7