Tuesday, November 08, 2016

Election Day Data: Twitter Sentiment

Academics and researchers will be looking this Election Day for any data that might indicate to what extent social media can help predict electoral outcomes. Towards this end, I've created my own software that analyzes Twitter sentiment for each presidential candidate.

Here's how it works. Written in Python, it uses the Twitter Streaming API to collect thousands of live tweets per minute about either Hillary Clinton or Donald Trump. The software then pipes all of those tweets through IBM's Artificial Intelligence engine (the Alchemy API) to determine, for each tweet, if the sentiment is Positive, Negative, or Neutral about that candidate.

Take this data only for what it is and avoid reading too much into it. For instance, it may say more about Twitter users than about the political candidates; it also may say more about the quality of IBM's language analysis algorithms than about actual sentiment; and more weaknesses abound.

That said, here's the data...

Of people tweeting about Hillary Clinton on this morning of Election Day, the sentiment is:

  • 19.5% Positive
  • 42.3% Negative
  • 38.3% Neutral
 Notably, that is a wider spread between her positives and negatives than she's had in the past (and not a promising one).


Election Day Data: The Betting Markets

To save some data for posterity, here is what the political betting markets have had to say about today's presidential election.

As of this morning (Election Day)...

(if you're wondering why these numbers add up to more than 100, remember these are betting markets, not percentages.)

For comparison, public polling currently shows Clinton leading Trump by only a 45.5% - 42.2% margin.

Also, here is a a chart illustrating how the betting markets have fluctuated for the two candidates over the past 90 days leading up to the election...

More to come.