Overview
You can download the replication package
here
(about 1GB).
General structure
The main (root) folder contains the following folders:
programs/
: contains all Stata/R codes that replicate
the results of the paper.
data/inputs/
: contains the data inputs used by the
replication codes.
data/outputs/
: where all processed data is
stored.
results/
: where all results (figures and tables) are
stored.
Besides, it also contains the LOCUST_README.html
file.
Replicating the results
Replicating the results consist of running a sequence of
R
and Stata
codes stored in
programs/
. In what follows, we provide an overview of the
sequential workflow of the replication and a brief description of each
code. Sections 2 to 4 provide further details.
The sequence of codes are the following:
replicate.R
: Runs the following pre-processing routines
that clean the raw data:
process_FAO.R
: processes the FAO-DLIS locust data.
process_DHS_clusters.R
: processes the DHS GIS data
(clusters).
process_OMA.R
: processes OMA market crop prices’
data.
process_DHS_BR.R
: processes the DHS Birth Records (BR),
which contain all children/mother/household data.
replicate.do
: Runs the following .do
files
that replicate the main empirical results of the paper:
reg_prepare.do
: prepare the pre-processed data for the
regressions.
reg_do.do
: runs the main regressions of the paper.
desc_stats.R
: reproduces figures and maps.
Throughout, several inputs are needed (data and code). We describe
them next.
Pre-processing data
The code replicate.R
runs all pre-processing codes that
clean the raw data. Hence, one needs only to run this code after
setting the right working directory in line 12
. In what
follows, we provide more details of the tasks executed by
replicate.R
:
First, it runs process_FAO.R
, which cleans the raw
locust-related data (locust events and anti-locust spraying events) and
aggregate them into unique, processed data files
data/outputs/FAO/swarmdata_full.rdata
and
data/outputs/FAO/swarm_spraydata_full.rdata
.
Then, it runs process_DHS_clusters.R
. This code first
loads and aggregates all DHS geocoded cluster shapefiles and then
matches them to the locust data. This is where the treatment assignment
at the cluster level is added. Subsequently, it calculates the shortest
euclidean distance from each DHS cluster to the closest town. It stores
the final processed data in
data/outputs/DHS_clusters/clusters_withtreat.rdata
.
Subsequently, it runs process_OMA.R
. It first geocodes
(i.e. adds the coordinates) of each market and add treatment status
(with the locust data) and several covariates (i.e. travel distance to
the nearest town). Then, it matches the price to weather (SPEI) data.
This last step is time-consuming and takes about 6-8 hours in a regular
computer. It stores the final processed price data in
data/outputs/OMA/oma_price_with_data*
(where * stands for
.R
and .dta
formats).
Finally, it executes process_DHS_BR.R
. It loads each DHS
Birth Record and calculates, for each children of the relevant sample,
several characteristics such as in-utero treatment and in-utero average
crop prices. This is a time-consuming task that takes about 10 hours in
a regular computer. It stores the final processed birth record data in
data/outputs/DHS_BR/MLBR_withdata.csv
.
Main results: regressions, descriptive statistics, tables, and
figures
The code replicate.do
runs all .do
files
that reproduces the regression results of the paper. Hence, one needs
only to run this code after setting the right working directory
in line 23
. One also needs to store the
.ado
programs that estimates Spatial HAC standard errors. In what
follows, we provide more details of the tasks executed by
replicate.do
:
First, it executes reg_prepare.do
, which does some final
processing and cleaning of the
data/outputs/DHS_BR/MLBR_withdata.csv
dataset. That
includes generating the treatment dummies, calculating average weather
shocks in-utero, exposure to anti-locust spraying, and more. It also
exports data/outputs/DHS_BR/MLBR_for_descstats.csv
, which
is a subset of the birth records that is used to calculate descriptive
statistics.
Then, it runs reg_do.do
, which reproduces and stores
all regression-related results (i.e. tables and plots)
in results/figures/
and results/tables
. Ii
also prints on Stata’s console the results of several Hausman tests
described in the paper.
To conculde the replication of the paper, one needs to run
desc_stats.R
after setting the right working
directory in line 7
. It reproduces the final
elements of the paper, such as tables with descriptive statistics,
additional maps, etc.
References
Cressman, K., 1997. SWARMS: a geographic information system for
desert locust forecasting. In New Strategies in locust control
(pp. 27-35). Birkhäuser Basel.
Cressman, K. and Stefanski, R., 2016. Weather and desert locusts.
Geneva, Switzerland: World Meteorological
Organization.
Uchida, H. and Nelson, A., 2009. Agglomeration index: Towards a
new measure of urban concentration.
Vicente-Serrano, S.M., Beguería, S. and López-Moreno, J.I., 2010.
A multiscalar drought index sensitive to global warming: the
standardized precipitation evapotranspiration index. Journal of
climate, 23(7), pp.1696-1718.