uoftpwb/CHR_2024
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Welcome to the replication package for the Canadian Happiness Report 2024. We have included all the data and code needed to replicate the visualizations presented in the report with some exceptions. Due to the proprietary nature of the Gallup World Poll data, we are not legally allowed to share the data drawn from this source used in creating the report. If you are interested in doing a replication of the GWP components of the report, or have concerns about the data, please reach out to us and we can work with you to run your code. Raw, unprocessed data is stored in four locations within the Data folder: CCHS PUMF - encloses the Public-Use Microdata Files for the Canadian Community Health Survey released by Statistics Canada, which can be sourced here: https://odesi.ca/en. CCHS RTRA - encloses data withdrawn from the Real-Time Remote Access program operated by Statistics Canada that lets qualified researchers summarize and export microdata from data sources which are not yet public-use. In this folder is only data from 2019-2022 for CCHS (as these are the only years where we needed to make use of the RTRA service) and only the tables that include data on life satisfaction stratified by age, year, and province. This data is enclosed in a seperate file from the rest of the RTRA data because it plays a central role in the report. Raw RTRA Data - encloses all of the data drawn from the RTRA service (including the contents of the CCHS RTRA folder) with most files being stratified by a particular demographic variable of interest. CSS RTRA - Canadian Social Survey data withdrawn from the RTRA service is stored here, but does not enter the main report, but is referenced in the final section. Running the CCHS Data Cleaning.R file will generate processed and cleaned versions of the CCHS data sourced from both PUMF and RTRA. This processed data will be saved in the Tables subfolder in the Data folder, and cleaned CCHS PUMF data is stored as combined_cchs_data.csv. Copies of all these processed files are also stored in this replication folder to aid different levels of replication and use of this data; and to aid the replicator in checking that our results match. All the plots in the Report can be generated by the file named 'CHR 2024 Figure Generation.R'. The working directory for both files is assumed to be their location, the replication package folder itself. Output will be saved into a folder called Output/Final Plots which itself includes three subfolders PNG, SVG, and JPG. Create these folders before running the code to ensure it runs smoothly. The original code was run on a machine with the following operating system, software and package versions: R version 4.4.1 (2024-06-14) Platform: aarch64-apple-darwin20 Running under: macOS Sonoma 14.5 Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0 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] canadianmaps_2.0.0 sf_1.0-16 patchwork_1.2.0 extrafont_0.19 [5] dplyr_1.1.4 Hmisc_5.1-3 stringr_1.5.1 RColorBrewer_1.1-3 [9] ggplot2_3.5.1 tidyr_1.3.1 loaded via a namespace (and not attached): [1] gtable_0.3.5 xfun_0.46 htmlwidgets_1.6.4 vctrs_0.6.5 [5] tools_4.4.1 generics_0.1.3 tibble_3.2.1 proxy_0.4-27 [9] fansi_1.0.6 cluster_2.1.6 pkgconfig_2.0.3 KernSmooth_2.23-24 [13] data.table_1.15.4 checkmate_2.3.1 lifecycle_1.0.4 compiler_4.4.1 [17] farver_2.1.2 munsell_0.5.1 htmltools_0.5.8.1 class_7.3-22 [21] Rttf2pt1_1.3.12 htmlTable_2.4.3 Formula_1.2-5 pillar_1.9.0 [25] crayon_1.5.3 extrafontdb_1.0 classInt_0.4-10 rpart_4.1.23 [29] tidyselect_1.2.1 digest_0.6.36 stringi_1.8.4 purrr_1.0.2 [33] labeling_0.4.3 fastmap_1.2.0 grid_4.4.1 colorspace_2.1-0 [37] cli_3.6.3 magrittr_2.0.3 base64enc_0.1-3 utf8_1.2.4 [41] e1071_1.7-14 foreign_0.8-86 withr_3.0.0 scales_1.3.0 [45] backports_1.5.0 rmarkdown_2.27 nnet_7.3-19 gridExtra_2.3 [49] evaluate_0.24.0 knitr_1.48 tcltk_4.4.1 rlang_1.1.4 [53] Rcpp_1.0.13 glue_1.7.0 DBI_1.2.3 svglite_2.1.3 [57] rstudioapi_0.16.0 jsonlite_1.8.8 R6_2.5.1 systemfonts_1.1.0 [61] units_0.8-5 For questions and correspondence about the replication package or report in general, please contact Anthony McCanny at anthony.mccanny@mail.utoronto.ca.