DoesWhatAnswersSlangEmojisCalculatorsTriviaPlayBlog

Trivia Questions and Weird Facts

Math

What Is a Regression Line?

Short answerA regression line is the straight line that best fits a set of data points, letting you predict one variable from another. It is drawn where the total squared distance from the points is smallest, described by y = mx + b, where m is the slope and b the intercept.

People usually mean one of two things here: the line on a scatter plot that sums up a trend, or the equation behind it. The short answer is that it is the single straight line that comes closest to all your dots at once. Close is measured by squaring the vertical gaps between each dot and the line, then adding them up. The line that makes that total as small as possible wins. That is why stats folks call it the least squares line.

What does the regression line formula mean?

The line is written as y = mx + b. Here m is the slope, which tells you how much y changes when x goes up by one. The b is the intercept, the value of y when x is zero. Swap in stats notation and it shows up as y = a + bx, which is the same thing wearing a different hat.

How do you find the regression line?

For a simple line you need the slope and the intercept:

Doing that by hand is fine for small sets. A calculator handles it faster, which is why the site has one.

Regression line example

Say you track hours studied and test scores for five students:

Hours (x)Score (y)
150
255
365
470
580

Run the numbers and you get a slope of about 7.5 and an intercept of about 42.5, so the line is y = 7.5x + 42.5. Study 4 hours and the line predicts a score near 72.5.

What does the regression line not tell you?

It shows a pattern, not a cause. Two things can move together without one making the other happen. It also only describes the range of your data. Predicting far outside that range is a stretch. A famous version of this is Anscombe's quartet, four datasets that look nearly identical in summary numbers but plot very differently. The lesson: always look at the dots.

Do the math: open the regression calculator

Keep going