Territorial Conflict and Educational Outcomes: Evidence from a Drug War in Porto Alegre, Brazil
Description
Replication package for the article “Territorial Conflict and Educational Outcomes: Evidence from a Drug War in Porto Alegre, Brazil” (World Development, manuscript WD-43168). The article estimates the effect of the 2016 war between drug factions in Porto Alegre, Brazil, on school learning, using a difference-in-differences design over eight waves (2005–2019) of Brazil’s national standardized assessment (SAEB). Exposure is measured in two independent ways: distance to the neighborhoods where police-recorded homicides spiked, and proximity to faction-related violent events georeferenced from newspaper reports. The package contains the data and R code that reproduce every table and figure in the article and the additional results reported in the response to the reviewers. The data include school-level SAEB and IDEB scores and School Census extracts (INEP), Porto Alegre extracts of the SAEB student and principal microdata, neighborhood-level crime records obtained from the Public Security Secretariat of Rio Grande do Sul under Brazil’s Access to Information Law, mortality records (SIM/DATASUS), census income data (IBGE), and an original database of 300 violent events reported by the newspaper Zero Hora in 2016–2017. The event database records only facts (date, type, number of victims, location and attribution to factions) and reproduces no text from the articles. A master script (run_all.R) runs all steps in the order of the article in about 30 to 50 minutes. See README.md for instructions, software versions and a description of each file.
Files
Steps to reproduce
1. Download and unzip replication_package.zip. Keep the folder structure unchanged. 2. Install R (tested with R 4.3.2) and the packages listed in README.md: dplyr, tidyr, sf, fixest, ggplot2, data.table, MASS, jsonlite, curl and read.dbc. read.dbc was archived on CRAN and must be installed from the CRAN archive, as explained in README.md. 3. Run the master script run_all.R. In RStudio, open the file and click Source; in a terminal, run Rscript run_all.R inside the unzipped folder. No internet connection is needed. 4. The script runs all steps in the order of the article, which takes about 25 to 50 minutes. Tables (.tex, .csv) and figures (.pdf) are written to tables_final/, and the console output of each step, including all numbers quoted in the text, to scripts/<script>_output.txt. At the end, a checklist reports whether each table and figure of the article was produced. 5. If a run is interrupted, running run_all.R again skips the steps already completed. Delete run_all_log.txt to start from scratch.
Institutions
- Universidade Federal do Rio Grande do SulRio Grande do Sul, Porto Alegre