Chapter 2 of 5

Measuring the Errors

How do we know if a line is good or bad?

The gaps between each dot and the line — those are errors (residuals).

4681012Annual Salary (M€)010203040Market Value (M€) -2-2+5-2+5+9+5-2+5+2+8+11+8+14+10

* The true errors are random and unobservable. Residuals are estimates of the true error.


Some errors are positive, some negative. It's difficult to quantify the error magnitude.

4681012Annual Salary (M€)010203040Market Value (M€) -2-2+5-2+5+9+5-2+5+2+8+11+8+14+10
Sum of errors = +73

(If we sum the error, negative errors cancel out positive errors)


What we can do: Square each error. Now they're all positive. We can sum them to measure the error.

4681012Annual Salary (M€)010203040Market Value (M€)

Drag the line. Watch the total squared error change. Can you minimize it?

4681012Annual Salary (M€)010203040Market Value (M€)slopeintercept

SSE: Sum of squared error

Your SSE 0
Best possible: 182

© 2026 Mohammad Iman