Week 6 - Prof D’s Regression Sessions Vol 1

Author

Adam Dennett

Published

October 29, 2025

Introduction

This week will introduce Linear Regression. The most useful and widely used model in all of statistics. Regression underpins more ‘advanced’ methods like machine learning, but for most situations, it is likely to be the only model you will require.

Because of its popularity, regression is also one of the most widely misused models in the spatial data scientist’s toolbox. Therefore, understanding the basics is absolutely fundamental. If you understand the basics, then you stand a better chance of understanding what the more sophisticated methods related to standard linear regression bring to the table.

Like baking a cake, getting a regression model right is theoretically no more challenging than following a baking recipe - almost anyone can follow the instructions. However, like baking an amazing cake, skill, experience and understanding gained through hours of experimentation, failures, the odd amazing success and lots of perseverance are what make the difference between a great model and a soggy bottom!

Learning Objectives

By the end of this week, you will:

  1. Understand what basic bivariate regression model is and how it might be used to explore / describe the relationship between two continuous variables
  2. Understand the absolutely fundamental importance of visualising your data and your model first
  3. Be able to interpret the various outputs from a statistical regression model - knowing what each means and how not to rely just on things like p-values and R-Squared to determine how good your model is
  4. Appreciate how the coefficients in a model will likely vary depending on your study population and how representative it is of the wider population you are making inferences about. In doing this, you will understand why ‘degrees of freedom’ are important
  5. Be ready to go beyond the basics and take your regression modelling further in next week’s Regression Session.

Lecture

To access the lecture notes: Lecture

Quiz

To access the quiz on Moodle, please check Moodle page.

Practical

Note

To save a copy of notebook to your own GitHub Repo: follow the GitHub link, click on Raw and then Save File As... to save it to your own computer. Make sure to change the extension from .ipynb.txt (which will probably be the default) to .ipynbbefore adding the file to your GitHub repository.

To access the practical:

  1. Main Practical Page
  2. If Quarto has rendered this properly, you might be able to download a notebook here

Further resources

Applied Regression Example

Early in 2025, I produced a very rapid piece of regression analysis to contribute to the debate around Brighton and Hove City Council’s proposed changes to the secondary school admission process. This was put together very quickly and as such it’s not perfect. However, it did help shift the public debate in the city and is one example of how regression analysis can be used in a piece of ‘public-facing scholarly writing’ - you can read it here: https://adamdennett.github.io/BH_Schools_Consultation/absence.html

A follow-one piece (that I am in the process of revising as the methodology is potentially a bit sketchy) can be viewed here - https://adamdennett.github.io/BH_Schools_Consultation/attainment_extra.html

Further Reading

Field, Andy P. 2026. Discovering Statistics Using R and RStudio. London: SAGE Publications. - Andy Field is always my go-to - https://profandyfield.com/discoverse/dsur/

You might want to try the Tidyverse and Tidy Models - https://www.tidymodels.org/