Datasets and codes
The enclosed data and code replicates all tables and graphs in "Has climate change driven urbanization in Africa?" by Vernon Henderson, Adam Storeygard and Uwe Deichmann Please cite this paper if you use this code. All scripts may require modification of pathnames to match the user's file system. regs.do is a stata do file (written for version 12.1) that reproduces all figures and tables, using the following four data files: - regiondata.dta contains the data used to create tables 1 (Panel A), 2, 3, 4, A1, A2, and A3a, and figures 6 and 7. - citydata.dta contains the data used to create tables 1 (Panel B), 6, 7, 8, A3b, and A4. - countrydata.dta contains the data used to create table 5. - countrydata_allyears.dta contains the data used to create figure 4. These four datafiles were constructed using the following code for python (ArcGIS; .py), stata (.do), and matlab (.m): districts: - udel_to_ascii_africa_monthly.do converts raw downloaded climate data (air_temp.YYYY and precip.YYYY for years YYYY) to ascii grid format readable by ArcGIS - znew.py calculates average values of the climate variables by district. Also assigns districts to each industry, and centroids, distance to coast, and neighbors to each district. cities: - floodremovefews2.m downloads the Novella and Thiaw (2012) rainfall data and averages it by year, with alternate versions that first winsorize the data - rain_calctrims.py calculates annual rainfall for each city-light - v4citypop_encode.do converts raw information on African city populations and locations primarily from citypopulation.de standardizes it - splitlight_city_join.py joins this population information to the lights - conflictprep.do preps the raw downloaded conflict data ("SCAD 3.1 (For Public Release).csv") for next steps, using country codes from cflisocodes.dta - conflict.py assigns conflicts to each city within 0-3 km and 3-50 km all: fullrepprep.do combines the various input files created above into the four stata files for analysis Each script contains information on its input and output files Raw input files: citypop_v4.csv raw city population information from citypopulation.de used by v4citypop_encode.do citypop_v4_latlons.csv raw city location information from citypopulation.de used by v4citypop_encode.do Africa.html.csv raw population cutoff information from citypopulation.de used by v4citypop_encode.do afrisoniso3.csv table of country codes used by v4citypop_encode.do and splitlight_city_join.py extra_sources.csv table of additional (i.e. not from citypopulation.de) population and location information used by v4citypop_encode.do afrregnew.gdb district boundaries, primarily aggregated from GADM database of Global Administrative Areas v. 2 (see database.xlsx for aggregations), used by znew.py cflisocodes.dta country codes used by conflictprep.do database.xlsx urban and total populations of districts from various censuses, used by fullrepprep.do gadm2afrcoastline.shp coastline of Africa shapefile, based on GADM database of Global Administrative Areas v. 2, gadm.org, used by znew.py oxfordlatlons.csv table of cities with industry dummies, digitized from Ady (1965), used by znew.py and splitlight_city_join.py palliso city lights from "Farther on down the road: transport costs, trade and urban growth in sub-Saharan Africa", used by splitlight_city_join.py and rain_calctrims.py Pallyears.csv Gridded average annual rainfall from Novella and Thiaw (2012) as calculated by floodremovefews2.m, used by rain_calctrims.py Ptrim196allyears.csv Gridded average annual rainfall, winsorized at 1.96 SD above the local mean from Novella and Thiaw (2012) as calculated by floodremovefews2.m, used by rain_calctrims.py Ptrim257allyears.csv Gridded average annual rainfall, winsorized at 2.57 SD above the local mean from Novella and Thiaw (2012) as calculated by floodremovefews2.m, used by rain_calctrims.py Ptrim2allyears.csv Gridded average annual rainfall, winsorized at 2 SD above the local mean from Novella and Thiaw (2012) as calculated by floodremovefews2.m, used by rain_calctrims.py Ptrim3allyears.csv Gridded average annual rainfall, winsorized at 3 SD above the local mean from Novella and Thiaw (2012) as calculated by floodremovefews2.m, used by rain_calctrims.py "SCAD 3.1 (For Public Release).csv" raw conflict data downloaded from CCAPS, used by conflictprep.do wdiwide.dta World Development Indicators data, used by fullrepprep.do udel/air_temp.YYYY and udel/precip.YYYY raw climate data (for years YYYY) downloaded from the University of Delaware, used by udel_to_ascii_africa_monthly.do
There are no views created for this resource yet.
Additional Information
Field | Value |
---|---|
Data last updated | February 21, 2018 |
Metadata last updated | January 23, 2018 |
Created | unknown |
Format | ZIP |
License | CC-BY-4.0 |
Created | 7 years ago |
Media type | application/zip |
Data classification of file | Public |
Id | ed7a6cd1-f97c-4836-b9ce-ee4704b650cc |
Package id | 131e7bed-f932-4378-bc33-265eb7548aa9 |
Position | 1 |
Resource type | Download |
State | active |
Url type | https://datacatalog.worldbank.org/dataset/has-climate-change-driven-urbanization-africa/resource/ed7a6cd1-f97c-4836-b9ce-ee4704b650cc |