← Back to the post
Interactive data dictionary

Economic Shocks and Civil Conflict at the Regional Level

Replication panel for IV / 2SLS estimation in Stata, after Hodler & Raschky (2014).

1
dataset
14
variables
5,689
regions
1994–2010
years

Downloads

Each dataset is available as a labeled Stata .dta and its source file.

⇩ Download all data (ZIP)stata_codebook.do

DatasetGrainRowsStataSource
EL_regional_conflict_replicationregion-year96,591 × 14EL_regional_conflict_replication.dtaEL_regional_conflict_replication.dta

Run stata_codebook.do in Stata once to attach long-form per-variable notes to the .dta files.

Load directly in code

Every file loads straight from GitHub (raw URLs). Swap the file name to load any dataset.

Stata

* Stata 14+ : `use` reads an https URL directly
global BASE "https://raw.githubusercontent.com/cmg777/starter-academic-v501/master/content/post/stata_iv_panel/data/"
use "${BASE}EL_regional_conflict_replication.dta", clear
describe
notes

Python

!pip install -q pyreadstat
import pandas as pd
BASE = "https://raw.githubusercontent.com/cmg777/starter-academic-v501/master/content/post/stata_iv_panel/data/"
df = pd.read_stata(BASE + "EL_regional_conflict_replication.dta")

# load every dataset at once
files = ["EL_regional_conflict_replication"]
data = {f: pd.read_stata(BASE + f + ".dta") for f in files}

# pyreadstat (richest metadata) reads LOCAL files -> download first
import pyreadstat, urllib.request
urllib.request.urlretrieve(BASE + "EL_regional_conflict_replication.dta", "EL_regional_conflict_replication.dta")
df, meta = pyreadstat.read_dta("EL_regional_conflict_replication.dta")

Copy and paste this snippet in Google Colab app. https://colab.research.google.com/notebooks/empty.ipynb

R

# R : haven::read_dta auto-downloads an https URL
library(haven)
BASE <- "https://raw.githubusercontent.com/cmg777/starter-academic-v501/master/content/post/stata_iv_panel/data/"
df <- read_dta(paste0(BASE, "EL_regional_conflict_replication.dta"))

Overview & sources

Replication data for a hands-on Stata tutorial that estimates the causal effect of economic shocks on civil conflict by replicating Hodler & Raschky (2014, Economics Letters). The panel covers 96,591 region–year observations from 5,689 subnational administrative regions across African countries over 1994–2010. Conflict is a binary region-year outcome (1+ or 25+ battle deaths from UCDP); nighttime light intensity (DMSP) proxies local economic activity; and lagged log rainfall and the lagged Palmer Drought Severity Index serve as instruments. The endogenous light variable is instrumented because conflict suppresses light (reverse causality) and light measures activity with error (attenuation). OLS returns a near-zero coefficient; 2SLS using both weather instruments yields about −0.30 on conflict (1+ deaths), with first-stage F-statistics above the Stock–Yogo threshold and a Hansen J p-value of 0.93. This is real observational data, not simulated.

One file. EL_regional_conflict_replication is an annual region panel (one row per region × year, objectid × year, 1994–2010) holding the conflict outcomes, the nighttime-light proxy, and the two weather instruments. Every estimation variable ships in two forms: the raw series and a detrended (_dt) series — residuals from a region-specific linear time trend, equivalent to including region-specific trends in the regression. The tutorial uses the detrended variables throughout, following the original paper.

Data sources

SourceProvidesReference / URL
Hodler &amp; Raschky (2014)Replicated study; the assembled region-year panel and detrended (_dt) variablesHodler, R. & Raschky, P.A. (2014). Economic shocks and civil conflict at the regional level. Economics Letters, 124(3), 530–533.
UCDP Georeferenced Event Dataset (GED)Civil-conflict outcomes (battle deaths geocoded to regions; 1+ and 25+ death dummies)Uppsala Conflict Data Program (UCDP), Georeferenced Event Dataset. https://ucdp.uu.se/
DMSP-OLS nighttime lightsNighttime light intensity — proxy for local economic activity (logged, lagged)NOAA/NGDC DMSP-OLS Nighttime Lights Time Series. Henderson, Storeygard & Weil (2012), American Economic Review, 102(2), 994–1028.
Weather instruments (rainfall &amp; PDSI)Lagged log rainfall and the lagged Palmer Drought Severity Index (the instruments)Rainfall (GPCC); Palmer Drought Severity Index (PDSI). Used as instruments per Miguel, Satyanath & Sergenti (2004), Journal of Political Economy, 112(4), 725–753.
Method referencesIV / 2SLS estimators and weak-instrument diagnosticsMiguel, Satyanath & Sergenti (2004); Stock & Yogo (2005); Stock & Wright (2000); Hansen J overidentification test.

Cite this data

Please cite this dataset as follows.

APA

Mendez, C. (2026). IV Estimation with Panel Data: Economic Shocks and Civil Conflict [Data set]. https://carlos-mendez.org/post/stata_iv_panel/

Hodler, R., & Raschky, P. A. (2014). Economic shocks and civil conflict at the regional level. Economics Letters, 124(3), 530–533.

BibTeX

@misc{mendez2026stataivpanel,
  author       = {Mendez, Carlos},
  title        = {IV Estimation with Panel Data: Economic Shocks and Civil Conflict},
  year         = {2026},
  howpublished = {\url{https://carlos-mendez.org/post/stata_iv_panel/}},
  note         = {Data set}
}

@article{hodler2014economic,
  author  = {Hodler, Roland and Raschky, Paul A.},
  title   = {Economic shocks and civil conflict at the regional level},
  journal = {Economics Letters},
  volume  = {124}, number = {3}, pages = {530--533}, year = {2014}
}

Variable explorer search & filter all 14 variables

Type to filter by name or label, or use the chips to filter by type. Each row shows a mini distribution. Click a header to sort.

VariableTypeDistributionLabelDefinitionUnitsIn filesSource
countrycode#identifierCountry ISO3 codeThree-letter ISO country code of the region's country.ISO 3166-1 alpha-3EL_regional_conflict_replicationHodler & Raschky (2014)
countryname#identifierCountry nameName of the country containing the region.stringEL_regional_conflict_replicationHodler & Raschky (2014)
l2lnrain01#continuousmin -4.61 | median 4.1 | max 6.09Ln rainfall (t-2), rawLog rainfall lagged two years — instrument 1 for economic activity.log mmEL_regional_conflict_replicationRainfall (GPCC)
l2lnrain01_dt#continuousmin -5.44 | median 0.00284 | max 2.5Ln rainfall (t-2), detrendedDetrended log rainfall — instrument 1 as used in the regressions.deviation (log)EL_regional_conflict_replicationDerived (this study)
l2meanpdsi#continuousmin -12.1 | median -1.17 | max 12.6Palmer Drought Severity Index (t-2), rawLagged Palmer Drought Severity Index — instrument 2 (higher = less drought).PDSI (index)EL_regional_conflict_replicationPDSI
l2meanpdsi_dt#continuousmin -6.66 | median -0.053 | max 11.8Palmer Drought Severity Index (t-2), detrendedDetrended PDSI — instrument 2 as used in the regressions.deviationEL_regional_conflict_replicationDerived (this study)
llnlight01#continuousmin -4.61 | median -1.87 | max 4.14Ln nighttime lights (t-1), rawLog nighttime light intensity lagged one year — proxy for local economic activity (endogenous regressor).log intensityEL_regional_conflict_replicationDMSP-OLS nighttime lights
llnlight01_dt#continuousmin -5.72 | median 0 | max 5.36Ln nighttime lights (t-1), detrendedDetrended log nighttime lights — the endogenous regressor used in all regressions.deviation (log)EL_regional_conflict_replicationDerived (this study)
objectid#identifierRegion identifier (panel ID)Unique identifier for each subnational administrative region (the panel unit).integer IDEL_regional_conflict_replicationHodler & Raschky (2014)
ucdp_25death_dummy#dummyshare coded 1 = 0.014Conflict (25+ deaths), raw1 if the region-year had 25 or more conflict-related deaths, else 0 (outcome 2).0/1EL_regional_conflict_replicationUCDP GED
ucdp_25death_dummy_dt#continuousmin -0.919 | median 0 | max 0.983Conflict (25+ deaths), detrendedDetrended conflict (25+ deaths): residual from a region-specific linear time trend.deviationEL_regional_conflict_replicationDerived (this study)
ucdp_death_dummy#dummyshare coded 1 = 0.046Conflict (1+ deaths), raw1 if the region-year had at least one conflict-related death, else 0 (outcome 1).0/1EL_regional_conflict_replicationUCDP GED
ucdp_death_dummy_dt#continuousmin -1.06 | median 0 | max 1.01Conflict (1+ deaths), detrendedDetrended conflict (1+ deaths): residual from a region-specific linear time trend.deviationEL_regional_conflict_replicationDerived (this study)
year#yearCalendar yearAnnual time index (the panel time variable).yearEL_regional_conflict_replicationHodler & Raschky (2014)

Cross-file variable index

Which file each variable appears in (● = present).

Construction & formulas

The IV design isolates the causal effect of economic activity on conflict using weather as an external shifter. With region fixed effects α_i, region-specific trends β_i·t, and year fixed effects γ_t:

The datasets

Switch datasets with the tabs. Each shows the full variable dictionary plus a sortable statistics table with mini distributions and data coverage.

expand to search (Ctrl/⌘+F) or print across all datasets

region-year  96,591 × 14 · 1994-2010 · 5,689 subnational regions; 43 African countries

Panel key: objectid x year · Estimate the causal effect of economic shocks on civil conflict via FE-OLS and 2SLS/IV.

Variable dictionary

VariableLabelDefinitionConstructionUnitsSourceCoverage
objectid identifierRegion identifier (panel ID)Unique identifier for each subnational administrative region (the panel unit).Region code from the original replication; panel set via tsset objectid year.integer IDHodler & Raschky (2014)5,689 regions
year yearCalendar yearAnnual time index (the panel time variable).Observation year, 1994-2010.yearHodler & Raschky (2014)1994-2010
countrycode identifierCountry ISO3 codeThree-letter ISO country code of the region's country.From the original panel (variable label 'ISO').ISO 3166-1 alpha-3Hodler & Raschky (2014)43 countries
countryname identifierCountry nameName of the country containing the region.From the original panel (variable label 'NAME_0').stringHodler & Raschky (2014)43 countries
ucdp_death_dummy dummyConflict (1+ deaths), raw1 if the region-year had at least one conflict-related death, else 0 (outcome 1).From UCDP geocoded battle deaths aggregated to the region-year.0/1UCDP GEDregion-year
ucdp_25death_dummy dummyConflict (25+ deaths), raw1 if the region-year had 25 or more conflict-related deaths, else 0 (outcome 2).From UCDP geocoded battle deaths aggregated to the region-year.0/1UCDP GEDregion-year
llnlight01 continuousLn nighttime lights (t-1), rawLog nighttime light intensity lagged one year — proxy for local economic activity (endogenous regressor).Natural log of DMSP-OLS nighttime light intensity, lagged one year.log intensityDMSP-OLS nighttime lightsregion-year
l2lnrain01 continuousLn rainfall (t-2), rawLog rainfall lagged two years — instrument 1 for economic activity.Natural log of annual rainfall (GPCC), lagged two years.log mmRainfall (GPCC)region-year
l2meanpdsi continuousPalmer Drought Severity Index (t-2), rawLagged Palmer Drought Severity Index — instrument 2 (higher = less drought).Mean PDSI for the region, lagged two years; the label reads '(Non) Drought'.PDSI (index)PDSIregion-year
ucdp_death_dummy_dt continuousConflict (1+ deaths), detrendedDetrended conflict (1+ deaths): residual from a region-specific linear time trend.Residual of ucdp_death_dummy on year, fitted within each region (objectid).deviationDerived (this study)region-year
ucdp_25death_dummy_dt continuousConflict (25+ deaths), detrendedDetrended conflict (25+ deaths): residual from a region-specific linear time trend.Residual of ucdp_25death_dummy on year, fitted within each region (objectid).deviationDerived (this study)region-year
llnlight01_dt continuousLn nighttime lights (t-1), detrendedDetrended log nighttime lights — the endogenous regressor used in all regressions.Residual of llnlight01 on year, fitted within each region (objectid).deviation (log)Derived (this study)region-year
l2lnrain01_dt continuousLn rainfall (t-2), detrendedDetrended log rainfall — instrument 1 as used in the regressions.Residual of l2lnrain01 on year, fitted within each region (objectid).deviation (log)Derived (this study)region-year
l2meanpdsi_dt continuousPalmer Drought Severity Index (t-2), detrendedDetrended PDSI — instrument 2 as used in the regressions.Residual of l2meanpdsi on year, fitted within each region (objectid).deviationDerived (this study)region-year

Distribution & statistics (click a header to sort)

VariableDistributionCoverageNDistinctMinMeanMedianMaxSD
objectid100%96,5915,689
year100%96,5911719942002.0200220104.90
countrycode100%96,59143
countryname100%96,59143
ucdp_death_dummyshare coded 1 = 0.046100%96,591200.04601.000.208
ucdp_25death_dummyshare coded 1 = 0.014100%96,591200.01401.000.119
llnlight01min -4.61 | median -1.87 | max 4.14100%96,59164,356-4.61-1.61-1.874.142.62
l2lnrain01min -4.61 | median 4.1 | max 6.09100%96,59158,543-4.613.834.106.091.48
l2meanpdsimin -12.1 | median -1.17 | max 12.6100%96,59136,302-12.13-1.22-1.1712.632.03
ucdp_death_dummy_dtmin -1.06 | median 0 | max 1.01100%96,5911,006-1.06-3.39e-1001.010.161
ucdp_25death_dummy_dtmin -0.919 | median 0 | max 0.983100%96,591641-0.919-1.44e-1000.9830.098
llnlight01_dtmin -5.72 | median 0 | max 5.36100%96,59182,652-5.72-1.36e-1105.360.411
l2lnrain01_dtmin -5.44 | median 0.00284 | max 2.5100%96,59171,705-5.442.10e-110.0032.500.187
l2meanpdsi_dtmin -6.66 | median -0.053 | max 11.8100%96,59137,353-6.66-1.53e-09-0.05311.801.59

Known limitations & caveats