From the course: SQL for Statistics Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Minimizing error

Minimizing error - PostgreSQL Tutorial

From the course: SQL for Statistics Essential Training

Start my 1-month free trial

Minimizing error

- [Instructor] Now that we have discussed the basics of linear regression, we can see that figuring out how to draw the line through the data points is a key challenge. So how do we do that? Let's look at a simple example, a plot of just two points. So we can draw a line between the two points, so our regression line looks like this. Well that was easy, but what if we add a third point? In this case the third point is on the same line, so we don't have to make any changes to our line. But what if we add points that don't fall on the line? In this example, we have two points that are below the line. There is no straight line that will pass through all five points. So what we settle for is a line that passes as close as possible to all of the points. With a line that is close to all the points, we can measure the distance from each point to the regression line. If we add up the length of each of these distances, we can have a measure of how well the regression line fits the data. We…

Contents