Did the Liberal Democrats enjoy a poll boost after winning those by-elections?
Change point analysis seems to say - yeah, a bit.
Liberal Democrat Twitter was overjoyed following the party’s successes in both the Chesham and Amersham by-election, where it overturned a 29 percentage point Conservative majority, and the North Shropshire by-election, where it overturned a mighty 41 percentage point majority.
Although I’m sceptical about the notion that these victories signal anything meaningful about the Liberal Democrats’ chance of success in the next general election, it is hard to begrudge the party’s supporters their gloating given their dire performance following their decision to go into coalition with the Conservatives in 2010. Ignoring the Indian summer of mid- to late-2019, the party has rarely polled above 15 percent, and since the 2019 general election it has only managed to hit 14 percent in any GB-wide poll.
But do these by-elections actually correlate with a long-term change in the Liberal Democrats’ polling? I scraped all the polls conducted during this parliament from this Wikipedia page, keeping just the GB-wide polls and removing one in which the fieldwork took place across the period of the North Shropshire by-election. I then made a number of lovely graphs which, sadly, aren’t relevant here.
One which is, however, is this basic scatterplot of Liberal Democrat poll performance before the Chesham and Amersham by-election, between Chesham and the North Shropshire by-election, and then after North Shropshire.
We can see that the Liberal Democrats went from an average of around 7.5% before Chesham and Amersham to just under 10% in the period between the two by-elections. Polling for the party after the North Shropshire by-election has been a) strong, and b) limited, but of the four conducted so far the party is averaging around 11%. It’s too early to tell if this is sustained, but the party does seem to be on the up.
Another, more sophisticated, approach to this is via change-point analysis. Using the r packages {changepoint} and {strucchange} we can take time-series data and, using the binary segmentation method, look for structural changes in the data. I set a maximum number of 10, but in the end we were given 5 change points. The only information fed into the function is the polling figure - no real-world event data was used in the model.
Firstly, some explanation. The line chart represents Liberal Democrat performance in each GB-wide poll since the 2019 general election, the yellow point their 2019 result (in GB), the blue vertical lines represent the change points, and the red dotted/dashed lines represent points of interest.
We see that after a short period the Liberal Democrats’ poll rating drops, roughly around the time it became clear Keir Starmer would become Labour leader - perhaps signalling anti-Corbyn/anti-Tory voters shifting (back?) to Labour.
Ed Davey’s election as Liberal Democrat leader fails to shift the dial (former Liberal leader - and now persona non-grata amongst the historically illiterate - William Gladstone probably got more airtime than Davey last year).
There is a clear jump around the Chesham and Amersham by-election - from around 7.5 percent before to 9 percent afterwards. No information about real-world events was fed to this model, so the tight correlation is a promising sign. The next change point occurs just before the North Shropshire by-election, where the Liberal Democrats enjoy a jump from 9 percent to 10.5 percent. Since this jump occurs before the by-election it’s much more likely to be a factor of ‘party-gate’ rather than any specific surge in support based on the by-election itself.
Overall, then, it seems that Chesham and Amersham and North Shropshire were different beasts - C&A (the by-election, not the oft-missed clothing store) did seem to change the political weather for the Liberal Democrats, whereas for NS (the by-election, not the magazine which acted disgracefully vis-a-vis Roger Scruton) the political mood had changed prior to the by-election (and judging by the first graph there are hints the boost for the Liberal Democrats seems to be wearing off…).
Anyway, let’s wrap up: not all by-elections change the political weather. In this parliament, for the Liberal Democrats, Chesham and Amersham did while North Shropshire didn’t. Instead, the latter seems to have fed into the issue around ‘party-gate’.
If I were a Liberal Democrat (if - ‘new year new me’ only goes so far) then I’d be worried. Despite these two historic by-election victories, the party’s polling average is still below 2019 performance - and that was during the disastrous leadership of ‘future prime minister’ and seat-loser Jo Swinson (maybe she’s playing the long game, and will be PM from the Lords - quite fitting for the party which is anti-Lords but has stronger representation in the second chamber than the elected chamber…). It would be churlish to deny the Liberal Democrats’ their celebrations, but the importance of the by-elections should not be overstated.
Note: This is the first time I’ve ever used this methodology and these r packages. I might have got it completely wrong. Somehow, as these graphs were being made and this blog was being written, I polished off a bottle of prosecco (new year old me, it seems) so there probably are some mistakes. The guide I followed is here, and my (very messy - embarrassingly so) code is here. If you notice that I got something wrong, please tell me!
Packages used
- Achim Zeileis, Friedrich Leisch, Kurt Hornik and Christian Kleiber (2002). strucchange: An R Package for Testing for Structural Change in Linear Regression Models. Journal of Statistical Software, 7(2), 1-38. URL http://www.jstatsoft.org/v07/i02/
- Jacob Kaplan (2020). fastDummies: Fast Creation of Dummy (Binary) Columns and Rows from Categorical Variables. R package version 1.6.3. https://CRAN.R-project.org/package=fastDummies
- Killick R, Eckley IA (2014). “changepoint: An R Packagefor Changepoint Analysis.” _Journal of StatisticalSoftware_, *58*(3), 1-19. <URL:http://www.jstatsoft.org/v58/i03/>.
- Makowski, D., Ben-Shachar, M.S., Patil, I. & Lüdecke, D. (2020). Automated Results Reporting as a Practical Tool to Improve Reproducibility and Methodological Best Practices Adoption. CRAN. Available from https://github.com/easystats/report.
- R Core Team (2021). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.
- Wickham et al., (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43), 1686, https://doi.org/10.21105/joss.01686
- Yuan Tang, Masaaki Horikoshi, and Wenxuan Li. "ggfortify: Unified Interface to Visualize Statistical Result of Popular R Packages." The R Journal 8.2 (2016): 478-489.