Using Twitter To Predict The #GE2015 Outcome
Here's a very silly idea. Can we use the number of followers each candidate has to predict who will win the election?
No, probably not - but let's give it a try anyway, eh?
Hypothesis
Support on Twitter - as measured by the number of followers - is a reasonable predictor of electoral success.
It is likely that the incumbent MP will have a large number of followers - having been in the public eye for five years and (possibly) being on Twitter that long.
It is also likely that MPs with high-profile jobs - like Chancellor, Leader of the Opposition, etc - will be followed by a range of people outside their constituency. These candidates are usually in safe seats, but not always.
These factors may skew the results.
Apparatus
- Tweepy - a Twitter Library for Python.
- YourNextMP - free and open crowdsourced data about every candidate standing.
Method
YourNextMP provides a CSV showing every candidate in every constituency. 72% of candidates have a Twitter ID listed against their name.
For each constituency, we take all the candidates and, if they have Twitter handles, we see which candidate has the most followers.
This data was collected on the weekend before the election. It took around 2 hours to run thanks to Twitter's rate limits. Follower numbers may have changed since and during the run.
Results
Based on this extremely unscientific measurement the results are...
Party | Seats |
---|---|
Labour Party | 247 |
Conservative Party | 204 |
Liberal Democrats | 69 |
UK Independence Party (UKIP) | 36 |
Scottish National Party (SNP) | 24 |
Green Party | 23 |
Sinn Féin | 7 |
Plaid Cymru - The Party of Wales | 5 |
Trade Unionist and Socialist Coalition | 5 |
Ulster Unionist Party | 5 |
English Democrats | 4 |
Independent | 3 |
SDLP (Social Democratic & Labour Party) | 3 |
Pirate Party UK | 2 |
The Respect Party | 1 |
Speaker seeking re-election | 1 |
Class War | 1 |
British Independents | 1 |
Cannabis is Safer than Alcohol | 1 |
Something New | 1 |
Digital Democracy | 1 |
Democratic Unionist Party - D.U.P. | 1 |
Red Flag - Anti-Corruption | 1 |
The Independent Political Alliance Party | 1 |
Lincolnshire Independents Lincolnshire First | 1 |
Scottish Green Party | 1 |
Traditional Unionist Voice - TUV | 1 |
Although that doesn't look like anything the reputable polls are showing, it does look strikingly close to what proportional representation would achieve. A strong showing from the main parties, but with the absolute need to work with the smaller parties in order to sustain a stable government.
Incidentally, Transmute performed a similar exercise back in February. It's interesting to see how the data have changed since Election Season kicked off.
Conclusion
Well, come the results on Friday, I'll update this to show just how accurately this "poll" performed.
There are some obvious deviations from the likely reality.
In Birmingham, Perry Barr - the Green candidate has been active on Twitter since 2009. The incumbent only since February 2015. An improved polling model could correct for this.
While the Pirate Party's Cris Chesha is probably a terrific chap, he is unlikely to defeat the incumbent Gerald Kaufman who doesn't Tweet.
Indeed, in Beckenham, it is only the Lib Dems' Anuja Punj Prashar with a Twitter presence.
Raw Data
You want every result? Here you go!
You made it all the way down here? Well done :-) Have a Unicode Cookie 🍪