Thursday, February 8, 2018

Analysis of the 2018 BC Liberal leadership race

On Monday afternoon, I noticed a tweet from CBC reporter Justin McElroy that the BC Liberals had released riding-by-riding vote totals for their leadership race.

While the Liberals deserve kudos for releasing this data (the BC NDP famously didn't in 2011),  it was annoying that the data was released as a PDF rather than a spreadsheet. PDFs are fine for looking up individual results for individual ridings. But spreadsheets are best for really analyzing the patterns in the data.

From dealing with PDFs in the past, I knew there were actually some pretty decent tools out there for extracting data from them. Chief among them: Tabula, a great little program designed by journalists, for journalists.

My first attempts to extract the data using Tabula didn't work: When it tried to automatically detect the tables, it misjudged and ended up leaving off some rows of data. Not good! But after some fiddling, I was able to successfully grab the data and then, with a little bit of fiddling in Excel, create a nice, clean spreadsheet for analysis.

My original plan was just to get the data into a nice format and make it public so other folks could play around with it. But then once I had the data I figured: What the heck. I want to play with it!

So my next few hours — with a short break for dinner — were spent crunching the numbers and looking for interesting patterns in the data.

The most interesting finding (and the one that seemed to generate the most retweets): Andrew Wilkinson really benefited from the point system used by the Liberals, in which every riding got 100 points regardless of how many members it had. Indeed, looking at the raw vote totals for each round, Michael Lee was ahead in every single round he participated in. And, indeed, in Round 4, when Wilkinson knocked Lee out by points, Wilkinson was actually in third place by raw votes.

My analysis even got a nice little write-up in my former paper.

I pulled all my charts and maps into a Tableau workbook. It's too big to embed in this blog post, but you can see it by clicking here.

No comments:

Post a Comment