The Gap That Closed: 142 Countries, 55 Years, One Chart

A full Gapminder analysis — turn the most famous scatter in statistics into 142 connected trajectories and watch the development gap close. No code, no animation.

Dataset: gapminder — 142 countries measured every five years from 1952 to 2007 (country, continent, year, life expectancy, population, income per person), 1,704 rows. Download the file and follow along in Stratum — every figure below is a real screenshot from it.

A scatter plot is a freeze-frame. It shows you two variables at one instant and tells you nothing about motion. The most famous scatter in all of statistics — a country's income against how long its people live — is almost always shown that way: one year, one cloud of dots, one tidy upward curve. Hans Rosling made it unforgettable by animating it, bouncing the bubbles through the decades.

You don't need the animation. With the gapminder dataset you can recover the entire development story from static charts — if you give the dots their history back. This is how, in about twenty minutes and without a line of code.

Step 1 — Look before you model (and earn the log axis)

Income per person is savagely right-skewed: a wall of poor countries and a long tail of rich ones, skewness ≈ 3.85. A single derived column — log(gdpPercap) — pulls it into a near-symmetric bell (skew ≈ 0.11).

Histogram of income per person, heavily right-skewed
Raw income per person: a hard right skew (skew ≈ 3.85) — a wall of poor countries, a long rich tail.

That transform isn't cosmetic: income runs from $241 to $113,523 a year — 2.67 orders of magnitude. On a spread that wide a log axis is honest work. (It's worth being deliberate here — on sub-decade data a log axis looks identical to a linear one, a trap worth knowing. This data spans nearly three decades, so the log scale genuinely straightens the fan.)

Step 2 — The snapshot everyone quotes

Filter to 2007, plot life expectancy against income on a log-income axis, and the fog snaps into a line: richer countries live longer, and on log-income the climb is almost straight. Drop a logarithmic trend on it and read the fit.

2007 scatter of life expectancy vs log income with a logarithmic trend
2007, log-income axis: life expectancy vs income correlates at 0.81 (R² ≈ 0.65). Two-thirds of the lifespan gap, in one number.

True — and only one frame of a movie. It tells you where every country is in 2007, and nothing about how it got there or where it's headed. To see that, we have to give the dots their history back.

Step 3 — Connect the dots

Put all twelve years back on the chart and turn on Connect Points, ordered by year. Each country's dots join — in time order — into a trajectory. Now you can read direction.

Connected-scatter trajectories of China and South Korea climbing from 1952 to 2007
Connect Points, ordered by year: China and South Korea, 1952 → 2007. The cloud becomes a path you can read.
  • China: from $400 / 44 years in 1952 to $4,959 / 73 years in 2007. Income ×12, +29 years of life — one continuous climb up and to the right.
  • South Korea: steeper still — income up more than 20-fold to $23,348, life expectancy 47.5 → 78.6.

Same bottom-left starting corner, a completely different altitude by the end. One toggle turned a scatter plot into a story.

Step 4 — The whole world, a decade at a time

Two countries is an anecdote. Facet the same chart into small multiples by year and read the panels left to right — a time-lapse with no animation at all.

Small multiples of the income-vs-life-expectancy scatter, one panel per five-year step
One panel per five-year step. In 1952 the world is split in two; by 2007 the clumps have merged into one continuous band.

In 1952 the world is split in two — a poor, short-lived clump and a small rich, long-lived cluster, a visible gap between them. Sweep across the decades and the two clumps drift together; the gap fills in; by 2007 there is one continuous band up the diagonal. The "two worlds" didn't diverge. They merged.

You can put a number on the closing: the life-expectancy floor rose from 28.8 years (1952) to 39.6 (2007), the whole distribution shifted up ~18 years, and in relative terms the spread shrank about a third (coefficient of variation 0.25 → 0.18). What didn't close is a hard tail of countries left behind while everyone else climbed — a tail we connect, and explain, in Step 6.

Step 5 — Every continent went up

A Trend of mean life expectancy by year, split by continent, makes it quantitative. Every line rises.

Trend of mean life expectancy per continent, 1952 to 2007, five rising lines
Mean life expectancy by continent, 1952 → 2007. Every line climbs; watch Africa flatten in the late 1990s.
Continent19522007
Africa39.154.8
Asia46.370.7
Americas53.373.6
Europe64.477.6
Oceania69.380.7

Globally, mean life expectancy climbed 49.1 → 67.0 years (population-weighted, 48.9 → 68.9). Look closely and Africa's line stalls in the late 1990s while the others keep climbing — a clue we cash in next.

Step 6 — The lines that bend back

Every trajectory so far went up. The revealing ones don't — and this is where a connected scatter earns its keep, because a reversal is invisible in a cloud and unmistakable in a line. Connect a few southern- and central-African countries and watch them bend.

Connected trajectories of Rwanda, Zimbabwe and Botswana bending backward
Trajectories that bend back: Rwanda's vertical crash-and-rebound, Zimbabwe's slide, Botswana's rich-but-dying-younger turn.
  • Rwanda: climbs for forty years, then falls off a cliff — life expectancy 46 → 23.6 in 1992 (the genocide, drawn as a vertical drop) — then climbs all the way back to 46 by 2007.
  • Zimbabwe: slides down and to the left, life 48.5 → 43.5, income falling with it.
  • Botswana: income rockets 15-fold to over $12,570 — a success by the money — yet its life-expectancy line peaks and bends back down to 50.7. Rich and dying younger: the HIV/AIDS epidemic, which no income axis alone would ever reveal.

The wealth kept rising while the health turned over. You only see it because the line remembers where it's been. A static cloud hides direction; the connected line shows it.

Step 7 — How tight is it, really?

Across all 1,704 rows, life expectancy on log-income gives r = 0.81, R² = 0.65. Money explains about two-thirds of lifespan — strong, but not destiny.

Regression of life expectancy on log income, with residual outliers highlighted
Life expectancy vs log-income across all years: a strong fit (R² ≈ 0.65) — but the residuals name the exceptions.

The other third is medicine, public health, war and policy — and it lives in the residuals. Fit the line for 2007 and sort by who falls farthest below it — dying young for their income:

  • Swaziland (−25.9 years vs predicted), Angola (−23.3), Botswana (−22.2), South Africa (−21.4), Equatorial Guinea (−21.1), Gabon (−16.6).

Two clusters wearing one mask: the HIV-devastated south, and the oil economies (Angola, Equatorial Guinea, Gabon) where $12–13k-a-head income never became health. Now flip it — long life on a modest income:

  • Vietnam (+13.1 years, on $2,442), Nicaragua (+10.9), Comoros (+10.5), Costa Rica and Cuba (both +7.8, near 79 years on a fraction of U.S. wealth).

These are the public-health overperformers — clinics, vaccines and clean water instead of GDP. The fit gives you the rule; these two lists — who beat it and who squandered it — carry the story the average can't.

Step 8 — Continents, tested

Are the continents genuinely different, or are our eyes just grouping colors? A one-way ANOVA of 2007 life expectancy by continent answers it: F(4, 137) = 59.7, p ≈ 0, η² = 0.635.

One-way ANOVA of 2007 life expectancy by continent in Stratum
One-way ANOVA, 2007 life expectancy by continent: F(4,137)=59.7, η²≈0.64 — geography still stratifies lifespan, hard.

Continent alone accounts for about 64% of the 2007 spread. These aren't arbitrary color groups; the between-continent differences are real and large — even at the end of fifty-five years of convergence.

What we actually did

Distributions, a log transform, a snapshot scatter, connected trajectories, small multiples, a trend, a regression and an ANOVA — eight lenses on one dataset, no code, no animation — to turn a single famous curve into the real development story: the world got richer and healthier together, the two-worlds gap closed, and the exceptions that bent backward are the whole point. 140 of 142 countries ended 2007 healthier than they began — only Swaziland and Zimbabwe did not.

Exported PDF report of the Gapminder analysis
One click exports the whole analysis — ANOVA, regression and the trajectory chart — to a PDF report.

That's the difference between a chart and an analysis.

The dataset is free and so is the trial. Download Stratum, load the gapminder file, and connect a country of your own — see which way its line bends.
case-study connected-scatter time-series gapminder anova