This github repository contains the replication files for the article titled `Projecting Future Migration with Bayesian Hierarchical Gravity: Models of Migration: An application to Africa' published in Frontiers in Climate (2024).
To clone this repository use the following command:
git clone https://github.com/cottierf/ACMI_frontiers_replication
To replicates the analyses, tables and figures presented in the article and the appendix, users should run the R scripts in root folder in the numerical order indicated starting with "1_calibration_main.R".
The scripts were prepared using R v.4.2.2
ACMI_frontiers_replication/
├── data/ [contains the input data]
│ ├── calibration_data.Rds
│ ├── projection_data.Rds
│ ├── CEPII_Gravity_V202211_addVars.csv
├── stan_output/ [stores the stan model files]
│ ├── loo_cv/ \ [stores the stan loo cv files]
├── projections/ [stores the projection results]
├── tables/ [stores the tables generated from the analysis]
├── figures/ [stores the figures generated from the analysis]
├── utils/ [contains R utility functions]
├── README.md
├── 1_calibration_main.R
├── 2_proj_main.R
├── 3_tables_main.R
├── 4_figures_main.R
├── 5_calibration_appendix.R
├── 6_tables_appendix.R
├── 7_figures_appendix.R
To replicate the analyses presented in the article. You need a number of R packages available on cran. To install these packages simply run the following commands in R:
install.packages("readr")
install.packages("dplyr")
install.packages("tidyr")
install.packages("glue")
install.packages("rstan")
install.packages("brms")
install.packages("loo")
install.packages("ggplot2")
install.packages("bayesplot")
install.packages("BayesPostEst")
install.packages("fastDummies")
install.packages("countrycode")
install.packages("stargazer")
install.packages("cowplot")
install.packages("gridExtra")
Cottier, F. (2024). Projecting Future Migration with Bayesian Hierarchical Gravity Models of Migration: An application to Africa. Frontiers in Climate, 6, 1384295. https://doi.org/10.3389/fclim.2024.1384295
v1.0: public release (12/18/2024)