Skip to main content

Stop eyeballing the line of best fit

Put the data in a Desmos table, type a tilde, and Desmos fits the model for you.

2:07 · Two-Variable Data: Models and Scatterplots

Episode 10: Stop eyeballing the line of best fit

Worked in this video

A table of five data points: (1, 12), (2, 15), (3, 21), (4, 24), (5, 33). A line of best fit has the form y = mx + b.

What does the line predict when x = 8, and what is the residual for the point (5, 33)?

On paper you cannot do least squares, so you read m and b off a graph and plug in twice, and each reading can be off. In Desmos, add a table and type the x values in the first column and the y values in the second. Then type y₁ ~ mx₁ + b: the tilde tells Desmos to fit the line, and it prints m = 5.1 and b = 5.7. Type f(x) = 5.1x + 5.7, then f(8) = 46.5. The residual is actual minus predicted: 33 − f(5) = 1.8.

Answer: Prediction 46.5; residual 1.8

    Stop eyeballing the line of best fit — The Desmos Series | UnlimitedTests