Goodness of Fit – What Does Goodness of Fit Mean in the Context of Linear Regression

goodness of fit

I am having trouble understanding the concept of 'goodness of fit' w.r.t linear regression. The name suggests that the goodness of fit test is used to determine how well a model fits the data.

But the linear model is already the 'best' fit since we have minimized the sum of the squared error terms. Why do we need to test 'goodness of fit' again? We know it is a good fit because we minimized the sum of the squared errors.

Best Answer

You're right in that you've found the line that best fits the data (in the sense of least squares), but the best line may still not be a good fit

enter image description here

In this case I can do better with a third degree curve

enter image description here