This script replicates all the tables and plots in the article.
The replication archive is built around a series of R and Stata scripts. It was tested under R 3.4.1
and Stata 13.1.
If you experience any problems with other versions or the replication script in general get in touch at [redacted].
Note: you can copy and paste the code below to directly install all required packages
package_list <- c("countrycode",
"lfe",
"texreg",
"dplyr",
"readr",
"texreg",
"readxl",
"MatchIt",
"xtable",
"AER",
"ivpack",
"lmtest",
"foreign",
"tidyverse",
"ggrepel",
"ebal",
"lubridate",
"gridExtra")
install.packages(package_list)
The replication package consists of the following files in the folder ./data
:
diss_df.rda
: The main country-year data setnelda_ps.rda
: The main election-round data setinstrumentedAid2.rdata
: The data set which includes the aid instrumental variableThe folder ./data/external_input/
contains data files used to construct alternative variable codings. They are automatically included by the replication script.
The script assumes that the working directory is the directory in which this README
file is saved.
The script contains two main replication files:
./code/paper_tables_and_plots.R
: This script produces all main tables and figures in the paper../code/appendix_tables_and_plots.R
: This script produces all tables and plots in the Appendix.Open RStudio, change your working directory to the same directory of this README
file, copy & paste the code below in your editor window and execute the script.
source("./code/paper_tables_and_plots.R")
source("./code/appendix_tables_and_plots.R")
Open the README.rmd
file in RStudio, set your working directory to the same directory of this README
file and press the Knit
button in RStudio.
source("./code/paper_tables_and_plots.R")
source("./code/appendix_tables_and_plots.R")