
Image via Wikipedia
These days, a bonanza of political information is freely available on the internet. Sometimes this information comes in the guise of excel sheets, comma separated data or other formats which are more or less readily machine readable. But more often than not, information is presented as tables designed to be read by humans. This is where the gentle art of screen scraping, web scraping or spidering comes in. In the past, I have used kludgy Perl scripts to get electoral results at the district level off sites maintained by the French ministry of the interior or by universities (very interesting if you do not really speak/read French). A slightly more elegant approach might be to use R’s builtin Perl-like capabilities for doing the job, as demonstrated by Simon Jackman. Finally, Python is gaining ground in the political science community, which has some very decent libraries for screen/web scraping – see this elaborate post on Drew Conway’s Zero Intelligence Agents blog. But, let’s face it: I am lazy. I want to spend time analysing the data, not scraping them. And so I was very pleased when I came across outwit, a massive plugin for the firefox browser (Linux, Mac and Windows versions available) that acts as a point-and-click scraper.
Continue reading “Web-scraping made easy: outwit” »
Tags: departements, france, outwit, perl, python, R, scraping, screen, web scraper
Category Data and Methods, Political Science|
In a recent article in the European Journal of Political Research, Kestilä and Söderlund claim (amongst other things) that in the French regional elections of 2004, turnout and district magnitude have significant negative effects o
n the extreme right vote whereas the effects of the number of party lists and unemployment are positive and significant. Most interestingly, immigration (which is usually a very good predictor for the radical right vote) had no effect on the success of the Front National. More generally, they argue that a subnational approach can control for a wider range of factors and provide more reliable results than cross-national analyses (now the most common approach to this phenomenon). My colleague Liz Carter and I disagreed and engaged in a massive replication/re-analysis endeavour. The outcome is a critique of the KS model of subnational political opportunity structures in regional elections. In this paper, we dispute Kestilä’s and Söderlund’s claims on theoretical, conceptual and methodological grounds and demonstrate that their findings are spurious. Today, the European Journal has accepted the article for publication (probably in 2009) 
Technorati-Tags: extreme right, radical right, populist right, far right, france, opportunity structures, unemployment, immigration, district magnitude, regional elections, front national, 2004, voting
Tags: 2004, departements, district magnitude, extreme right, far right, france, front national, immigration, opportunity structures, populist right, radical right, regional elections, subnational, unemployment, voting
Category Article, My Stuff, Political Science|
If you are interested in subnational politics, France is an interesting case for many reasons. On the one hand, the country is highly centralised and divided into 96 (European) Departements (administrative units) with equal legal rights (though Corsica is a bit of an exception to this). In fact, Departements were created after the revolution in an attempt to replace the provinces of the Ancien Regime with something rational and neat. On the other hand, the Departements are vastly different in terms of their size, population, economic, political and social structure, which gives you a lot of variance that can be modelled. Electoral data is often made available at the level of the Departement (see e.g. the useful book by Caramani for historical results and the CDSP and government websites for recent elections) or can be aggregated to that level since electoral districts are nested in Departements. The French National Insitute for Statistics and Economic Studies (INSEE) has a wealth of data from the 1999 census and other sources, and even more is available from Eurostat. One thing that is incredibly annoying, however, is that many sources like Caramani, INSEE and the Wikipedia use the traditional French system. This system (which is part of the ISO standard ISO 3166-1) assigns numbers from 1 to 95 that once reflected the alphabetical order of the Departments’ names, though this initial order was a bit scrambled by territorial changes. The most obvious result of these are the odd 2A/2B codes for Corsica (after 1975, see this article on the French Official Geographic Code for the details). Rather unsurprisingly, Eurostat (and a few others) prefer the European NUTS-3 codes, which have a hierarchical structure that consists of a country (FR), region, and subregion (=Departement) code. If you want to merge Departmental data from various sources you obviously have to map one system to the other, which is cumbersome and prone to error. That’s why I wrote a little script in Perl that reads a table of Departmental Codes and creates a do-File for Stata, which does the actual mapping. From within Stata, you can simply type net from http://www.kai-arzheimer.com/stata to get the whole package. It should be fairly easy to adopt this to your own needs – enjoy!
Technorati Tags: france, subnational, departements, stata, perl, geocodes
Continue reading “Resolved: French Departements, INSEE, ISO and NUTS-3 codes” »
Tags: departements, france, geocodes, perl, stata, subnational
Category Data and Methods, My Stuff, Political Science|