Twitter and the independence referendum 3

In the first of a series of visualisation snapshots, using data from twitter, we constructed a network graph showing the connections between users and hashtags for tweets about the independence referendum.

This snapshot covers one week (13th-19th December) including c.13,000 connections[1]. One observation based on the data is that the Yes campaign has a wider network of active tweeters spreading their campaign message than Better Together. Another interesting aspect of the data is that it shows the spread of ‘conversations’ through twitter about the referendum between users that are not channeled through the official campaigns. As the network graph shows data from a single week, not too much more can be drawn from it at this stage. However we will be looking in detail at traffic covering the period between the launch of the white paper and the date of the referendum,  mining this substantial data set using analytic techniques.

We felt it appropriate to make a one week snapshot available in an interactive form on the internet to give people an idea how social media is being used in the referendum debate and to get an impression based on traffic flows. Over the coming period we will publish further snapshots on our website, roughly one week per month so that people can see for themselves how patterns are changing. Instructions for exploring the network interactively can be found below.

By making the network graph available in an interactive form we hope people will explore it for themselves. if you spot interesting patterns please share them with us by commenting below or contact us via twitter @PolicyScotland.

The raw data were collected using the Twitter API by searching for tweets that included #indyref for the given time period. At this early stage we were interested in unique messages that connected different nodes, and therefore retweets (echoing other users messages) were removed from the dataset. The network was then constructed by creating records for each connection, where a connection represents a tweet by a user (the source) that mentions another user or hashtag (the target). Multiple mentions within one tweet are extracted into separate records.

The data’s visualisation was achieved using the open-source software Gephi (GNU GPL v3) and the GEXF-JS Web Viewer an open-source plugin for Gephi released under the MIT License.

Exploring the interactive network graph:
The interactive network graph can be found here[2].

  • Users and hashtags are circular nodes in the graph.
  • Connections (mentions) are the lines between nodes.
  • Nodes are colour coded by degree (the number of connections) on a red blue scale. Red nodes have less connections, blue nodes have more, beige nodes fall in the middle of scale.
  • Connections are also colour coded. They are coloured the same colour as the target node.The thickness of connecting lines is weighted by the number of repeat connections.
  • The search function at the top of the graph allows you to search for nodes by name.
  • When a node is selected the sidebar shows a list of inbound and outbound links. This indicates whether the node was the target (inbound) or the source (outbound) for the connection with the node listed.

[1] Our interactive graph only provides access to a slimmed down version of the full graph so that patterns among more active nodes can be seen more clearly.
[2] Currently the visualisation works with Chrome, Firefox and Safari. It may not work using Internet Explorer.

image credit:

Leave a comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

3 thoughts on “Twitter and the independence referendum

  • William Blair

    Interesting data and hopefully we can see continuing unbiased referendum associated research coming from this group rather than the guff being provided by our national broadcaster.

  • Doug Hagar

    Nice visualization! I’m just wondering if the database of tweets that you assembled included only tweets from the hasthag #indyref or did you include tweets from any other specific hashtags or users?

    • Michael Comerford Post author

      Thanks. This visualisation only includes tweets with the #indyref, in latter pieces we’ve also used website content to contextualise the #indyref tweets. Also for some small examples, e.g. particular news stories, we’ve taken the #indyref tweets and other tweets sent in reply that don’t contain the hashtag.