Residuals and the Residual Sum of Squares | Applications and Interpretation IB Maths notes
Free preview: Residuals and the Residual Sum of Squares
Residuals: How Far Off Is the Line?
Applications and interpretation: HL only (AHL 4.13), building on the SL 4.4 regression line
A regression line always exists: your calculator will happily fit a straight line to any data, even data that curve like a banana. So how do we know whether the line is any good? We look at what it gets wrong.
Let's start from the regression line of y on x that your GDC gives (SL 4.4). Here we write it , so a is the intercept and b the gradient. (Your GDC may use the letters the other way round, as y = ax + b: always check which number is the gradient.) The line gives a predicted value ("y hat") for every x. The real y is usually a bit different.
- Positive residual: the point is above the line (the line under-predicts).
- Negative residual: the point is below the line (the line over-predicts).
- For the least squares line, the residuals always add up to 0.
Method: finding residuals
- Predict: put each x into the line to get .
- Subtract: observed minus predicted, .
- Check: the residuals add to 0 (up to rounding), and the signs match the picture.
For the eight points (x = 2, 4, 5, 7, 8, 10, 11, 13) with line :
| x | 2 | 4 | 5 | 7 | 8 | 10 | 11 | 13 |
|---|---|---|---|---|---|---|---|---|
| y | 15 | 19 | 22 | 24 | 29 | 30 | 35 | 36 |
| residual | −0.36 | −0.32 | 0.70 | −1.26 | 1.76 | −1.20 | 1.82 | −1.14 |
👀 Watch me do it: the residual at x = 8
| What I write | Why I do it |
|---|---|
| Predicted | Step 1. |
| Residual | Step 2: observed minus predicted. |
| Positive: the point is above the line | Step 3: sign check. |

What the picture shows
- The observed point (8, 29) sits above the line, which predicts 27.24.
- Wrong: working out predicted − observed gives −1.76, which suggests the point is below the line.
- Right: the residual is observed − predicted, , which is positive.
- Check the sign with the picture: above the line means a positive residual.
- Check: the residuals in the table add to 0 (up to rounding).
💡 In plain words
- A residual is the error the line makes at one data point.
- Small residuals everywhere mean the line fits well.
✏️ YOUR TURN 1
Try this first:
A regression line is . Find the residuals for the points (10, 12.1), (15, 15.0) and (20, 18.2), and say which points lie above the line.
Answer:
- (10, 12.1): predicted 11.5, residual 0.6 (above).
- (15, 15.0): predicted 15.5, residual −0.5 (below).
- (20, 18.2): predicted 19.5, residual −1.3 (below).
Residual Plots: Is a Straight Line Right?
- A residual plot shows each residual against its x value.
- If a linear model is right, residuals are scattered randomly above and below 0, with no pattern.
- A curved pattern means the relationship is not linear: a straight line is the wrong model.
- A single residual much bigger than the rest points to a possible outlier.
Unlock the full note: start 7 days free.
Log in or subscribe to read the rest of this note. Members also get the AI tutor, practice quizzes, mock exams and flashcards for this topic.
All notes in Correlation and regression (SL 4.4, 4.10; AHL 4.13)
- Scatter Diagrams, Correlation and Regression Lines
- Spearman's Rank Correlation Coefficient, Including Tied Ranks
- Pearson's Correlation Coefficient r: Meaning and GDC Method
- Residuals and the Residual Sum of Squares
- Least Squares Regression Lines on the GDC: y on x and x on y
- Non-Linear Regression and the Coefficient of Determination
What's inside for this topic
6 teacher notes, 69 practice questions, 40 flashcards, 2 quizzes.
Get the full notes, every practice question, flashcards, quizzes and mock papers.
Previous note: Pearson's Correlation Coefficient r: Meaning and GDC Method Next note: Least Squares Regression Lines on the GDC: y on x and x on y
All Applications and Interpretation IB Maths topics · IB Maths