📐 Mathematics · Topic 192 of 200

Line of Best Fit

A line that summarises a trend in scattered data.

Interactive labDrag the sliders and hover over the graph

About this topic

A line of best fit (regression line) summarises the trend in a scatterplot as y = mx + b. The least-squares method chooses the line that minimises the sum of squared vertical distances from the points. Use it to predict values within the data range (interpolation) and with caution beyond it (extrapolation).

The slope m tells how much y changes for each one-unit increase in x, and the intercept b is the predicted y when x is zero, which may not be meaningful. The line always passes through the point of the two means. The residual, actual minus predicted, shows the error at each point, and a random scatter of residuals suggests a line is a suitable model.

Example: if y = 2.5x + 40 predicts a test score from hours studied, then 4 hours predicts 50, and each extra hour adds 2.5 points. Predicting for 40 hours gives 140, which is absurd, showing the danger of extrapolation.

Applications include forecasting sales, estimating house prices and calibrating instruments. Tips: label the slope with units, remember that a high r-squared means the line explains much of the variation, and never use a line for data that clearly curve.

Key ideas

  1. Minimises the total squared errors
  2. Use it to predict values
  3. Residuals measure the misses

Quick check

Use cases: where Line of Best Fit helps

Number and algebra skills are used in science, engineering, budgeting and computing.

Frequently asked questions

What is Line of Best Fit?

A line that summarises a trend in scattered data.

What will I learn in Line of Best Fit?

Minimises the total squared errors. Use it to predict values. Residuals measure the misses.

Is Line of Best Fit part of Mathematics?

Yes. It is one of 200 Mathematics topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.

Does the Line of Best Fit lab work on a phone or tablet?

Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.

How should I study Line of Best Fit?

Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.

Do I need an account, and is my progress saved?

No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.

More in Mathematics