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 y=a+bx, 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^=a+bx ("y hat") for every x. The real y is usually a bit different.

residual ei=yi−(a+bxi)=observed−predicted

  • 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

  1. Predict: put each x into the line to get y^.
  2. Subtract: observed minus predicted, y−y^.
  3. 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 y=11.40+1.980x:

x24578101113
y1519222429303536
residual−0.36−0.320.70−1.261.76−1.201.82−1.14

👀 Watch me do it: the residual at x = 8

What I writeWhy I do it
Predicted 11.40+1.980×8=27.24Step 1.
Residual 29−27.24=1.76Step 2: observed minus predicted.
Positive: the point is above the lineStep 3: sign check.

Diagram: The observed point (8, 29) sits above the line, which predicts 27.24.

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, 29−27.24=1.76, 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 y=3.5+0.8x. 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.

Log in · Subscribe · Start free trial

All notes in Correlation and regression (SL 4.4, 4.10; AHL 4.13)

  1. Scatter Diagrams, Correlation and Regression Lines
  2. Spearman's Rank Correlation Coefficient, Including Tied Ranks
  3. Pearson's Correlation Coefficient r: Meaning and GDC Method
  4. Residuals and the Residual Sum of Squares
  5. Least Squares Regression Lines on the GDC: y on x and x on y
  6. 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.

Start your free 7-day trial

Questions? Chat with us on WhatsApp · Try one live lesson

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