This repository contains code and data for the reproduction of analysis and figures from: Kotz, Wenz, Stechemesser, Kalkuhl and Levermann (2020). ~ Data included: GADM dataset of regional shapefiles: gadm36_levels.gpkg Calculated regional climate variables: T.5_???_measure.npy and P.5_???_measure.npy, contained in ZIPPED folders T5_measures.zip & P5_measures.zip World bank GDP and population data: WB_GDP.csv Economic and regional climate data: T_econ.dta Economic and regoinal climate data with lagged variables: T_econ_5_lags.dta Economic and regional climate data restricted to regions with certain seasonal temp. differences: T_econ_seas_g*.dta Daily climate data used to plot Fig_1: corrientes_ARG_T_days.npy & ocampo_MEX_T_days.npy ~ Data not included: Raw ERA-5 daily temperature and preicpitation data, 1979-2018, interpolated to 0.5x0.5 grid by ISIMIP (https://www.isimip.org/). Available from ISIMIP or from authors upon request. ~ Code included: T_scatter.py - code to calculate and aggregate the main temperature variables (annual average and day-to-day variability) from ERA-5 grid to regional level. P_scatter.py - code to calculate and aggregate precipitation variables (total annual) from ERA-5 grid to regional level. Regression_Table_1 - Stata do file including code to run regressions for Table 1 of the manuscript. Table_SX - Stata do files including code to run regressions for Tables S1-11 of the SI. partitions.py - code to partition data based on national and regional income, to export sub-data sets for analysis in R, and for plotting Fig S4. partition_regressions.R - code to calculate marginal effects used for plotting in Figs 4, S1 and S5. partitions_plot.py - code to plot Figs 4, S1 and S5. plot_Fig_1.py plot_Fig_2.py plot_Fig_3.py ~ Order: 1. T_scatter.py and P_scatter.py to calculate regional climate variables using raw ERA-5 data and GADM regional shapefile data. (Note: set correct directory for raw ERA-5 data on l101 of T_scatter.py and l102 of P_scatter.py). 2. Regression_Table_1 and Table_SX to run main and supplementary regressions in Stata using the economic and climate data_set T_econ.dta (and T_econ_5_lags.dta for Table_S_10 and T_econ_seas_g*.dta for Table_S_2). 3. plot_Fig_1.py using corrientes_ARG_T_days.npy & ocampo_MEX_T_days.npy. 4. plot_Fig_2.py using T_econ.dta and gadm36_levels.gpkg. 5. plot_Fig_3.py using T_econ.dta, T.5_???_measure.npy and WB_GDP.csv. 6. partitions.py using T_econ.dta and gadm36_levels.gpkg. 7. partition_regressions.R using the output of partitions.py. 8. partitions_plot.py using the output of partition_regressions.R and T_econ.dta.