Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
One of my Christmas presents was the book Beautiful Visualization. Chapter 8 by Andrew Odewahn is a very nice piece on visualizing the U.S Senate social graph. Odewahn basically builds an affinity network, where ties represent whether two senator have voted in the same manner during a given time period. The rules for creating the network are nicely broken down to the following steps:
- Nodes represent senators
- Nodes are colored according to party affiliation
- Nodes are connected with an edge if two senators voted together more than 65% of the time during a given timeframe
Based on the above rules Odewahn builds a series of interesting graphs, showing that there are a few consistently bipartisan senators on both sides in almost every session of the Congress.
This got me thinking, Danish parliamentary business is usually described as being very consensual with broad coalitions dominating. If this is indeed the case, then we should expect to see that the rules laid down by Odewahn would create one big graph component, with perhaps a few other components that represent rebels in the parliament. Since I have data on the voting behavior of the Danish parliament covering 2004 to 2011, I decided it would be interesting to see how the social graph for the Danish parliament would look like. In order to do this I followed Odewahn and created an edgelist for every year. The procedure was as follows:
- Subset the data to only include votes in the given year
- For each member of parliament determine the acts on which that parliamentarian voted
- Compare that parliamentarian to all other parliamentarians that also voted on the same acts
- If two parliamentarians voted together on more than 65% of the votes, they are entered into a list recording them as sharing a tie
I tried to do this first in R, but my script was hopelessly slow, so I wrote a small python script that implanted the above procedure. The script takes a given subset of the data (or all of it) and returns an edgelist with the recorded ties.
In order to understand the results, one must know how parties are located in relation to each in the Danish Parliament. In the figure below I have used the expert survey from Benoit and Laver, to show the placement of parties on a left-right scale. The dots are scaled according to the vote share in the 2001 election, and the lines show 95% confidence interval.
There is a clear left-right dimension in Danish politics, with two large parties on either side of the mean position. This is also, in my experience, used to frame much of the political debate. The two parties, V and KF, form the government with DF as a supporting party.
The figures below show the graphs for every year, but only for final votes on a legislative act.
On the final votes we typically see that there are one big cluster which consist of MPs from all of the parties in the Danish, and in some years a smaller cluster which, although disconnected from the first, also has a mix of most parties. Finally we see that there are always a couple of dyads and triads of members that do not vote in a similar pattern to the rest of the parliament. This is consistent with the typical view of Danish politics.
If we examine the voting behavior on amendments to legislative acts, i.e. everything but the final vote, the picture is very different. Here we see a very strong partisan structure with several disconnected components. Each component consists of either a single party or parties that either oppose or support the sitting government. Thus on amendments, we see a strong government/opposition structure.
As with the last post on the Danish Parliament, there is a strange dynamic where the political fighting takes place on amendments to legislative acts, but on the final votes most parties come together and support the final outcome.
P.S: To reproduce the network graphs download this .zip file, set the directory in the createGraphs.r file and run it. It will create three subdirectories in the working directory with the different graphs.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.