Panel-data analysis of macroeconomic stability and FDI in Sub-Saharan Africa using two-way fixed effects, robustness analysis and an interactive R Shiny dashboard.
# Macroeconomic Stability and FDI in Sub-Saharan Africa
> **A reproducible panel-data analysis of how inflation and exchange-rate volatility relate to foreign direct investment across 48 Sub-Saharan African economies, 1980–2022.**
## Overview
This project combines **World Bank data, two-way fixed-effects econometrics, reproducible R workflows and an interactive Shiny dashboard** to examine whether macroeconomic instability is associated with foreign direct investment (FDI) per capita in Sub-Saharan Africa.
**Research question:** How does macroeconomic stability, measured through inflation and exchange-rate volatility, relate to FDI per capita in Sub-Saharan Africa?
## Project at a glance
| Component | Description |
|---|---|
| **Coverage** | 48 countries, 1980–2022 |
| **Outcome** | `log(1 + FDI per capita)` in the primary specification |
| **Core variables** | Inflation volatility and exchange-rate volatility |
| **Controls** | Trade openness and log GDP per capita |
| **Estimator** | Country and year fixed effects |
| **Inference** | Standard errors clustered by country |
| **Volatility robustness** | Absolute annual change, five-year range, five-year standard deviation |
| **Outcome sensitivity** | IHS transformation and common-sample comparison |
| **Tools** | R, `fixest`, `tidyverse`, `ggplot2`, `modelsummary`, `gt`, Shiny |
## Key findings
- **Exchange-rate volatility is negatively and statistically significantly associated with FDI per capita across all three volatility measures** in the primary specification: absolute annual change (`-0.343***`), five-year range (`-0.338**`) and five-year standard deviation (`-0.857**`).
- **Inflation volatility is negative but not statistically significant** across the three corrected specifications.
- **Log GDP per capita is positive and statistically significant at the 1% level** in all three models; trade openness is positive but not statistically significant.
- The exchange-rate result also survives an **IHS tra …