What does goodness of fit mean in context of linear regression

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.

• When you say "the goodness of fit test", which goodness of fit test do you mean? – Glen_b Sep 23 '15 at 0:27
• I was thinking of chi square test. That is the one I have trouble understanding . – Victor Sep 23 '15 at 0:29
• The mention of goodness of fit in relation to regression does not relate to the chi-square test of counts in a contingency table but to something else (possibly several other somethings, depending on what is being said). Perhaps you can give the context in which you saw it mentioned in relation to regression? – Glen_b Sep 23 '15 at 0:31
• Thanks. I read it here:medicine.mcgill.ca/epidemiology/joseph/courses/EPIB-621/fit.pdf – Victor Sep 23 '15 at 0:35
• That document you link to mostly seems to do a decent job of explaining many of the disparate meanings of "goodness of fit" in relation to regression. [It does mention the possibility of constructing a kind of chi-squared test of counts as a way of assessing fit, but then dismisses it; I'd dismiss it for several other reasons]. Either way, it gives a whole list of measures/tests/diagnostics and how they tell you about the fit of the model. Indeed now I've seen it, I'd perhaps be inclined to link to that document as an answer to your question. Perhaps it would bear re-reading] – Glen_b Sep 23 '15 at 0:57