Overview
This applied statistics project forecasts the popular vote of the 2025 Canadian federal election between the Liberal and Conservative parties. It pairs a logistic regression model, fit on survey responses, with post-stratification over census demographics, so that estimates from a sample can be extrapolated to the full voting population.
Problem & Constraints
- Which of the two major parties, Liberal or Conservative, will win the election based on voter demographics in Canada? The working hypothesis, given the Liberal win in 2021, was that the Liberals would again receive the higher vote share.
- Constraints: Sample survey distributions suffer from non-response bias, requiring demographic reweighting against census baseline data to accurately represent the electorate.
My Contribution
- Dataset Harmonization: Standardized and mapped demographic variables (age, sex, birthplace, province, education, income) across the 2019 Canadian Election Study (4,021 survey respondents) and Statistics Canada GSS census dataset.
- Model Fitting & Diagnostics: Built binary logistic regression models per party with stepwise AIC selection, verifying logit linearity via Box-Tidwell tests () and VIF collinearity checks.
- Post-Stratification Reweighting: Implemented MRP cell-level prediction () and reweighting against national census population cells () to generate national vote share probabilities.
Data & Input Pipeline
Two datasets were combined:
- Modelling: the 2019 Canadian Election Study Phone Survey (4,021 respondents), which records Canadians’ attitudes and characteristics around the 2019 federal election.
- Post-stratification: the 2017 General Social Survey on Social Identity (Statistics Canada census data across ten provinces), which describes the demographics of the population.
A substantial cleaning step aligned variables and category levels between the two sources (age, sex, birthplace, province, education, household income, and household size), filtered undecided and refused responses, and restricted to eligible voters aged 18 and over. Binary outcome variables were created for voting Liberal and voting Conservative.
Method & System Architecture
A logistic regression model was fit for each party, with predictors chosen by stepwise selection on AIC. The outcome is binary (vote for the party or not), so the model estimates the log-odds of voting for a party as a function of demographics:
The fitted models were then applied through post-stratification, which estimates the vote probability within each demographic cell and reweights by each cell’s share of the population:
where is the size of cell and is the model estimate for that cell. Model assumptions were checked: a binary outcome, linearity in the logit for age via Box-Tidwell (p = 0.175, assumption satisfied), variance inflation factors near 1 (no multicollinearity), and no strongly influential outliers.
Results
Applying the models across all population cells produced these win probabilities:
| Party | Probability of winning |
|---|---|
| Liberal | 34.7% |
| Conservative | 35.6% |
The model favored the Conservative Party by a narrow margin, reversing the project’s initial hypothesis. The two estimates are close, so the result is best read as a lean rather than a confident call.
Limitations & Lessons
Several caveats temper the forecast: there was no control over how the survey data were collected, non-voters and undecided respondents were not modelled, only the two leading parties were considered, and stepwise selection can bias coefficient estimates and inflate test statistics. Hidden subgroups in the data may also go unaccounted for.
References
- L. B. Stephenson, A. Harell, D. Rubenson, and P. J. Loewen. “Canadian Election Study, 2019, Phone Survey.” 2020.
- Statistics Canada. “General Social Survey on Social Identity.” 2017.