How to find the line of best fit
- Paste your data with one x, y pair per line. Commas, spaces or tabs between the two numbers all work, so two columns copied from a spreadsheet paste straight in. A header row is skipped.
- Read the equation y = mx + b, the slope, the intercept, the correlation coefficient r and r², with the points and the line plotted.
- Optionally type an x value to predict y. The residuals table shows how far each point is from the line.
Reading the result
For the sample data the line is y = 2.02x − 0.02 and r is 0.999: y rises by about 2 for each step in x, almost perfectly in a line. The standard error of the estimate is the typical size of a residual, in the same units as y, which is often more useful than r² for judging whether predictions are good enough.
When a straight line is the wrong model
Least squares always finds a line, even for data that curves. Look at the scatter plot and the residuals: if they bend in a U shape or fan out as x grows, the relationship isn’t linear and r can be misleading. A single far-off point can also pull the line a long way, so check outliers with the quartile calculator before trusting the slope.