Skip to content

Synthetic panel data analysis of macroeconomic determinants of bank stability using Python and statsmodels.

License

Notifications You must be signed in to change notification settings

Leotaby/macro-bank-stability-panel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Macro Bank Stability Panel

This repository contains a lightweight template for working with a macro‑level panel of bank stability metrics for the EA‑20 over 2000‑2022. It demonstrates a reproducible workflow for preparing a small processed sample, generating illustrative figures, and running baseline econometrics (two‑way fixed effects) and dynamic models (System‑GMM) using an extensible Python package.

Features

  • Two‑way fixed effects (FE) baseline: regress log Z‑score, NPL ratio and Tier‑1 capital ratio on macro fundamentals (GDP growth, unemployment, inflation, real short rate, lagged credit growth and the credit‑to‑GDP gap) with country and year effects and clustered errors.
  • Dynamic System‑GMM module: handle persistence and potential endogeneity using a collapsed instrument set and lagged dependent variables.
  • Mini data build pipeline: build_data.py produces a toy panel_sample.csv in data/processed/ and make_figures.py draws a simple figure into figures/.
  • Notebook placeholder: a starter Jupyter notebook for exploratory analysis.
  • CI, linting and testing: pre‑commit hooks (ruff) and GitHub Actions ensure code quality.
  • Data policy: raw and interim data are excluded from version control; only processed and synthetic examples live in the repository. See data/README.md for details.

Quickstart

Clone the repo and run:

make setup        # create a virtual environment and install requirements
make data         # run src/macrobank/build_data.py to create processed data
make figures      # run src/macrobank/make_figures.py to build example plots
make lint         # run ruff for code style
make test         # run pytest on test suite
make all          # run data and figures targets

See docs/data_dictionary.md for information on the variables used in the panel and docs for additional documentation.

Repository Structure

.
├── src/macrobank/           # Library code and data/figure build scripts
├── notebooks/               # Jupyter notebooks for EDA
├── data/                    # Raw, interim and processed data (raw data not versioned)
├── figures/                 # Output figures generated by scripts
├── docs/                    # Data dictionary and other docs
├── tests/                   # Unit tests
├── .github/workflows/       # Continuous integration config
├── .pre-commit-config.yaml  # Pre‑commit hooks (ruff)
├── Makefile                 # Common tasks

Citation

If you use this project or adapt the structure for your own work, please cite it using the metadata in CITATION.cff.

About

Synthetic panel data analysis of macroeconomic determinants of bank stability using Python and statsmodels.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published