Apr 262012

For our piece on distance effects in English elections we geocoded the addresses of hundreds of candidates. For the un-initiated: Geocoding is the fine art of converting addresses into geographical coordinates (longitude and latitude). Thanks to Google and some other providers like OpenStreeMap, this is now a relatively painless process. But when one needs more than a few addresses geocoded, one does not rely on pointing-and-clicking. One needs an API, i.e. a software library that makes the service accessible through R, Python or some other programming language.

The upside is that I learned a bit about the wonders of Python in general and the charms of geopy in particular. The downside is that writing a simple script that takes a number of strings from a Stata file, converts them into coordinates and gets them back into Stata took longer than I ever thought possible. Just now, I’ve learned about a possible shortcut (via the excellent data monkey blog): geocode is a user-written Stata command that takes a variable containing address strings and returns two new variables containing the latitude/longitude information. Now that would have been a bit of a time-saver. You can install geocode by typing

net from http://www.stata-journal.com/software/sj11-1
net install dm0053

There is, however, one potential drawback: Google limits the number of free queries per day (and possibly per minute). Via Python, you can easily stagger your requests, and you can also use an API key that is supposed to give you a bigger quota. Geocoding a large number of addresses from Stata in one go, on the other hand, will probably result in an equally large number of parsing errors.

Apr 212012

I’m more and more intrigued by the potential spatial data hold for political science. Once you begin to think about it, concepts like proximity and clustering are basic building blocks  for explaining social phenomena. Even better, since the idea of open data has gone mainstream, more and more spatially referenced information becomes available, and when it comes to free, open source software, we are spoilt for choice or, at least in my case, up and beyond the point of utter confusion.

For our paper on the effect of spatial distance between candidates and their prospective voters,  we needed  a choropleth map of English Westminster constituencies that shows how many of the mainstream candidates live within the constituency’s boundaries. Basically, we had three options (not counting the rather few user-contributed packages for Stata): GRASS, a motley collection of Python packages, and a host of libraries for R.

GRASS is a full-blown open source GIS, whose user interface is perfect for keyboard aficionados and brings back happy memories of the 1980s. While GRASS can do amazing things with raster and vector maps, it is suboptimal for dealing with rectangular data. In the end, we used only its underrated cartographic ps.map module, which reliably creates high-resolution postscript maps.

Python has huge potential for social scientists, both in its own right and as a kind of glue that binds various programs together. In principle, a lot of GIS-related tasks could be done with Python alone. We used the very useful geopy toolboxfor converting UK postcodes to LatLong co-ordinates, with a few lines of code and a little help from Google.

Candidate locations by constituency

The real treasure trove, however, is R. The quality of packages for spatial analysis is amazing, and their scope is a little overwhelming. Applied Spatial Data Analysis with R by Roger Bivand, who wrote much of the relevant code, provides much-needed guidance.

Counting the number of mainstream candidates living in a constituency is a point-in-polygon problem: each candidate is a co-ordinate enclosed by a constituency boundary. Function overlay from package sp carries out the relevant operation. Once I had it located, I was seriously tempted to loop over constituencies and candidates. Just in time, I remembered the R mantra of vectorisation. Provided that points (candidates) and polygons (constituencies) have been transformed to the same projection, all that is needed is this:

mymap@data$homeconst1 <-overlay(candpos1,mymap)
mymap@data$homeconst2 <-overlay(candpos2,mymap)
mymap@data$homeconst3 <-overlay(candpos3,mymap)

This works because candpos1 is a vector of points that represent the spatial positions of all Labour candidates. These are tested against all constituency boundaries. The result is another vector of indices, i.e. sequence numbers of the constituencies the candidates are living in. Put differently, overlay takes a list of points and a bunch of polygons and returns a list that maps the former to the latter. With a bit of boolean logic, a vector of zeros (candidate outside constituency) and ones (candidate living in their constituency) ensues. Summing up the respective vectors for Labour, Tories, and LibDems then gives the required count that can be mapped. Result!

Apr 202012

It’s silly season all over again: On the eve of this year’s ‘German Islam Conference’, Volker Kauder, head of  the Christian Democrats in parliament and one of Merkel’s key alleys,  declared that ‘Islam is not part of our tradition and identity in Germany and so does not belong in Germany.’ As an aside, he added that Muslims do belong to Germany and enjoy their full rights as citizens. Phew! His original statement is here, and here is a translation of Kauder’s remarks.

The ‘German Islam Conference’ is a series of consultations between representatives of the federal government, regional governments and local councils on the one hand, and members of various Muslim organisations on the other. It was initiated in 2006 by Wolfgang Schäubele, then responsible for Home Affairs. While the conference has been called anything from a paper tiger to a farce, it is a high-profile affair, a symbol of Germany coming to terms with the realities of migration from Turkey and the Maghreb after a mere 50 years.

The timing of Kauder’s remarks is no coincidence, obviously. One year ago, Schäubele’s successor Friedrich made a very similar statement just before the conference. Apparently, the right wing of the Christian Democrats feels the urge to ascertain its position. After all, the CD parties have become a remarkably broad church, what with a divorced woman leading the party, a pension and works minister who supports gender quotas and introduced a large scale program to support state-run nurseries and a (now disgraced) president whose single political program was the integration of Muslim migrants into the larger German society.

There is much to be said about Kauder’s remarks, and most has been said already over the last 48 hours. Like Friedrich a  year ago, Kauder claims that he did not want to offend anyone and was only talking about historical realities, but he is clever enough to realise that there is a difference between an academic debate and a political argument. Even as a historical statement, his claim is dubious at best as a sizable Muslim population has been around for decades, the Christian churches are in decline and notions of identity are contested. And by the way, religious freedom is a universal human right that is not limited to those Muslims who hold German passports (half the Muslims in Germany do not as a result of the still rather restrictive laws on citizenship).

The real blunder is party political, however. As a secular and occasionally radical  republican, I may happily support the  idea of separating human beings from their cultural-religious identities. But for Christian Democrats, this is denouncing their own political business model. Moreover, the Christian Democrats have fared fairly well with their broad church approach. While their support is a far cry from the 40+ per cent they could rely on  in the 1970s and 1980s, they have been the strongest political party at the national level for the last five years.

Instead of alienating them, it would seem much wiser to embrace the migrant communities, whose religious and family values chime with the CDU/CSU’s conservatism. On the other hand, upsetting two million voters (and two more million Muslims who might be naturalised eventually) does not sound like a bright idea to me.

Apr 122012

The European Social Survey’s Core Scientific Team (formerly known as the Central Coordination Team) has just announced in the User Bulletin (distributed via email, not yet on the website) that they will remove a cool 27 items from the core questionnaire, and three more from the supplementary questionnaire. The items in question are A3-A7, B21-B22, B32-B33, C7-C14, F6a, F34, F43-F47, F51-F52, F57-F58, F71-F73 (“referring to their round 4 question numbers”).

Now I’m sure you all know your round 4 question numbers by heart, but I don’t, so I looked them up. From round 6 on, we will miss information on use of radio, newspapers, and the internet (both global and politics specific), party membership, support for bans of extremist party, believe in scientific solutions to ecological problems,  worries about crime (six items), support for anti-terror measures, field of highest qualification, ability to borrow money from friends or family, detailed information on partner’s, mother’s and father’s work, and phone ownership/access.


Ye olden days (photo credit: Wikipedia)

From a political science vantage point, use of media and party-political questions are obviously absolutely essential, while respondents’ views on torture and terrorism are interesting at the very least. Sociologists, on the other hand, will worry about the loss of information required for Goldthorpe coding and the fact that they cannot measure fear of crime any longer. For me, the ESS is one of the most important collective resources for social research, and my instinct is to object to any cuts to the questionnaire.

On the other hand, this resource has a  price tag attached to it. Some ten years ago, it was estimated that the fieldwork in the original 16 countries would cost 4.2 million euros per round. In the meantime, both the number of countries and the fees charged by the pollsters have risen considerably. But are the savings from sacrificing these items relevant given that they make up only a fraction of the total questionnaire, that there are considerable fixed costs, and that the total costs of the ESS are still small beer compared to what Europe spends on rocket science, its subsidised industries, or agriculture?

The Core Scientific Team has promised to publish a full report on the cuts by autumn 2013. In the meantime, what are your views on the matter?

Apr 022012

In first-past-the-post systems, voters should prefer local candidates for all sorts of reasons. From a rational choice perspective, you could argue that local candidates should, on average, more similar to their constituency in socio-economic terms and therefore more likely to represent their interests. A more socio-psychological-minded explanation would refer to shared ideological traits, positive stereotypes and collective identities. Or you could argue that local candidates are simply better known and have more opportunities for canvassing. Either way, even your granny knew that local is better when it comes to politics.

Only that she could never prove this assertion, while we can. Almost two years after the event, Political Geographyhas accepted our paper on the effect of (driving) distance between English mainstream candidates and their voters in the 2010 General Election. Controlling for incumbency, socio-economic distance and pre-campaign feeling towards the major parties, we demonstrate that physical distance (derived from candidates’ addresses and the centroid of their prospective voters’ neighbourhood) has a small but politically relevant effect. And yes, this is a brilliant start to this week!

Update: I have moved the preprint to a separate page. You can access the PDF, replication data etc. by clicking on the links below.

    Arzheimer, Kai and Jocelyn Evans. “Geolocation and voting: candidate-voter distance effects on party choice in the 2010 General Election in England.” Political Geography 31.5 (2012): 301–310. doi:10.1016/j.polgeo.2012.04.006
    [BibTeX] [Abstract] [Download PDF] [HTML] [DATA]

    The effect of geographical distance between candidate and voter on vote likelihood in the UK is essentially untested. In systems where constituency representatives vie for local inhabitants’ support in elections, candidates living closer to a voter would be expected to have a greater probability of receiving that individual’s support, other things being equal. In this paper, we present a first test of this concept using constituency data (specifically, notice of poll address data) from the British General Election of 2010 and the British Election Survey, together with geographical data from Ordnance Survey and Royal Mail, to test the hypothesis that candidate distance matters in voters’ choice of candidate. Using a conditional logit model, we find that the distance between voter and candidates from the three main parties (Conservative, Labour and Liberal Democrat) matters in English constituencies, even when controlling for strong predictors of vote-choice, such as party feeling and incumbency advantage.

    author = {Arzheimer, Kai and Evans, Jocelyn},
    title = {Geolocation and voting: candidate-voter distance effects on party choice in the 2010 General Election in England},
    number = {5},
    volume = {31},
    abstract = {The effect of geographical distance between candidate and voter on vote likelihood in the UK is essentially untested. In systems where constituency representatives vie for local inhabitants' support in elections, candidates living closer to a voter would be expected to have a greater probability of receiving that individual's support, other things being equal. In this paper, we present a first test of this concept using constituency data (specifically, notice of poll address data) from the British General Election of 2010 and the British Election Survey, together with geographical data from Ordnance Survey and Royal Mail, to test the hypothesis that candidate distance matters in voters' choice of candidate. Using a conditional logit model, we find that the distance between voter and candidates from the three main parties (Conservative, Labour and Liberal Democrat) matters in English constituencies, even when controlling for strong predictors of vote-choice, such as party feeling and incumbency advantage.},
    journal = {Political Geography},
    year = 2012,
    doi = {10.1016/j.polgeo.2012.04.006},
    pages = {301--310},
    keywords = {uk, gis},
    html = {https://www.kai-arzheimer.com/paper/geolocation-voting-candidate-voter-distance-effects-party-choice-2010-general-election-england},
    data = {http://hdl.handle.net/1902.1/17940},
    url = {https://www.kai-arzheimer.com/arzheimer-evans-geolocation-vote-england.pdf}

Apr 022012

Confused by Civic Platform’s current calamities? Let down by Law and Justice? Perturbed by perm-prone Palikot’s movement (ok, enough of that!)? Ben Stanley, my man in Warsaw, has the answers on his new Polish Party Politics blog.  For starters, he brings us lots of beautiful maps like this, which shows the gap between  pro-enlightenment forces PO (North, West) and the Dark Side  PIS (South, East). Enjoy!
[browsershot url=”http://polishpartypolitics.com/” width=”250″]

Mar 252012

You have to be a German state politics aficionado with a certain local bias to find this mildly interesting, but this week we learned that Kurt Beck, the longest-serving German minister president, is having talks with the select group of people who might succeed him. These talks are obviously confidential, so obviously someone leaked the information to the press.

On a personal level, this brings the number of correct predictions for this year to two (if you relax the definition of the word just a wee bit) , as I wrote in a recent paper that Beck would have to set his house in order rather sooner than later (it’s well hidden in the last part of the piece). I even picked three of the four names that are now circulated in the press. Naturally, the paper is not even in print, so it will be a retrodiction once it comes out.

To be totally honest, this probably brings my total number of correct predictions to two. To paraphrase the granddaddy of Faculty Deans, Albus Dumbledore, they should probably give me a pay rise for that.

Mar 182012

Events in North Rhine-Westphalia are quickly becoming the stuff of legends. The end of the red-green minority government on Wednesday has triggered a series of reshuffles that would make Machiavelli dizzy.

First, Christian Lindner is back. In December, he stepped down from his job as secretary-general of the FPD for no apparent reason, declaring that he would rather dabble in local and state politics. Using latest remote-sensing techniques, political witchdoctors of all persuasions agreed that the prospect of showing up daily at FDP HQ for the foreseeable future (4-6 months) had become too depressing. Now, in one feel swoop, he replaced state party chair Daniel Bahr (who has a daytime job as federal minister for health) and sidelined the listless chair of the state parliamentary group (who is widely held responsible for the political disaster) to become the party’s frontrunner in the upcoming election. And yes, the three men took great care to let the public see that they had bypassed federal party chair Philipp Rösler.

Second, Norbert Röttgen, the reasonably popular federal minister for the environment (CDU) – yes, I combined these last three attributes in a rather unusual way – who was elected chair of the state CDU in November 2010 after winning a ballot amongst party members by the barest of majorities, decided to lead his party’s campaign. He could not have done anything else, but this move puts him and the federal government in a bit of a pickle, as everyone wonders whether he will take up his seat in the state parliament if he cannot become minister president. Not making a credible commitment at the outset will hurt his campaign before it has begun in earnest, so most probably he will have to give up a job he seems to like, and Merkel will lose a minister who was instrumental in selling her U-turn on nuclear energy. Bummer.

Third, Hannelore Kraft has overnight become a possible contender for the chancellor job. That, of course, was floated by her opponents to weaken her campaign, but the idea has gained such momentum over the weekend that she had to explicitly deny any ambitions to stand for chancellorship “before 2017”. Cometh the hour, cometh the woman.

Meanwhile in a rare turn of events, a (very implicit) prediction of mine is coming true. The centre-right Frankfurter Allgemeine Zeitung reports that some law professors who specialise in constitutional law have called into question the legal advice on which the budget plan was declared failed in the second reading. Now, if the FPD had deemed it possible to delay the proceedings for further negotiations, the minority government would most certainly still be in office. In politics, just as in criminology, the most relevant question is usually “cui bono”.

Mar 142012

Much to everybody’s surprise, the minority government in North Rhine-Westphalia collapsed today. Minority governments are a rarity in Germany. The federal constitution, reflecting Germany’s inter-war experience of unstable governments and intense political strife, practically rules them out. Constitutional details at the state level differ but the general assumption is that the government needs the reliable support of a majority of MPs. The increasing fragmentation of the German party system, however, plays havoc with these constitutional patterns.

In 2010, the land election brought about political deadlock in NRW, a state that has roughly the size, population, and GDP of the Netherlands. Neither of the two major parties (SPD and CDU) could form a majority government without at least two of the three minor parties (the Greens, the FDP (liberals), and the Left). Lengthy negotiations to form a Grand coalition or various three party coalitions (CDU/FDP/Greens, SPD/Greens/Left, SPD/Greens/FDP) failed, leading to the eventual constitution of a red-green minority government that proved remarkably stable.

Its unexpected downfall resulted from a legal twist. Today, the state parliament voted on the budget in a second reading. During this session, votes were scheduled for every single chapter of the whole budget. Both FDP and the Left were set to vote against the government, expecting that they could extract concessions from the government before the third and final reading in two weeks time. But yesterday, constitutional lawyers working for the state parliament informed the parties that due to its specific structure, a vote against any chapter would terminate the budgetary process without a third reading. The government, on the other hand, had declared that it could not operate without a constitutional budget and would seek to dissolve parliament.

This left the FDP and the Left with the choice to lose face or risk the loss of parliamentary representation, as they are not doing well in the polls. This afternoon, they chose the latter. Elections will be held in May.

At the moment, we do not know who asked for the legal opinion, whether the advice was controversial, and why the budget was structured in such a peculiar way. The document has been leaked to the press, but has not been published in full.

A telephone poll by Infratest dimap predicts a majority for a new red-green coalition, with the FDP truly and well below the five percent threshold and results for the Left and the Pirate party to close to call. But this is, of course, just the beginning of the campaign.