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
targetspackage withlibrary(targets) - To run all analyses, run
tar_make() - To load individual targets into your environment, run
tar_load(targetName)
The geographic and linguistic distance matrices used in the paper can be found in the data/networks folder of this repository
(see here). The two .xlsx files are as
follows:
1F Population Distance.xlsxcontains geodesic distances between 269 countries, measured in metres.2F Country Distance 1pml adj.xlsxcontains linguistic distances between 269 countries, scaled between 0 and 1. Higher values indicate greater linguistic dissimilarity between countries.
Any issues, please email scott.claessens@gmail.com.
Scott Claessens, scott.claessens@gmail.com