One Kingdom, Two Nations:

Social Media Analysis of Scottish National Party and UK Independence Party

Justin Chun-ting Ho

University of Edinburgh

Why SNP and UKIP?

  • Both invoked the image of an institutional oppressor
  • Both invoked a version of nationalism
  • Shallow similarities, vastly different on closer examination

Scottish National Party

  • "Democratic Deficit" - Emphasized during the Scottish Independence Referendum (2014), reiterated after the EU Referendum (2016)
  • Liberal Nationalism
  • Depicted as a multicultural and progressive nation

(Ashcroft & Bevir 2018; McGarvey & Stewart 2016; Scottish Government 2013)

UK Independence Party

  • "Take back control" from Brussel.
  • Insular nationalism
  • Migrants as economic and security threats
  • A "negative project" driven by "resentment, frustration, and anger"

(Calhoun 2016; Virdee & McGeever 2017; Hobolt 2017; McGarvey & Stewart 2016)

Research Questions:

1. Are there differences between the sentiment expressed within SNP and UKIP's Facebook posts?

2. Do SNP and UKIP's Facebook posts inspire different emotions?


Why Facebook?

  • Social media has become an important medium for political communication
  • Current discourse studies focus mostly on traditional media, eg newspaper and television
  • Digital trace as data for understanding the interaction between parties and the people

Data Collection

Source: Facebook posts and comments on SNP and UKIP's official page

Time period: 25 May 2015 - 30 April 2017

A total of 2,989 posts (SNP: 1,752; UKIP: 1,237) and
1.2 million comments (SNP: 571k; UKIP: 660k) were collected

All data were collected with Netvizz through the official API in accordance with Facebook's Terms of Service and Data Policy. All of them are public posts (with "Public" audience setting) and no personally identifiable information were collected.

Data Analysis

  1. Keyword Analysis
  2. Sentiment Analysis

Keyword Analysis

Keyword Analysis

What is a Keyword?

“A keyword may be defined as a word which occurs with unusual frequency in a given text.”

“The keyness of a keyword represents the value of log-likelihood or Chi-square statistics

(Scott 1997: 233-45)

Sentiment Analysis

Sentiment Analysis

What is Sentiment Analysis?

Sentiment analysis (aka. opinion mining), is the field of study that analyzes people’s opinions and feelings towards entities.


  • Bing Liu's Sentiment Lexicon
    (Hu & Bing 2004)
  • NRC Emotion Lexicon
    (Mohammad & Turney 2013)


  • The sentiment expressed within UKIP's Facebook posts is more negative than that of SNP
  • UKIP inspired more negative emotions while there is no substantial difference in positive emotions

Thank you very much!

Twitter: @justin_ct_ho
Github: justinchuntingho


  • Ashcroft, R. T. and Bevir, M. 2018. 'Liberal democracy, nationalism and culture: multiculturalism and Scottish independence', Critical Review of International Social and Political Philosophy 21(1): 65–86.
  • Calhoun, C. 2016. 'Brexit Is a Mutiny Against the Cosmopolitan Elite', New Perspectives Quarterly 33(3): 50–8.
  • Hobolt, S. B. 2016. 'The Brexit vote: a divided nation, a divided continent', Journal of European Public Policy 23(9): 1259–77.
  • Hu, M. and Liu, B. 2004. 'Mining and Summarizing Customer Reviews', in Proceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’04, New York, NY, USA: ACM: pp. 168–77.
  • Liu, B. 2015. Sentiment Analysis : Mining Opinions, Sentiments, and Emotions.
  • McGarvey, N. and Stewart, F. 2016. 'European, not British? Scottish Nationalism and the EU Referendum' in Guderian M (ed.), The Future of the UK - Between Internal and External Divisions, Humboldt-Universität zu Berlin, Zentralinstitut Großbritannien - Zentrum: pp. 59–70.
  • Mohammad, S. and Turney, P. D. 2013. 'Crowdsourcing a Word-Emotion Association Lexicon', Computational Intelligence 29(3): 436–65.
  • Scott, M. 1997. 'PC analysis of key words — And key key words', System, Pergamon 25(2): 233–45.
  • Scottish Government. 2013. Scotland’s Future Edinburgh: Scottish Government.
  • Virdee, S. and McGeever, B. 2017. 'Racism, Crisis, Brexit', Ethnic and Racial Studies: 1–18.