I got hold of some raw figures on the referendum results from the Electoral Commission website and decided to test them against other publicly available datasets on the British population.
It's no secret that the issue of immigration played a large part in encouraging people to vote Leave. One claim that Leavers might put forward is that this amounted to a rational decision on their part. People were concerned about the effects of immigration on their economic security and on the public services. This point of view sounds like it might have some validity to it. But what does the evidence say?
The graph below plots the strength of the Leave vote against the percentage of immigrants (defined as current UK residents who were born in a foreign country) in each local authority area. If Leave voters were responding to negative effects of immigration in their own communities, we should see the points forming roughly a diagonal line from the bottom left of the graph (few immigrants, few Leave voters) to the top right.
We clearly haven't found the relationship that we were looking for. It is likely that some Leave voters were indeed influenced by their own adverse experiences of immigration, but the data suggests that this did not hold good as a general rule. Many Leave voters may have been voting against immigration, but it looks like to a large extent this was an issue that they experienced through the media rather than at grassroots level in their own communities.
What about economic deprivation? People like myself who incline to the political left might be sympathetic to an economic explanation for Brexit, based on the idea that people who have lost out materially in recent times have given in to the temptation to blame their problems on foreigners. After all, it's one of the oldest tricks in the book for nationalist demagogues like Nigel Farage to make political capital out of hard economic times.
There is no simple way to measure levels of deprivation, but one widely used metric is the proportion of children who are on free school meals (as these are essentially restricted to families who are in receipt of certain welfare benefits). The graph below plots the Leave vote against this measure. Again, the hypothesis would lead us to expect a diagonal line going from the bottom left to the top right.
Again, not a very promising result. There is some correlation - you could draw a diagonal line of best fit in the 40-70% Leave range - but the graph is too messy to allow us to draw a clear link between Leave and economic deprivation. (There is also other statistical evidence that anti-immigration sentiment tends to be roughly the same across social classes: it tends to be slightly higher in less affluent groups, but not by much: see the graph in section 4 of this article.)
Alright, what about broader cultural factors? Perhaps general social conservatism influenced people to vote for what appeared to be the patriotic option (or, less generously, the stop-the-world-I-want-to-get-off option).
Like poverty, conservatism is difficult to measure. But one fairly reliable metric is the level of religiosity. It is a sad fact that the evidence suggests that religious affiliation in the UK tends to correlate with support for conservative parties and policies.
The graph below plots the Leave vote against the level of people who expressly declared in the 2011 census that they had no religion. If the present hypothesis is correct, a high Leave vote should correlate with low levels of godlessness.
There may be a very slight correlation here, but it is only a slight one.
Another possible index of conservatism is age. You'd think that older people would be more likely to vote in favour of backward-looking policies - particularly in the case of the EU, as voters in their 50s and above would be able to remember a time before Britain joined the European project and would be less inclined to fear returning to that position.
Data on age is hard to come by, but the figures that I could find didn't tend to back up this hypothesis - save that the one outlying point, London, was both unusually young and unusually pro-Remain.
One final dataset. This one relates to population density (and it excludes data from London and the Celtic nations). Were people in rural areas more likely to vote Leave than people in urban areas?
The overall message that I take from this exercise is that the most obvious potential explanations for supporting Leave aren't really borne out by the data. Is, then, a tendency to support nationalist policies a standalone "thing" which doesn't necessarily correlate with anything else? In that case, why did the voters opt for Yes by a huge majority in 1975, at a time when nationalist (and indeed overtly racist) sentiments were even more prevalent than they are today?
You tell me, and then we'll both know.