A line of best fit is a line that best represents the relationship between two variables on a scatterplot. It shows the general trend in the data and analysts frequently use it to make predictions. While individual data points may not lie exactly on the line, the line minimizes the overall distance between itself and the points—usually by minimizing the residual sum of squares (the vertical distances from the points to the line).
Simple linear regression, where one variable predicts another, is the most common method for calculating the line of best fit. In this context, the following equation defines the line:
y = a + bx,
On graphs, statistical convention places the independent variable on the x-axis, and the dependent variable on the y-axis. The slope shows how much the dependent variable is expected to change on average for each unit increase in the independent variable.
This line is useful for identifying trends, understanding relationships, and making estimates. However, only use it for prediction when the relationship appears linear and the underlying assumptions of regression are reasonably met. Additionally, the line of best fit should not be interpreted as showing causality unless the data come from a randomized experiment. It describes association, not cause and effect.
For example, suppose you plot hours studied versus exam scores and find a positive trend—more studying corresponds with higher scores. A line of best fit through the data can help estimate how much a student’s score is expected to improve for each additional hour of study.
