Brexit? Contrasting Opinion on the UK’s EU Referendum

Clare Llewellyn and Laura Cram

As part of the Imagine Europe project, Clare Llewellyn and Laura Cram explain the background of the Twitter demonstrator they have created to track and analyse the discussion on Twitter around the UK’s EU referendum.

Brexit? Contrasting Opinion on the UK’s EU Referendum
EU Flag from the Quirinale, Bob, CC-BY-2.0

As part of our research, we have produced a demo that visualises the Twittersphere debate on whether the UK should remain in or leave the European Union. We are tracking the EU referendum debate on Twitter to explore the various ways in which the public imagines the EU. We ask how this relates to the cognitive frames that predominate in the offline public and political dialogue and explore the process through which competing cognitive frames come to predominate in political debate.

Twitter Analysis

Social media is being used to monitor ongoing shifts in public imagining of the European Union at this critical time. Funded by the ESRC’s UK in Changing Europe programme, Twitter is used to track current trends using advanced Twitter analytics, hashtag tracking, sentiment scoring (indicating the rising and falling emotional content of tweets) and trend analysis in response to emerging events.


We are working with a Twitter dataset to explore the relationship between the UK and the EU and how people talk about this relationship. We are using Twitter to find out what people are saying and to investigate how this changes leading up to the referendum on the UK’s membership. We have collected over 6 million tweets on the EU referendum debate from the Twitter API since August 2015. This data has been gathered using three search strategies:

  1. Tweets collected that contain a set of UK-EU referendum-specific hashtags as specified by a group of experts.
  1. Relevant tweets extracted from the public full stream API. This involves collecting the full stream then using two common used terms ‘brexit’ and ‘euref’ as search terms to gather a specific set from the full stream set. This extracted set is analysed and the top 100 unigram, bigram and trigram terms identified. From this, the terms that are relevant to the topic are used as search terms to widen the set.
  1. Tweets collected from specific users – the Twitter accounts from the official campaign groups @StrongerIn, @LeaveEUOfficial and @vote_leave.

We have been examining how topics and language differ between these groups and how they influence and cross-pollinate each other. The specific hypotheses we are exploring with this demonstrator are whether:

  1. The different datasets contain discussion on the same topics and can be used as proxies for each other.
  1. The official campaign groups direct the discussion. If this group was directing discussion we would notice this through an ‘echo chamber’ effect, where discussion topics from the official campaign groups permeate, over time, to the other datasets and are echoed back.

We are using hashtag frequency to illustrate topics discussed. The different datasets are compared through a visualisation of the top 20 hashtags both overall and day-by-day.

We can see from the visualisations that the different datasets do not contain the same hashtags in similar proportions and cannot therefore be used as proxies for each other. It is important to collect all three data sets to get a better view of the ongoing discussion.

The stream and hashtag sets are heavily influenced by the terms used for data collection. Those terms differ greatly when automatically extracted (the stream set) or chosen by experts (the hashtag set). The automatic method is most similar to the official set and is designed to be very specific to the topic. The expert method is designed to follow a wider variety of terms that the experts expect will become discussion topics over the longer-term referendum debate.

The day-by-day visualisation show that tweets from the official set generally coincide with tweets in the stream sets of the same day, suggesting that the official campaigns are not influencing but simply reflecting the wider debate. A future direction for this work is to investigate if this can be seen within a smaller time frame, such as hour-by-hour. In addition to this, we will use the demonstrator to investigate specific terms and multi-word terms to track within all three datasets to analyse how discussion is directed.

Our #ImagineEurope project is part of the Economic and Social Research Council’s The UK in a Changing Europe programme. Look out for our regular updates as the project tracks developments in the debate on the UK’s membership of the EU and follow us on Twitter @myimageoftheEU for more information on this and other projects.

Laura Cram is Senior Fellow, The UK in a Changing Europe, investigating The European Union in the Public Imagination: Maximising the Impact of Transdisciplinary Insights (ESRC/ES/N003985/1).

This article was originally published on the ImagineEurope Storify.

Clare LlewellynClare Llewellyn
University of Edinburgh

Clare Llewellyn is PhD Candidate in Informatics and Research Fellow in the Neuropolitics Research Lab at the University of Edinburgh. Her research focuses on user-generated content on the Internet. Her research interests include social media, big data and text and data analytics.

Laura CramEdinburgh Europa Institute LogoLaura Cram
University of Edinburgh

Prof Laura Cram is Professor of European Politics at the University of Edinburgh; Senior Fellow, The UK in a Changing Europe; and Academic Editor of European Futures. Her research areas include European public policy, European identity and the neuropolitics of public policy and identity.

Shortlink: | Republication guidance

Please note that this article represents the view of the author(s) alone and not European Futures, the Edinburgh Europa Institute or the University of Edinburgh.

Creative Commons License This article is published under a Creative Commons (Attribution-NonCommercial-NoDerivatives 4.0 International) License.