Last reviewed: Next review due:
What is regression?
Regression is a statistical method for quantifying the relationship between two or more variables. A simple linear regression asks: “As X increases by one unit, how much does Y change, on average?” For example: for each additional year of age (X), how much does council tax benefit claim rate (Y) increase?
Regression is useful for data journalism when you want to go beyond “these two things are related” and quantify how strongly they are related, and in which direction. But it does not prove causation, and the results are only as good as the data.
Before running a regression: plot a scatter chart of your two variables. If the relationship looks non-linear, curved, or clustered, a simple linear regression is not the right tool.
Reading regression output
# Python: simple regression with statsmodels
import pandas as pd
import statsmodels.formula.api as smf
df = pd.read_csv('la_data.csv') # local authority data
# Regression: does deprivation predict GP waiting times?
model = smf.ols('gp_wait_days ~ deprivation_score', data=df).fit()
print(model.summary())
# Key output to read:
# coef (deprivation_score): 0.23 <- each 1-point rise in deprivation
# associated with 0.23 extra wait days
# R-squared: 0.41 <- deprivation explains 41% of variation
# P>|t|: 0.000 <- statistically significantCoefficient
The slope: how much Y changes for each 1-unit increase in X. Can be positive or negative.
R-squared
How much of the variation in Y is explained by X. 0 = none, 1 = all.
p-value
Probability the result occurred by chance. Below 0.05 is the conventional significance threshold.
When regression is useful in journalism
- 1Testing whether a relationship holds up after controlling for other variables (multiple regression).
- 2Quantifying the strength of a relationship to add rigour to a story that is already suggested by the data.
- 3Predicting what a value should be and comparing it to what it actually is (residual analysis).
- 4Identifying local authorities or institutions that are outliers after controlling for confounders.
Red flags
- Claiming causation from a regression — regression shows association, not causation.
- A high r-squared on a scatter plot with only 10–15 data points — unreliable with small samples.
- Not checking for outliers that are driving the regression line.
- Using a linear regression on a non-linear relationship — the model will be misleading.
- Ignoring potential confounders — the story may be about the third variable, not the two you measured.
Regression reporting checklist
- I have plotted a scatter chart before running the regression to check the relationship looks linear.
- I have checked for outliers that may be driving the result.
- I have reported r-squared alongside the coefficient.
- I have not implied causation from the regression alone.
- I have considered at least three potential confounding variables.
- For complex regressions, I have had the methodology reviewed by a statistician.
When to consult a statistician
If your story rests on a regression finding, have it reviewed by a university statistics department or the Royal Statistical Society’s Journalist Fellows programme before publication.
Common mistakes
- Treating the regression line as the whole story — show the scatter plot too so readers see how much variation remains.
- Not mentioning the p-value or sample size when citing a regression coefficient.
- Extrapolating a regression line far beyond the data range — the relationship may not hold.
- Using ecological regression (data on areas) to draw conclusions about individuals — this is the ecological fallacy.