Skip to main content

Worked example: Public debt and economic growth (panel data)

This page illustrates EcoLab's 5-step workflow for a common panel-data topic: the impact of public debt on economic growth. The focus is how to choose between FEM/REM and dynamic GMM when the model is dynamic and endogeneity is suspected. The figures in the results are format illustrations, not official empirical findings.

Summary: with a panel of many countries × many years and a dynamic growth model (with a lagged growth term), System GMM is usually preferable to FEM because it controls for endogeneity and the Nickell bias.


Step 1 — Ideation

  • Research question: How does public debt (debt/GDP) affect growth, and is there a nonlinear threshold?
  • Intended contribution: test the debt–growth relationship while controlling for endogeneity with GMM on an updated sample.

Step 2 — Literature Review

EcoLab synthesizes the literature (e.g., the debate around the 90%-of-GDP debt threshold), standardizes citations, and clarifies the gap and the variables. Framework: neoclassical plus endogenous growth theory.

Step 3 — Data Collection

VariableSymbolMeasurementSource
GDP growthgrowth% change in real GDPWorld Bank WDI; IMF WEO
Public debtdebtPublic debt / GDP (%)IMF; World Bank
InvestmentinvestGross fixed capital / GDP (%)World Bank WDI
Trade opennessopen(Exports + Imports)/GDP (%)World Bank WDI
Inflationinf% change in CPIWorld Bank WDI
  • Structure: a panel of ~30–60 countries × ~20 years (large N, moderate T) — suitable for dynamic GMM.
  • In EcoLab, connect EcoData or public sources, merge variables, clean, and view descriptive statistics.

Step 4 — Modeling

Estimation strategy, in order:

  1. Pooled OLS (baseline) → FEM/REM; run Hausman to choose between FEM and REM.
  2. Recognize the dynamics (add growth_lag) and endogeneity (debt may be endogenous) → switch to System GMM.
  3. Mandatory GMM tests: AR(2), Hansen, and control of the instrument count.

Illustrative results (format — not real results):

FEMSystem GMM
growth_lag0.30***
debt−0.06**−0.04**
invest0.22***0.19***
Hausmanp=0.01 → FEM
AR(2) p-value0.37 (valid)
Hansen p-value0.31 (valid)

Sample interpretation: public debt has a small negative effect on growth; GMM confirms the sign after controlling for endogeneity and dynamics.

* ---- Panel: Public debt and growth ----
use "debt_growth_panel.dta", clear
xtset country year

* Fixed Effects with robust SE
xtreg growth debt invest open, fe vce(robust)
estimates store fe

* Random Effects
xtreg growth debt invest open, re
estimates store re

* Hausman test
hausman fe re

Step 5 — Reporting

EcoLab produces a standard report (APA/Chicago/Harvard/IEEE/MLA) including data & methodology, an FEM-vs-GMM results table, diagnostics, discussion, and a replication-code appendix (Stata/R/Python).


Reproducibility and verification

Every estimation step (FEM, REM, Hausman, System GMM with AR(2)/Hansen) is generated as replication code under the relevant tab so it can be re-run independently — ensuring transparency and verifiability.


Video tutorial

Video Tutorial: Panel data analysis (public debt and growth) in EcoLab

See also