Predicting 2014 Election

Rob Davidson
January 7, 2015

Objective

To predict Ottawa councillor winners

  • Use R to leverage Twitter API to get candidate twitter follower information
  • 101 of 124 candidates had accessible Twitter data
  • Use Gephi to analyze and visualize graph
searchP1<-"https://api.twitter.com/1.1/
          followers/ids.json?screen_name="
searchString<-paste(searchP1,tempJoin[i,1],
             "&cursor=-1&count=5000",sep="")

initSearch<-GET(searchString,sig)

Candidate Twitter Follower Distribution

plot of chunk unnamed-chunk-1

Example Prediction Ward 14 Somerset

plot of chunk unnamed-chunk-2

alt text

Simple Follower Count Result

plot of chunk unnamed-chunk-3

Looking at Incorrect Predictions

  1. Council candidates' Twitter follower counts impacted by previous election campaigns (Ward 13, Ward 16)

  2. Council candidate member of press (Ward 22)

  3. Twitter Boosting? (as per TwitterAudit) (Ward 19)

alt text alt text

Social Network Analysis using Gephi

alt text

River Ward Graph

alt text

River Ward Graph - Filtered

alt text

River Ward Filtered Graph Prediction

  1. Set filter on follower nodes

  2. Only include followers who follow more than one candidate in ward

  3. Predict winner based on candidate with highest in-degree

alt text

Filtered Graph Result

plot of chunk unnamed-chunk-4

Alta Vista Graph - Filtered

alt text

Future Steps

  1. Assign edge weights based on Retweets and Favorites

  2. Use NLP-based filter to id individual vs. organizational followers

  3. Apply to Ottawa ridings in the Federal Election

alt text