Skip to content

Tag: manifesto project

Visualizing left-right government positions

How does the political landscape of Europe change over time? One way to approach this question is to map the socio-economic left-right positions of the governments in power. So let’s plot the changing ideological  positions of the governments using data from the Manifesto project! As you will see below, this proved to be a more challenging task than I imagined, but the preliminary results are worth sharing nonetheless. First, we need to extract the left-right positions from the Manifesto dataset. Using the function described here, this is straightforward: lr2000<-manifesto.position(‘rile’, start=2000, end=2000) This compiles the (weighted) cabinet positions for the European countries for the year 2000. Next, let’s generate a static map. We can use the new package rworldmap for this purpose. Let’s also build a custom palette that maps colors to left-right values. Since in Europe red traditionally is the color of the political left (the socialists), the palette ranges from dark red to gray to dark blue (for the right-wing governments). library (rworldmap) op <- palette(c(‘red4′,’red3′,’red2′,’red1′,’grey’,’blue1′, ‘blue2′,’blue3’, ‘blue4’)) After recoding the name of the UK, we are ready to bind our data and plot the map. You can save the map as a png file. library(car) lr2000$State<-recode(lr$State, “‘Great Britain’=’United Kingdom'”) lrmapdata <- joinCountryData2Map( lr2000,joinCode = “NAME”, nameJoinColumn = “State”, mapResolution=’medium’) par(mai=c(0,0,0.2,0),xaxs=”i”,yaxs=”i”) png(file=’LR2000map.png’, width=640,height=480) mapCountryData( lrmapdata, nameColumnToPlot=”position”,colourPalette=op, xlim=c(-9,31), ylim=c(36,68), mapTitle=’2000′, aspect=1.25,addLegend=T ) dev.off() The limits on on the x- and y-axes center the map on Europe. It is a process of trial and error till you get it right, and…

Compiling government positions from the Manifesto Project data with R

****N.B. I have updated the functions in February 2019 to makes use of the latest Manifesto data. See for details here.*** The Manifesto Project (former Manifesto Research Group, Comparative Manifestos Project) has assembled a database of ‘quantitative content analyses of parties’ election programs from more than 50 countries covering all free, democratic elections since 1945’ and is freely accessible online. The data, however, is available only at the party, and not at the government (cabinet) level. In order to automate  the process of extracting government positions from the Manifesto data, I wrote a simple R function which combines the party-level Manifesto data with the data on government compositions from the ParlGov database. The function manifesto.position() produces a data frame with the country, the time period, the government position of interest, and an index (id) variable. You can get the data either at a monthly or yearly period of aggregation, specify the start and the end dates, and get the data in ‘long’ or ‘wide’ format. Here is how it works: First, you would need R up and running (with the ‘ggplot2‘ library installed). Second, you need the original data on party positions and on government compositions, and this script to merge them. Alternatively, you can download (or source) directly the resulting merged dataset here. Third, you need to source the file containing the functions. Here are a few examples of the function in action: #### ### 1. Load the data file from the working directory or from the URL (default)…