Brexit: Why Britain Voted to Leave the European Union. By Harold Clarke, Matthew Goodwin and Paul Whiteley.Cambridge University Press; 256 pages; £15.99 and $19.99.

THERE are many theories about why Britons voted last June to leave the European Union. They include hostility to immigration, dislike of Brussels bureaucrats, worries about sovereignty, an anti-elite mood, the discontent of those left behind by globalisation, a long history of Euroscepticism and a stridently anti-EU press. Yet analysis of hard survey data is rare. The great virtue of “Brexit: Why Britain Voted to Leave the European Union”, by three academics, is that it is based on detailed regression analyses of panel surveys carried out both before and after the vote.

Using data as opposed to hunches yields interesting results, even if many confirm conventional wisdom. One concerns who mostly voted for Brexit. The answer is old people, non-graduates and those from lower social grades. Although members of the UK Independence Party (UKIP), founded to take Britain out, tend to be male, there was no gender bias. Nor were Brexit voters necessarily poor: many were in the home counties and south as well as the less well-off north and east.

A second is the importance of immigration. When David Cameron promised a referendum in his speech at Bloomberg in January 2013, he made no reference to this. Even many Tories who, unlike Mr Cameron, campaigned for Brexit stressed regaining sovereignty, not reducing the numbers coming into the country. But the authors put more credence on the goal of Nigel Farage, UKIP’s then leader: to make people see migration and Europe as the same.

Indeed, a third conclusion is the central role of UKIP and Mr Farage. It was the rise of UKIP, more than his own restive backbenchers, that drove Mr Cameron to offer the referendum. And far from causing damage, splits within the Leave campaign may even have helped. Mr Farage could appeal to those once dismissed by Mr Cameron as “fruitcakes, loonies and closet racists”, while Boris Johnson and Michael Gove, two leading Tory Brexiteers, could win over the more globally minded.

Yet Brexit did not prevail just because Leavers outfought Remainers. More important were what this book calls baked-in views, built up over years of criticism of the EU. When Mr Cameron came back from Brussels in February 2016 to campaign to Remain, his credibility was weakened by his previous attacks. Even armed with dire warnings of the costs of Brexit (so-called “Project Fear”), it proved impossible to persuade voters—partly because many who believed Project Fear consciously decided to give priority to curbing migration. Remainers never tried to make a serious case in favour of immigration.

More controversially, the authors argue that there may turn out not to be large costs from Brexit. They note that, for most countries (including Britain), EU membership has not had much impact: accession to the club has more often than not been followed by slower growth. Yet this is not convincing. Nobody knows what would have happened had the country not joined. And most economists, including those at the impartial Bank of England, reckon that membership has made Britain more competitive, raising growth.

What may be true is that other policy choices matter more than being in the world’s largest trading block. That notion chimes with the different economic performance of EU countries. Broadly, Germany and the Scandinavians have done well, whereas France and the Mediterranean countries have not. On this basis, a post-Brexit Britain could prosper—so long as it follows good pro-growth policies. As an ill-tempered election in June draws near, however, that proviso is worrying.