Wednesday, 18 April 2012

The 11th London Mayoral Twitter Poll







Click on pictures to enlarge

Poll findings
1)Oh Ken what are Labour going to do with you? You were recovering nicely from your tax troubles and then what do you do? Make the point that you thought a mass murdering terrorist who has already been shot shouldn't have been shot. I'm guessing Ken missed the class at professional politician school on message discipline. It's cost him a bad day on twitter and he really doesn't have a lot time to be having too many of those. Think I'm going back to predicting the race lean's Boris

2) Boris didn't have a brilliant day. His negatives went up but if your main rival is less popular than you then Boris will be the one taking comfort from today's poll. If there are as many people who love Boris as want to do terrible things because their transport is late then he could be alot worse off.

3)No real change on Brian and Jenny's figures today. Suggest one or both of them have a stand up blazing row with Boris with swearing and passion and loads of press convienently there to capture the moment for posterity. At least people would be talking about them. Will it help them win? Probably not but what have they got to lose?

4)Benita wins the Mary Poppins award AGAIN for best positive rating and lowest negative. Good coverage on Twitter. I noticed her followers followers had gone up over 4000. Then I thought to get 5% in this race Benita will need about 200,000 votes. What a poxy 5% for 200,000 votes! Yes I know that's rather alot even if you're getting coverage in the national press and have lots of Twitter activity. Not impossible but that just illustrates the reality of this massive election.


Results


    Candidate Pos11 Neut11 Neg11 Tot11 Pospercent11 Negpercent11
1    BorisCON   118    305   247   670           18           37
2      KenLAB   154    403   421   978           16           43
3 BrianLIBDEM    53    103    52   208           25           25
4  JennyGREEN    84    150    95   329           26           29
5  SiobhanIND   170    198    70   438           39           16
6   CarlosBNP     2     15     8    25            8           32

Tuesday, 17 April 2012

The 10th London Mayoral Twitter Poll




Click on pictures to enlarge

Poll findings
1) The sentiment ratings aren't being very helpful today as really all the candidates aren't that far apart. But look at the negative poll graph what aren't you seeing that has been a solid featurewhen I started polling? Yes that massive Ken Livingstone colume in the negative poll. Infact for the last few days he negative ratings have been quite respectable. Not a clear election winning advantage but Ken'll just be glad he's not in position where the sentiment analysis clearly puts Boris in the lead. I think the EMA stuff helped Ken today. No I can't believe he's top of the positive ratings either.

2) Boris is treading along nicely. He'll not be too happy that Livingstone's volume went up alot more than his today. I think the election is still a toss up. It's leaned more to Boris over time but Ken's better rating over the last few days may give the Boris campaign cause for concern that they haven't yet sealed the deal.

3) Jenny and Siobhan both down a little bit on volume. So that late surge to pick them off the 2% rating they got from Yougov has been delayed somewhat it seems. Jenny will be happy her negatives have gone down too.  Not a bad day for Brian at all his positives not far off doubling and volume up a touch as well.

4)UKIP and the BNP failed to make the cut. AGAIN.


Results

   Candidate Pos10 Neut10 Neg10 Tot10 Pospercent10 Negpercent10
1    BorisCON   195    349   176   720           27           24
2      KenLAB   468    448   304  1220           38           25
3 BrianLIBDEM    86    122    70   278           31           25
4  JennyGREEN    49     89    42   180           27           23
5  SiobhanIND    92    151    53   296           31           18

Twitter vs Yougov



I've never said that polling Twitter is going to be a total replacement for traditional polling far from it but I do think it could be a useful addition is certain circumstances. So I was interested to see how yesterdays Twitter poll compared with the Yougov poll on the London Mayoral election that came out yesterday. I tested the correlation between the two and it came back at 89% quite a bit higher than I was expecting.


> a
[1] 45 40  7  2  2  1  3
> b
[1] 875 544 235 203 348  52   0
> cor(a,b)
[1] 0.8948858

Monday, 16 April 2012

The 9th London Mayoral Election Twitter Poll


Click on pictures to enlarge

Poll findings
1) Well big changes today at least in how the poll is constructed. I wanted to put some kind of limit on the number of tweets that anyone tweeter could tweet that would be included in the analysis. I was going to keep secret to flummox anyone wanting to bias it. However during the course of coding I was able to find a solution that resulted in using tweeters that only mention a candidate only once. Go selecting data using logical conditions. Anyway I will see how this goes. Today it doesn't seemed to have changed from the normal pattern but obviously to volume reached has been lower.

2)Boris got more mentions but he was pretty much even with Ken on sentiment. So basically it's a toss up but slightly leaning to Boris.

3)Looking at the YouGov poll released today you've got a picture which show the big 2 out front and the others in something of a scrum at the bottom. I couldn't see a margin of error on there but expect with would have been something around +/- 3% so Paddick on 7% may feel better than Jones on 2% but Jones's +3% = 5% which is higher than Paddick's -3%  which = 4%.. I will do proper calculations to work out the correlation between my data and the result but at the moment it's not looking too bad even if the BorKen lead over the rest is understated.

4) Carlos has put in an appearance today. Suspect he got in the media somehow the tweets were mainly laughing at him. So we are getting near the prospect of a BNP mayor deporting himself.

5) Siobhan wins the Mary Poppins ward for highest positive rating & lowest negative. Though her figures aren't looking THAT different from the others. Jenny Jones shouldn't allow some American to use her name for chatshow reasons or at least get them to air the series after the election.


Results

    Candidate Pos9 Neut9 Neg9 Tot9 Pospercent9 Negpercent9
1    BorisCON  243   447  185  875          28          21
2      KenLAB  168   256  120  544          31          22
3 BrianLIBDEM   46   127   62  235          20          26
4  JennyGREEN   49    74   78  201          24          39
5  SiobhanIND  127   152   69  348          36          20
6   CarlosBNP    7    30   15   52          13          29

Sunday, 15 April 2012

The 8th London Mayoral Election Twitter Poll



Poll findings
1) Well what a poll! As you can see there are two volume polls out today and no sentiment ones as yet. This is because I got a shock when I first did the poll as Siobhan Benita came out top in volume! Yes I know Boris and Ken's volumes are both down probably because it's the weekend but still it would have been the shock of the Twitter polling season. However on closer examination of the data it became clear that the total had been somewhat inflated by one tweeter so I'm introducing a limit to the tweets I count from each tweeter starting now.

I have applied it above with the adjusted graph so her volume figure falls from 756 to 483. I have checked the tweets of the the other candidates as well and no one else appears to be doing anything else similar. I don't think it was a deliberate attempt to skew the poll because it would have been the most rubbish attempt ever. 

2) In other news Ken's negatives have fallen below Boris's for the first time. This isn't going to totally undo the damage of recent times for Ken but it's an indication that the story is moving on.

3) Even with the adjustment Benita still got a higher volume than Ken for the first time today.

4)Brian and Jenny steady as they go I think.

5) UKIP and the BNP fail to make the cut. AGAIN.



Results

The adjusted figures


    Candidate Pos8 Neut8 Neg8 Tot8 
1       Ken Lab   95   232  125  452                   
2     Boris Con  158   266  224  648                   
3   Jenny Green   51    69   55  175           
4 Brian Lib Dem   61   111   67  239                  
5   Siobhan Ind                  483 


How does the poll work 

Tweets are collected from Twitter and then counted to give the volume figures and then they are classified by the sentiment package which is an addition to the R programming language I use for this. They're classified based on the content of the tweet. So something like "Love @mayoroflondon he's brilliant" would end up in the positive pile while "I'm going to rip Boris Johnson's ugly evil head off if no bus in 30secs" would end up in the negative pile. If it's not quite to obvious then there's the neutral category.

Progress so far....

 Click to enlarge.

In response to public demand he's a chart of the volume of tweets each candidate has got over the last week I've been getting data. I also be doing the positive and negative sentiment figures at some point as well.

Obviously the Lib Dems wouldn't admit it but they can't be happy being bottom for 5 of the last 7 days. Given that one of the other day's was Paddick's manifesto launch  Neither will the Greens be happy to be beneth Benita every day. Then comes the key question both for this experiment and the election how much do tweets translate into votes or at least registering on proper opinion polls with correctly weighted samples?

There does appear to be something of a pattern emerging with the top 2 somewhat correllated and the bottom 3 similarly bound together. We'll see if that continues next week.

My methodology does favour the smaller parties so I suspect Ken and Boris are quite a bit further ahead in reality but I get twitter handles and full names rather than first names so this shrinks the gap between the politicians on first name terms with the electorate as oppossed to those who aren't even famous in their own household. This is for two reasons 1) capacity the API I use searches for a max of 1500 tweets per search term if I search for Ken instead of Ken Livingstone then I would be much more likely to reach full capacity and miss tweets. 2) There are quite a few other Ken and Boris's in the world so if it's full names I'm searching for at least I know I'm getting the right ones.

The other two candidates didn't feature on the graph as it was hard enough doing it with data where they weren't any gaps.

R\ggplot2\data stuff

This was something of a pig to do but a good learning excercise nontheless. Things to note for the future. The date has to be the correct date format. Whatever you do don't spend hours faffing about making things into factors or as.integers or as.characters or any of that gubbins. You want as.Date.

Need to work out how to select the colours.

Data need to be in the sort of format you see below


Candidate Date Volume
Boris 08/04/12 489
Ken 08/04/12 569
Siobhan 08/04/12 333
Jenny 08/04/12 303
Brian 08/04/12 164
Boris 09/04/12 1541
Ken 09/04/12 839
Siobhan 09/04/12 271
Jenny 09/04/12 183

Saturday, 14 April 2012

The 7th London Mayoral Election Twitter Poll


Poll findings
1) Has peace and harmony broken out on the London front? Not quite but Ken, Jenny, Brian and Siobhan all have better percentage figures for both positive and negative today. Boris is 2% better off on his negative but 4% down on his positive so not a big change there.

2) Volume of tweets was down alot especially Boris and Ken but Siobhan's also fell a little. Suspect it's because it's a Saturday but Jenny's and Brian's volume increased. I would put this down to hustings today I think there was one organised by Stonewall and another Youth one. So that means less time for Boris and Ken to get on the telly hence their figures go down. Jenny and Brian get equal billing and hence see increases in their total. Well that's my theory anyway.

3) Ken has had a difficult week on the trail but is he starting to turn the corner? Yesterday the gap between Boris and Ken's negative percentage was 18% ie 39 vs 21 today it's 25 vs 18. If and it's a big if this improvement continues there starts to be a realistic argument to move the race back from leans Boris to toss-up between the two.

4) There's going to be a Yougov poll on the London Mayoral race on Monday that'll be a big day for the Benita campaign. If she fails to register again like ComRes than it's going to look like a campaign in a social media bubble with little resonance on the ground. But it'll be worth looking at the question as the ComRes one disadvantaged the smaller campaigns by not mentioning their candidate name in the question. Today she's won the Mary Poppins award for the highest positive rating and the lowest negative one as well.

5) UKIP an the BNP failed to make the cut. AGAIN. So clearly not putting the effort in.

How does the poll work 

Tweets are collected from Twitter and then counted to give the volume figures and then they are classified by the sentiment package which is an addition to the R programming language I use for this. They're classified based on the content of the tweet. So something like "Love @mayoroflondon he's brilliant" would end up in the positive pile while "I'm going to rip Boris Johnson's ugly evil head off if no bus in 30secs" would end up in the negative pile. If it's not quite to obvious then there's the neutral category.


Results


      Candidate Pos7 Neut7 Neg7 Tot7 Negpercent7 Pospercent7
1       Ken Lab  309   539  276 1124          25          27
2     Boris Con  202   349  129  680          19          30
3   Jenny Green  165   321   92  578          16          29
4 Brian Lib Dem  123   206   64  393          16          31
5   Siobhan Ind  224   297   81  602          13          37