Follow-up - geometric median centres of population

My post yesterday discussed the mean centres of population of South Africa and its provinces. The mean centre is (relatively) easy to calculate, but it may not be the most useful type of population centre. It is essentially an arithmetic mean, which means that outliers can have a massive effect on the centre. It minimizes the average square of distance from the centre, not the average distance from the centre. The centre that does minimize the average distance is called the geometric median, and it is not quite so simple to calculate, since there is no closed form solution. But it can be done!

Read More

Getting rid of the decimal comma in Ubuntu

At some point in school, we South Africans are told that the official decimal separator is the comma.¹ Most of us then proceed to ignore this—at least in English use²—because it differs from the decimal point used in the rest of the English-speaking world, and thereby creates confusion. Thankfully, the maintainers of the glibc locale data—and thus the number formats used in Linux systems—agree with me on this question, and the South African English locale uses the decimal point.

Read More

Change in parties' share of the vote, 2009 to 2014

I’ve drawn some maps showing the percentage-point change between the 2009 and 2014 elections in the vote share of the major parties (or, in the case of COPE, formerly major parties). Because municipal boundaries have changed a bit, I had to recalculate the 2009 results for the 2014 boundaries, by assigning the voting districts from 2009 to wards from 2014. In the cases where a 2009 VD was spread across multiple 2014 municipalities, I assigned it according to the location of the voting station.

Read More

Map of electrification from 1996 to 2011

New map I drew this weekend: it shows the spread of electrification in South Africa from 1996 to 2011, based on census data. The actual variable measured is “Main source of energy for lighting”. As usual, click for the full-size version.

Read More