A Twitter sentiment analysis of the 2015 Canadian Federal Election
Our goal was to determine the sentiment to which people talked about federal political parties on the social media platform Twitter in the weeks prior to the 2015 Canadian Federal Election. We developed a split plot design model for analysis of Twitter messages (“tweets”) about the election written by Twitter users. Our factor of interest was sentiment in regards to popular political party “hashtags” (a topic indicator used in various social media platforms). Data was collected from Twitter’s Application Programming Interface (API) using statistical program R, which collected 50 tweets for each hashtag at a time. The experiment was replicated 12 times over three weeks prior to the election for a total of 7,200 tweets. Using a word lexicon that attributes scores to words associated with sentiment, we summed the score of each tweet, and tested scores of tweets containing hashtags of interest using an ANOVA test.
Our results suggested that the Liberal Party and New Democratic Party had more positive sentiment than the Conservative Party and the tag for general Canadian politics. The results of the election coincide with our results for the Liberal Party (which won 148 new seats) and the Conservative Party (which lost 60 seats), but positive sentiment for the New Democratic Party did not correspond to seat wins. While we may not yet have the ability to predict an election based on sentiment analysis, it could become a strategic tool in government and election campaigns as online presence and reputation becomes increasingly important.
*Indicates faculty mentor