County GIS analysis · Presidential election, 9 August 2022

Kenya 2022: A County-by-County GIS Analysis

William Ruto won the presidency by 234,748 votes while carrying only 20 of Kenya's 47 counties. Eight maps show where his margin was built, where turnout rose and fell, and how strongly the vote clusters in space.

Download the report (PDF) 8 pages, A4
Map of Kenya's 47 counties coloured by leading candidate: Ruto (yellow) leads a contiguous belt across the Rift Valley and Mt Kenya plus Marsabit and Isiolo; Odinga (blue) leads the west, Nairobi, the coast and the north-east.
50.50%Ruto's share of valid votes, against 48.84% for Raila Odinga
234,748Ruto's winning margin: 1.65 percentage points of valid votes
64.8%Turnout: 14.32 million of 22.11 million registered voters
20 : 27Counties won, Ruto to Odinga: fewer counties for Ruto, but more votes

About this report

This is a county-level GIS analysis of the 2022 presidential election. Every figure is computed from the raw county counts published by the IEBC and compiled by ELOG: registered voters, votes cast, valid votes and candidate votes.

County totals exclude diaspora and prison votes, so national sums differ slightly from the IEBC's declared figures.

1 · The result

A country split almost exactly in two

Nationally the two front-runners were 1.65 points apart. County by county, the gaps were considerable.

Map of the leading candidate's share of valid votes by county, from pale (52.5–60%) to deep yellow for Ruto and deep blue for Odinga, with near-ties in grey.

Ruto took 7,173,951 votes (50.50%) and Odinga 6,939,203 (48.84%). George Wajackoyah and David Mwaure shared under 0.7%.

The map shades each county by the leading candidate's share. Deep gold marks Ruto's Rift Valley and Mt Kenya base, where shares above 85% were common: 96.9% in Elgeyo-Marakwet and 95.3% in Kericho and Bomet.

Deep blue marks Odinga's Nyanza heartland: 98.9% in Homa Bay, 98.6% in Siaya and 97.5% in Kisumu.

Between the two blocs runs a thin grey line of near-ties, counties within 2.5 points of 50%: Marsabit (51.2% Ruto), Narok (51.7% Odinga), Kajiado (51.4% Odinga) and Lamu (52.2% Odinga).

National result, share of valid votes (county sums)
Bar chart of national vote share: Ruto 50.50%, Odinga 48.84%, Wajackoyah 0.44%, Mwaure 0.22%.

2 · How close

Landslides almost everywhere

Half of Kenya's counties were won by more than 46.8 points. Only 6 were decided by less than 10.

Map of winning margin by county in four bands per candidate (0–10, 10–25, 25–50, 50+ points); most counties fall in the darkest bands.

The median county margin was 46.8 points, and 20 counties gave their winner a lead of more than 50 points. Competitive counties were rare and sat on the edges of the two blocs.

The closest race was Marsabit, where Ruto led by 3,107 votes (2.7 points). Kajiado and Narok, both won by Odinga by under 4 points, lie on the boundary between his southern support and Ruto's Rift Valley base.

Isiolo (Ruto, 9.9 points), Trans Nzoia (6.2) and Lamu (6.6, both Odinga) complete the counties decided by under 10 points.

In votes, the largest prize that was not a landslide was Nairobi City: Odinga won it by 205,620 votes, or 15.3 points. 1.06 million registered Nairobi voters (44.0% of the register) did not vote.

The ten closest counties, by winning margin
Bar chart of the ten closest counties by winning margin: Marsabit 2.7 (Ruto), Kajiado 3.3, Narok 3.6, Trans Nzoia 6.2, Lamu 6.6, Isiolo 9.9 (Ruto), Tana River 10.6, Nairobi City 15.3, Mombasa 17.1, Samburu 19.1.

3 · Where the votes came from

The margin was built in a compact belt

Ruto's lead came from populous counties in the Rift Valley and Mt Kenya that voted as blocs. Land area barely matters in this case.

Circle map: one circle per county sized by votes cast and coloured by winner. Large yellow circles cluster in the central highlands; the largest circle, Nairobi City, is blue.

Each circle is sized by votes cast and coloured by the county winner, so the map shows weight rather than land area. Ruto's large circles cluster around Nakuru, Kiambu and the central highlands. Odinga's are Nairobi City, the Lake Victoria counties, Kakamega and the coast.

Ruto's ten biggest contributors gave him 2.62 million net votes, led by Kiambu (+395,849), Kericho (+303,808) and Meru (+295,267). Odinga's largest were Kisumu (+409,986), Homa Bay (+396,287) and Siaya (+366,772).

Net votes each county added to the leader (top ten each side)
Diverging bar chart of net votes in thousands: Ruto's top ten led by Kiambu (396), Kericho (304) and Meru (295); Odinga's top ten led by Kisumu (410), Homa Bay (396) and Siaya (367).
3,574,609net votes from the counties where Ruto led
3,339,861net votes from the counties where Odinga led
234,748the difference: Ruto's national margin

4 · Turnout

High in the Rift Valley, low on the coast

64.8% of registered voters cast a ballot, but county turnout ranged from 43.8% in Mombasa to 79.9% in Bomet.

Map of turnout by county in purple shades from under 50% to 75% and over; darkest in the Rift Valley, palest on the coast and in the north-east.

28 of 47 counties beat the national rate. The highest turnouts were all in the Rift Valley: Bomet (79.9%), West Pokot (79.5%), Kericho (78.6%), Elgeyo-Marakwet (78.0%) and Narok (77.7%).

The lowest were on the coast and in the north-east: Mombasa (43.8%), Kilifi (49.0%), Garissa and Kwale (54.9%). Nairobi City (56.0%) joined Mombasa as the other big city well below the national line.

Turnout shaped the result: the high-turnout belt was also Ruto's strongest ground, while several of Odinga's populous counties (Mombasa, Kilifi and Nairobi) voted well below average.

Turnout gap: the eight highest and eight lowest counties
Diverging bar chart of turnout relative to the national 64.8%: Bomet +15.1 points, West Pokot +14.7, Kericho +13.8 at the top; Mombasa −21.0, Kilifi −15.8, Garissa and Kwale −9.9 at the bottom.

5 · Who didn't vote

7.8 million registered voters stayed home

More than one in three registered voters did not vote. Half of them lived in just ten counties.

Circle map of registered non-voters by county; Nairobi City's circle is by far the largest, followed by Kiambu, Nakuru and Mombasa.

Turnout rates hide scale. Nairobi City's 56.0% turnout left 1,064,315 registered voters who did not vote: more than the total votes cast in any other county.

Kiambu (444,342), Nakuru (363,842) and Mombasa (361,249) follow. The ten counties with the most non-voters account for 3.87 million, 49.7% of the national total.

Most of the room to raise turnout is in the big urban and peri-urban counties, not in the low-turnout but sparsely populated north.

The ten counties with the most registered non-voters
Bar chart of registered non-voters in thousands: Nairobi City 1,064, Kiambu 444, Nakuru 364, Mombasa 361, Kakamega 335, Kilifi 300, Machakos 274, Meru 261, Bungoma 236, Kisii 230.

6 · Spatial clustering

The vote is regional, not random

Spatial statistics confirm what the maps suggest: neighbouring counties vote alike.

Cluster map of turnout (local Moran's I): high-high clusters across the Rift Valley, low-low clusters along the coast.
Cluster map of Odinga's vote share (local Moran's I): a low-low block across Mt Kenya and the Rift, high-high cores around Homa Bay and Siaya.

Global Moran's I measures how much counties resemble their neighbours. It is 0.43 for turnout and 0.44 for Odinga's share, both significant (p < 0.001, 9,999 permutations). A random pattern would give close to zero (−0.02).

Local Moran's I finds the clusters: high turnout across the Rift Valley, low turnout along the coast, a low-Odinga block of eleven Mt Kenya and Rift counties, and high-Odinga cores in Homa Bay and Siaya.

Two Moran scatterplots, turnout and Odinga share: each county's standardised value against its neighbours' average, with fitted slopes of 0.43 and 0.44.

Data & method

How this analysis was made

Raw county counts in, every derived figure computed, every step reproducible.

Data

County presidential results for 9 August 2022, as compiled by ELOG from official IEBC county results (Form 34B): registered voters, votes cast, valid votes, rejected votes and candidate votes. Only these raw counts are used. Boundaries: geoBoundaries KEN ADM1, 47 counties.

Methods

Maps are drawn in WGS 84 / UTM zone 37S (EPSG:32737). Circle maps are Dorling cartograms: circle area is proportional to the value, and circles are moved apart so they do not overlap. Spatial autocorrelation uses queen contiguity, row-standardised weights and conditional permutation (9,999 draws, p < 0.05).

Definitions

Turnout = votes cast ÷ registered voters. Shares are of valid votes. Margin = winner's share minus runner-up's share, in percentage points. Net votes = Ruto's votes minus Odinga's votes in a county. Non-voters = registered voters minus votes cast.

Tools

Data preparation in Python (GDAL, Shapely). Maps in QGIS, charts in VectorCraft, layout in DesignCraft.

Author

Victor Ng'eno, GIS and Software Engineering Consultant
victor@baruamail.com

Caveats

County totals exclude diaspora and prison votes, so the national margin here (234,748) differs from the IEBC's declared 233,211. Rejected votes were 0.79% nationally, highest in Lamu (1.74%), so they are not mapped.

Download the report (PDF)

Kenya 2022 · A county-by-county GIS analysis · Victor Ng'eno, GIS and Software Engineering Consultant · victor@baruamail.com

← Back to blog