We’ve compared our predictions of the 2019 ๐จ๐ฆ election to the actual votes. Overall, we were within 5% with no obvious geographical biases, though we did slightly overestimate support for the NDP at the expense of the Liberals. I think weโre on to something good here!
election
With an agent based model you can explore interesting scenarios. Our latest post models the ๐จ๐ฆ election with another Liberal scandal, new Conservatives climate change policy, or proportional representation. The results are not obvious, showing benefits of non-linear modelling.
Spatial analysis of votes in Toronto
Tuesday, December 4, 2018
This is a โbehind the scenesโ elaboration of the geospatial analysis in our recent post on evaluating our predictions for the 2018 mayoral election in Toronto. This was my first, serious use of the new sf package for geospatial analysis. I found the package much easier to use than some of my previous workflows for this sort of analysis, especially given its integration with the tidyverse. We start by downloading the shapefile for voting locations from the City of Torontoโs Open Data portal and reading it with the read_sf function.Tuesday, November 27, 2018 โ
Our predictions for the recent election in Toronto held up well. We were within 6%, on average, with a slight bias towards overestimating Keesmaat’s support. Now we’ll add more demographic richness to our agents and reduce the geographical distribution of errors www.psephoanalytics.ca/2018/11/r…
We’ve completely retooled our approach to predicting elections to use an agent-based model. Looking forward to comparing our predictions to the actual results tonight for the Toronto election!
Fixing a hack finds a better solution
Sunday, September 2, 2018
In my Elections Ontario official results post, I had to use an ugly hack to match Electoral District names and numbers by extracting data from a drop down list on the Find My Electoral District website. Although it was mildly clever, like any hack, I shouldnโt have relied on this one for long, as proven by Elections Ontario shutting down the website. So, a more robust solution was required, which led to using one of Election Ontarioโs shapefiles.Elections Ontario official results
Sunday, November 19, 2017
In preparing for some PsephoAnalytics work on the upcoming provincial election, Iโve been wrangling the Elections Ontario data. As provided, the data is really difficult to work with and weโll walk through some steps to tidy these data for later analysis. Hereโs what the source data looks like: Screenshot of raw Elections Ontario data A few problems with this: The data is scattered across a hundred different Excel files Candidates are in columns with their last name as the header Last names are not unique across all Electoral Districts, so canโt be used as a unique identifier Electoral District names are in a row, followed by a separate row for each poll within the district The party affiliation for each candidate isnโt included in the data So, we have a fair bit of work to do to get to something more useful.Election 2008
Tuesday, October 14, 2008
Like most Canadians, Iโll be at the polls today for the 2008 Federal Election. In the past several elections, Iโve cast my vote for the party with the best climate change plan. The consensus among economists is that any credible plan must set a price on carbon emissions. My personal preference is for a predictable and transparent price to influence consumer spending, so I favour a carbon tax over a cap-and-trade.