This script replicates all the tables and plots in the article.

Software Version Requirements

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].

Software Packages

R packages

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)

Data Files

The replication package consists of the following files in the folder ./data:

  • diss_df.rda: The main country-year data set
  • nelda_ps.rda: The main election-round data set
  • instrumentedAid2.rdata: The data set which includes the aid instrumental variable

The folder ./data/external_input/ contains data files used to construct alternative variable codings. They are automatically included by the replication script.

Working Directory

The script assumes that the working directory is the directory in which this README file is saved.

Scripts

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.

Run Replication

Manual Replication

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")

Automatic Replication

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")