Blog
Election Dashboard Now Available
2016-07-20
I've recently added a new section to the website, called the Election Dashboard. This page allows you to produce a variety of summary reports based on data from the 2011 Canadian Federal Election. This is a preliminary version that has only basic functionality; over time, I'm planning on adding more features to the dashboard, joining additional data sources, and expanding to the 2015 election.
How to use the dashboard
To use the dashboard, you select the metric you want to calculate, and two dimensions that will be used to group the data prior to calculation of the metric. The primary dimension will form the rows of the report, and the secondary dimension will provide the columns. Dimensions available include:
- Province
- Political Party
- Whether or not the candidate is an incumbent (current holder of the seat)
- Whether or not the candidate was victorious in the 2011 election
The two metrics available are the total number of votes cast, and the conversion ratio, which is defined as the total number of votes cast divided by the number of voters who were eligible to vote for that candidate.
Summarization of Conversion Ratio Calculations
Because the metrics are being calculated on data that is grouped according to the dimensions, it is important to clarify how the conversion ratio is calculated. Both the number of votes cast and the number of eligible voters are totalled before the ratio is calculated. For some dimensions, voters may be counted multiple times if their vote is courted by multiple political parties within in the grouping. A typical example of this would be when the "Elected Candidate" dimension is used: in the "N" column, because there are many non-elected candidates in each riding, this is a grouping in which multiple candidates are vying for each elector's vote. The "Y" grouping does not present this problem, since there is a unique winning candidate in each riding. In general, the conversion ratio should be interpreted as the weighted average conversion ratio of all candidates in the grouping defined by the dimensions. The main advantage of this approach to calculating conversion ratio is that it allows for fair conversion ratio comparisons between political parties based on the number of ridings they actually contested; this is a particularly relevant consideration for parties such as the Bloc Québécois which only runs candidates in Quebec.
Data Sources, Processing, and Reconciliation
Election results were obtained from the Elections Canada Website; "Format 2" as described on this site was used. Data was processed using R. Filters and transformations applied include:
- "Void polls" and records where no poll was held were removed
- Province does not appear in the original data, and was defined using the mapping from district number to province provided on the site linked above.
- Accents were removed from Bloc Québécois entries because they were not rendering properly in the dashboard.
- A new variable counting the number of valid votes cast in each polling station was defined as the sum of the votes recieved by each candidate. (This is not currently available in the dashboard, but will be used to support metrics that will be added in the future.)
Following data processing, top-level reconciliation was performed to validate that the total number of votes cast (14,723,980), the total number of eligible voters (24,257,592), and number of electoral districts (308) match the values reported by Elections Canada. More granular reconcilitaion (e.g. at the party and province level) can be performed using the dashboard itself, and match the results provided in "Table 8" of the Elections Canada report on the 2011 election.
Keywords: Website news, Election Dashboard
Website refresh
2016-07-03
I've recently revised my website after having gone several years without an update. The biography page now reflects my current activities, and I've added a new blog page. This is a work in progress, and I hope to add new features and content over the next month.
Keywords: Website news