Model
Headline model: lifeExp = β₀ + β₁ · log10(gdpPercap) + ε,
fit by ordinary least squares. log10 is used because income is heavily
right-skewed and its effect on lifespan is plausibly multiplicative, not additive —
common practice in the development-economics literature.
A robustness check controlling for survey year (+ β₂·year_centered)
is also computed server-side; see data/findings.json → headline_year_controlled.
The slope on log GDP stays large and significant after adding year, so the relationship is not
purely an artifact of the whole world getting richer and living longer over time together.
What the CI and p-value mean
The 95% confidence interval for the slope is the range of values that would
contain the true slope in 95% of repeated samples drawn the same way, under the model's
assumptions. The p-value is the probability of observing a slope this far
from zero, by chance, if the true slope were exactly zero (the null hypothesis). Small p-values
here reflect the very large sample size (n ≈ 1700) as well as a genuinely strong association.
Client-side recomputation
When you change the continent or year filters, the regression is not looked up
from a table — it is refit in your browser using the closed-form OLS normal equations
(β = (XᵀX)⁻¹Xᵀy) with a t-distribution-based 95% CI and
two-sided p-value, implemented in app.js. This is the same statistical method the
Python analysis uses, just re-derived in JavaScript so the inference for any subset is honest
rather than interpolated.
Dataset
Loading dataset provenance…