Trends in Cardiovascular Risk Factors in Canada: Variation by Migration and Temporal Factors, 2001-2018
This repository contains all data and code necessary to reproduce the analyses presented in the manuscript "Trends in Cardiovascular Risk Factors in Canada: Variation by Migration and Temporal Factors, 2001-2018" by Chen et al. (doi: 10.1016/j.cjco.2024.04.006). This includes all code for tables, figures, and supplementary material. Supplementary material output related to bootstrapped response can be found on Open Science Framework. Supplementary material related to table outputs can be found on Canadian Journal of Cardiology - Open. Note that the included scripts produce additional analysis beyond those directly presented in the manuscript. The CCHS has a Statistic Canada Open Licence.
All code is written in the programming language R. The easiest way to run it is to use the RStudio IDE. An .Rproj
file is included with this repository for ease of use with RStudio. The scripts should run with any modern version of R.
The R packages required to reproduce the tables and figures are listed at the top of their respective scripts. They must be installed using install.packages
or similar functionality within RStudio prior to running the script.
Run harmonized_data.R
to create metadata for the study.
Run Rmarkdown files in the analysis
folder to create the output tables and figures.