fivemack: (Default)
Tom Womack ([personal profile] fivemack) wrote2010-05-08 09:04 pm

4056 lines of data

So you don't have to scrape the BBC yourself:

http://www.chiark.greenend.org.uk/~twomack/2010-results.txt

contains 4056 lines of the form

Chelsea & Fulham } Blue Environment Party } 17


The vote-count is blank for all the parties in Thirsk & Malton since that election hasn't happened yet.

The example script here makes the following list of parties standing in more than twenty places:

Party nameNumber of places standing Deposits saved
Socialist Labour Party230
Monster Raving Loony Party270
Trade Unionist and Socialist Coalition380
Plaid Cymru4029
Scottish National Party5959
Christian Party710
English Democrats1071
Independent25013
Green3357
British National Party33872
UK Independence Party55899
Conservative630627
Labour631625
Liberal Democrat631630


(for the curious, the English Democrats kept their deposit in Doncaster North; the Liberal Democrats kept all of theirs but I divided by zero in Thirsk; the Conservatives lost theirs in Na H-Eileanan An Iar and Glasgow East; Philip Lardner stood as an independent in Ayrshire North after being deselected from the Conservatives)

[identity profile] fivemack.livejournal.com 2010-05-09 08:30 am (UTC)(link)
How many parties do you want along the top? 133 stood in this election, 54 in more than one constituency, 25 kept a deposit (the 54 and the 25 don't quite overlap) ...

[identity profile] beingjdc.livejournal.com 2010-05-09 11:01 am (UTC)(link)
Yes, that's a bit annoying. Really I want Conservative, Labour, Lib Dem, UKIP, BNP, SNP, Green, Other. But concatenating "others" is probably more work than just starting out with 133 rows and trying things out by hand.

[identity profile] fivemack.livejournal.com 2010-05-09 11:26 am (UTC)(link)
Use script http://www.chiark.greenend.org.uk/~twomack/jdc.pl or download the output from http://www.chiark.greenend.org.uk/~twomack/jdc.txt

Perl is quite a powerful data-scrunging tool; load the result into excel as delimited with semi-colons as the delimiters.

[identity profile] beingjdc.livejournal.com 2010-05-09 12:38 pm (UTC)(link)
Thanks. Interesting result - comes quite close to national PR but maintains the small low-turnout bonus for parties which attract working class votes, and small-constituency bonus for the special cases.

Tories 224 as against 235 in national PR
Labour 196 as against 189
LibDem 146 as against 150
SNP/Plaid gain one each
"Others" 27 rather than 23, though Northern Ireland / randomness makes that a slightly dodgy figure I imagine.

Now to figure out how I calculate the bell curve rather than merely the central probability! La la la.

[identity profile] beingjdc.livejournal.com 2010-05-09 12:39 pm (UTC)(link)
Also you seem to have lost the Conservative vote in North Ayrshire somewhere.

[identity profile] beingjdc.livejournal.com 2010-05-09 03:17 pm (UTC)(link)
Oh, you noted it. They got to him in time for the ballot - I missed that, I thought he was like South Cambs and ended up nominally on the paper but formally disowned - wonder why they didn't replace him in that case.