This is exploratory work and summarized in the presentation. It depends on different data sources and several analysis scripts described below.
-
1.6km International Wealth Index Estimates by Lee and Braithwaite (2022) and 2.4km Relative Wealth Index Extimates by Chi et al. (2022) for South Africa are included in the repo as csv files under
data/
. -
463.8m VIIRS Stray Light Corrected Nighttime Day/Night Band Composites Version 1 from Earth Observation Group are available through Google Earth Engine. This research uses annual median composites of the data. These can be created and downloaded, together with the monthly images, through
code/south_africa_nightlights.ipynb
. For the time being, the extracted monthly and annual median composite images are available through my Google Drive. -
An improved Annual Median Composite (V2.1) of the VIIRS Nightlights, also at 463.8m resolution, for South Africa is included under
data/SA_VNL_v21/
. The corresponding global image was downloaded from here and cropped to South Africa using a rectangular bounding box. This image is used for all geospatial analysis, V1 images are only used to generate time series. A variant of this image with zeros replaced byNA
's is included for visualization purposes. -
1km Population Estimates (UN-Adjusted) for South Africa are available from WorldPop. These are easily downloaded with the script
code/download_SA_pop.R
. -
Various Official GINI Estimates:
data/SA_GINI
has estimates from the World Inequality Databse (extracted using the STATA API) and Standardized World Inequality Database. Furthermoredata/GeospatialGinisData.xlsx
has nightlights-based GINI estimates for all countries from 1992-2013, based on the old DMSP-OLS satellite and the work of Galimberti et al. (2020), downloaded from here. -
Spatial Tax Panel v3.7. You can get it by filing a request to Nomonde Mathambo: [email protected] or contacting Dieter Fintel. It seems that data can also be downloaded here. Results including municipal and hexagonal shapes are exported - together with the relevant STP3 data, as GeoPackage databases under
results/
(thus it is actually not really necessary to get the STP3, unless you want to replicate the results on a newer version).
-
SA_NL_GINI_TS.R
: Produces time series estimates of inequality in South Africa based on annual nightlights median composite images since 2014. It also computes and explores municipal nightlights time series, which are however deemed useless. -
SA_inequality.R
: Produces spatial remotely sensed inequality estimates for South Africa inside 96km2 hexagons or 1km2 interpolations with 5 or 10km radius - based on IWI, RWI and Nightlights in 2020. -
explore_SA_inequality.R
: Explores the inequality estimates computed inSA_inequality.R
using correlations and graphs, and relates them to the Uber Hexagons of the Spatial Tax Panel v3.7. -
spatial_tax_panel.R
: Explores the Spatial Tax Panel v3.7 and joins it with the RWI, IWI, Nightlights and Population, from which alternative municipal GINI estimates are produces. The estimates are compared using correlations and graphs. Note that for consistency with the STP3 and population estimates for 2020, I here use the Nightlights 2020 V1 layer. This was probably not such a great idea, especially for the municipal estimates. I have kept it like this for replication purposes, but it would be good to recalculate these results using the better Nightlights 2021 V2.1 image included in the repo. -
explore_spatial_tax_panel.R
: Explores the inequality estimates computed inspatial_tax_panel.R
using correlations and graphs. -
viz_raster_layers.py
: Python script to plot raster layers and nightlights/wealth estimates at high resolution using Matplotlib.
-
The
results/
folder contains all the GINI estimates produced by various scripts. The result involving 96km2 hexagons and the STP3 are saved as GeoPackage databases, which contain the geometry and can be read from many softwares. The folder also contains a QGIS project to visualize these different estimates. -
The
figures/
folder contains various graphs and figures, many of which are included in the presentation. -
The
presentation/
folder contains a Beamer presentation of the results, delivered at the BBL seminar in the Stellenbosch Economics Department on April 18, 2023. The seminar was recorded.
- Every script should be evaluated on a fresh R session, in particular settings that optimize some of the libraries used such as
set_collapse(nthreads = 4, na.rm = FALSE, sort = FALSE)
are not to be used on all scripts. Also watch out for changes in these options within the script. In general, most scripts are meant to be executed from top to bottom.