beta_convergence(
data,
variable,
controls=None,
*,
first=None,
last=None,
model='ols',
w=None,
fixed_effects=None,
vcov='hetero',
draws=10000,
seed=12345,
min_obs=10,
title=None,
gdf=None,
ref=None,
)
Beta-convergence: did the units that started lower grow faster between two years?
Regresses each unit’s average yearly log growth between first and last on the logarithm of its level in first. A negative slope is convergence.
Parameters
| data |
|
A dataset id, or a panel with geo_id and year, e.g. from load |
required |
| variable |
str |
A numeric, strictly positive column in levels (its logarithm is taken here, so do not pass a variable that is already a logarithm) |
required |
| controls |
|
Numeric column(s) that enter at their value in first (conditional convergence) |
None |
| first |
|
The two years (default: the first and the last year with data) |
None |
| last |
|
The two years (default: the first and the last year with data) |
None |
| model |
str |
"ols", or a spatial model estimated on the boundaries’ weights: "sar" (spatial lag of growth), "sem" (spatial error), "slx" (spatial lags of the regressors) or "sdm" (spatial Durbin: both lags) |
'ols' |
| w |
|
Spatial weights from weights for the spatial models (default: queen contiguity among the units with data in both years) |
None |
| fixed_effects |
|
Column(s), or coarser scale(s) the units lie in (e.g. the scale above them), that enter as dummy variables |
None |
| vcov |
str |
Standard errors of the OLS estimate: "hetero" (robust, HC1) or "iid" |
'hetero' |
| draws |
int |
Simulation draws behind the standard errors of the spatial models’ impacts |
10000 |
| seed |
int |
Makes the draws reproducible |
12345 |
| min_obs |
int |
The fewest units the regression accepts |
10 |
| title |
str | None |
The figure title |
None |
| gdf |
|
Boundaries to use instead of the project’s (a GeoDataFrame with geo_id). Boundaries are loaded only for the spatial models; with "ols", passing gdf adds the growth map |
None |
Returns
|
result object |
A result with .beta_total (the slope; for the spatial models the total impact, next to .beta_direct and .beta_indirect, the spillover), their standard errors .se_total, .se_direct and .se_indirect, .speed (of convergence, per year) and .half_life (years to close half of a gap), .rho and .lam (the spatial parameters), .r2, .aic, .n_obs, .horizon (years between first and last), .df (one row per unit: initial, final, growth and the controls), .fig (growth against the initial log level, with the fitted line), .fig_conditional (the same with controls and fixed effects partialled out; None without them), .fig_map (the map of growth; None without boundaries), .gt and .summary (the estimates; the OLS column is always there), .impacts (every regressor’s impacts, spatial models), .w_spec, .notes and .interpret(). |
Example
!pip install -q geo4bolivia
import geo4bolivia as geo
res = geo.beta_convergence("sdg", "index_sdg") # ~2012 to ~2024
print(res.interpret())
res.fig
Across 343 units, the growth of Sustainable Development Index, IDS (0-100) over a 12-year window is associated with its initial log level with a total slope of -0.0287 (SE 0.00171), statistically significant at the 1% level. The slope is negative — the β-convergence pattern: units that started lower tended to grow faster, narrowing initial gaps. That slope implies a convergence speed of λ = 0.0351 per year and a half-life of about 19.7 years — the time for half of an initial gap to close at this pace.
These are associations, not causal effects. A causal reading needs a research design.