Return to site

Mapping Scottish Twitter

Lawrie Scott-McFarlane

You might have seen our Scottish political Twitter map, which now also includes static version for mobile users. We’ve received quite a lot of correspondence on these so I thought I’d outline how they were made and what they represent in more detail.

The initial idea for the graphs came after looking into similar projects in the US covering the Twitter accounts of politicians and media outlets. The American graphs were heavily polarised along Democrat/Republican lines. I thought it would be interesting to see what the situation in Scotland looked like, particularly given the widespread adoption of social media during the referendum campaign and the fractious nature of much of the online discourse. Additionally, we already maintain information on Scottish election candidates, councillors, MSPs and MPs. This meant there was a set of up-to-date Twitter accounts which could form the basis of the graph. It also meant there was no need to manually input additional information on names and party affiliations, which cannot always be reliably sourced from Twitter alone.

Twitter accounts are represented on the graph as ‘nodes’ which are linked together with ‘edges’ based on whether they follow each other.  An algorithm is used to determine the placement of each node based on its connections to the others. This causes clusters of nodes to form in cases where they are connected, as well as causing nodes which are not connected to separate out. Each node is coloured by formal party affiliation and sized by total number of followers, with diminishing returns in cases where an account has a large number of followers.

This process produces results that make intuitive sense, both in terms of the party groups and the arrangement of commentators. There is a perceptible left/right division in some places, particularly within Labour, as well as a clear digital media cluster. There is also a clear constitutional divide.

However, it’s important not to draw too many conclusions from the results. The algorithm itself is dependent on randomised starting conditions and will not produce the exact same layout each time it is run. For example, both the Conservatives and Lib Dems can end up on the same side of the graph as RISE and the Greens. Interestingly, this happens much more often with the Lib Dems and RISE itself is almost never separate from the Greens. Despite the randomness, the formation of the party clusters themselves and positioning of commentators relative to them is consistent.

A further caveat is the fact that the accounts included on the graph represent a small and politically engaged group. The graph contains just over 1000 nodes. For some accounts, like newsdirect, this represents a substantial portion of their overall following. For others, like the Prime Minister or The Guardian, the map is a tiny sliver of their total following. Furthermore, each connection is equally weighted. Angry Salmond exerts just as much influence as Alex Salmond. Information about interactions over time is not factored in, so followers who never interact will be just as strongly connected as those who constantly tweet at each other.

It’s worth remarking on the choice of accounts, particularly in relation to commentators and bloggers. I aimed to be as balanced as possible with the choices as well as including high-profile or otherwise interesting accounts. Currently, a full import of account data takes around 17 hours due to Twitter limiting the rate at which it can be accessed. There are also performance issues associated with increasing the size of the graph. A potentially huge range of think tanks, PR firms, single-issue campaign groups and public bodies as well as additional commentators and journalists have been omitted for these reasons.

The Twitter data itself was imported using a piece of software called NodeXL. Another programme, Gephi, was used to construct the graph. An additional plugin from the Oxford Internet Institute allows Gephi to export the graph as an interactive web application. This plugin is still in active development and mobile support isn’t fully implemented. This is why the interactive version of the graph doesn’t currently work for mobile users. The map has since been updated so that it redirects to a static version for these users.

It’s been great to see people’s reaction to the graphs so far. I’ve been gathering data on accounts using the #sp16 hashtag over the last few months and the results should be available soon.

All Posts
×

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!

OKSubscriptions powered by Strikingly