This repository contains the data and R code for the manuscript "Cross-national analyses require additional controls to account for the non-independence of nations".
To clone this repository using Git, you will need to first install Git LFS to download large data files. Once Git LFS is installed, run:
git clone https://github.com/ScottClaessens/crossNationalCorrelations
To run this code, you will need to install R and the following R packages:
install.packages(c("brms", "cowplot", "conleyreg", "countrycode",
"dagitty", "geosphere", "ggcorrplot", "ggdag", "ggrepel",
"ggtext", "haven", "lmtest", "papaja", "psych", "readxl",
"rstan", "sf", "sjlabelled", "targets", "tarchetypes",
"tidybayes", "tidyverse"))
If you run into issues with the pipeline, try installing the specific R version or package versions outlined in sessionInfo.txt
.
- Set the working directory to this code repository
- Load the
targets
package withlibrary(targets)
- To run all analyses, run
tar_make()
- To load individual targets into your environment, run
tar_load(targetName)
Any issues, please email [email protected].
Scott Claessens, [email protected]