US Presidential Candidates

The US Presidential Candidates app helps you see the overall sentiment towards the top two candidates in the 2016 US election using Twitter statistics from the last 30 days.

This app measures negative and positive words in tweets directed at or mentioning Hillary Clinton and Donald Trump, and the application uses those words to measure the "public sentiment" quotient of each candidate as viewed by social media. public sentiment is measured by dividing the number of positive words by the combined total of positive and negative words in tweets. You can see which hashtags are being used most frequently, recent tweets, and statistics about the sentiment by candidate or geographic location.

Infographic

The infographic in this app shows various measures of public sentiment per candidate, as well as the following charts and graphs that help paint the picture about the sentiment towards these candidates on social media:

  • The widgets featuring a picture of the candidates shows their overall public sentiment level and features some recent tweets that mention them.
  • The Sentiment Over Time by Candidates bar graph shows the overall number of positive and negative words mentioned in tweets about each candidate.
  • The Tweets About Candidate Per Day widget shows how many tweets each day mention one of the candidates.
  • The map widget shows the public sentiment sentiment in different states. The size of the circle reflects the public sentiment level and location is chosen based on one twitter users in that state.
  • The Overall Candidate Sentiment Level by Selected States widget shows the sentiments for the candidates in important locations.
  • The Top Mentions in Overall Election and Top Hashtags in Overall Election widgets show the most common mentions and hashtags in the tweets examined in a word cloud.
  • The Positive and Negative Words by Candidates bar graph illustrates how many positive or negative words users tweet about each candidate.
  • The Positive and Negative Words by States bar graph illustrates how many positive or negative words users from different states are using in their tweets about each candidate.
  • The Median Followers of Users widget shows the median number of followers of users who tweeted about a candidate.

Import and Connection

The TwitterRest uses the Twitter API to import data about the candidates. The S3 connection adds more of the data from the past month.  

The following imports are used to sort tweets about each candidate, to add historical data, to provide a dictionary for coding words as positive or negative, and to include US location data:

  • Donald_Trump
  • Hillary_Clinton
  • ImportHistoricalData
  • SentimentDictionary
  • GeoCode

Workbooks

A_ Prep and Stat

The preparation and statistics workbook brings the data from the different sources together and preforms different statical analyses on that data.

Data sources used in this workbook:

  • Donald_Trump
  • Hillary_Clinton
  • ImportHistoricalData

The union feature is used to bring all identical columns from the candidate sources to a single sheet. A second union is used to combine that data with the historical records data.

Eleven calculation worksheets are used to derive statical information about the candidates from the Twitter data. Analytic functions are used to discern hashtag counts, tweet similarities, most active users, and more. 

B_ Sentiment Analysis

This workbook focuses on understanding the context of tweets that refer to the presidential candidates represented.

Data used in this workbook:

  • The worksheet titled Prep from the A_ Prep and Stat workbook
  • Sentiment Dictionary
  • GeoCode

The text contents of each tweet is first tokenized, meaning that each word for each tweet is separated. Common words are then removed to better analyze the stronger language. 

A worksheet is created with the joining process to merge the data from the tokenized tweet text with the dictionary list of words and their sentiment values.

Thirteen calculation worksheets are used to derive information about positive and negative word scores in relation to the candidates, the Twitter users, and the Twitter user locations.