Section 4.4 Lecture: Goodness of Fit Measures
Overview
Brad Hall explains how standard error, R², and adjusted R² assess regression fit and help compare models without mistaking extra predictors for genuine explanatory power. Through apartment-rent, home-tax, sales, and coffee-shop examples, he calculates and interprets fit statistics, demonstrates Excel’s Regression Analysis ToolPak, and connects adjusted R² to the risk of overfitting.
Key takeaways
- For a regression with n observations and k predictors, estimated error variance is SSE/(n − k − 1), and the standard error is its square root; standard error is expressed in the response variable’s units.
- R² measures the proportion of sample response variation explained by a model, while 1 − R² gives the proportion left unexplained.
- Adding predictors cannot reduce ordinary R², so a higher R² alone does not establish that a more complex model is better.
- Adjusted R² penalizes model complexity: in the coffee-shop example, adding drive-through and campus indicators raised R² to 0.9701 while adjusted R² remained high at 0.9589.
- The apartment-size rent model had SSE = 432,000 and SST = 1.8 million, yielding a $120 standard error and R² = 0.76.
- When comparing the traffic and advertising sales models, traffic performed better because it had both higher R², 64% versus 51%, and a smaller standard error.
Chapters
- Sections 4.2 and 4.3 introduced simple regression with one predictor and multiple regression with numerical or dummy-variable predictors.
- Apartment rent models use size, distance from LSU, and a furnished-status dummy variable to illustrate comparing predictors.
- The lecture introduces standard error of the estimate, the coefficient of determination R², and adjusted R².
- A residual is the observed response minus its predicted value, written as y minus ŷ.
- Standard error estimates the typical distance between observed and predicted response values; smaller values indicate a closer fit.
- Calculate estimated error variance as SSE divided by n − k − 1, then take its square root for standard error.
- Standard error uses the response variable’s units, so a rent-model standard error of $120 means predictions typically differ from observed rent by about $120.
- R² ranges from 0 to 1 and represents the proportion of sample variation in the response explained by the regression model.
- Compute R² as SSR/SST or as 1 − SSE/SST; the unexplained proportion is 1 − R².
- For an apartment-rent model with R² = 0.72, the model explains 72% of rent variation and leaves 28% unexplained.
- The simple regression uses apartment size to predict monthly rent, with n = 32, one predictor, SSE = 432,000, and SST = 1.8 million.
- Estimated error variance is 432,000/(32 − 1 − 1) = 14,400 dollars squared, giving a standard error of $120.
- The standard error means observed and predicted monthly rent typically differ by about $120, either above or below.
- R² = 1 − 432,000/1,800,000 = 0.76, so size explains 76% of sample rent variation and 24% remains unexplained.
- Ordinary R² can only stay the same or increase when predictors are added, even if those predictors contribute little useful information.
- Adjusted R² accounts for the number of predictors and can decrease when added variables do not justify their complexity.
- Comparing adjusted R² helps identify a useful balance between too few predictors and an unnecessarily complex model.
- Two simple regression models predict sales, one using traffic and the other advertising as its sole predictor.
- The traffic model explains 64% of sample sales variation, compared with 51% for the advertising model.
- A standard error of 6 means a typical prediction difference of $6,000 because weekly sales are measured in thousands of dollars.
- The traffic model fits better in this comparison because it has both higher R² and lower standard error.
- In Excel’s Data Analysis Regression tool, set annual property taxes as the Y response range and square footage as the X predictor range.
- The fitted equation is predicted taxes = 6,499.41 + 6.81 × size, with the response and coefficients interpreted in dollars.
- Excel reports a standard error of $6,641.92 and R² = 0.5756 for the 20-home example.
- The model explains 57.56% of sample variation in property taxes, leaving 42.44% unexplained.
- Overfitting occurs when a model matches its training sample too closely, potentially achieving R² = 1 without generalizing to new data.
- A model’s purpose is to learn from sample data and make useful predictions for observations it has not seen.
- Adjusted R² helps assess whether additional predictors improve explanatory power enough to offset the penalty for model complexity.
- The first sales model uses advertising alone; Excel reports standard error 5.3944, R² = 0.6376, and adjusted R² ≈ 0.6014.
- The second model adds drive-through and campus-proximity dummy variables, producing standard error 1.7321, R² = 0.9701, and adjusted R² = 0.9589.
- R² rises to 97.01%, while adjusted R² remains close at 95.89%, indicating that the added predictors provide substantial explanatory value.
- The expanded model supports the previously calculated $37,000 sales prediction and illustrates that strong fit measures evaluate model fit, while statistical significance is addressed in the next section.
Transcript excerpt
0:01 Hey everyone, this is section 4.4 on goodness of fit measures. To motivate the section, we'll talk about how we got here from sections 4.2 and 4.3. Remember in those sections that we talked about simple and multiple linear regression where simple was simply having one predictor variable to try to predict a response variable and 4.3 dealt with multiple linear uh linear regression where we had more than one predictor variable where as we mentioned in that section we could have numerical variables or we can also use dummy variables to represent categorical variables. So in those two sections we estimated uh regression equations, we found their coefficients and we use these equations
0:51 ultimately to make predictions. But one thing we didn't answer is how well the model actually predicts the observed data. How well does our linear regression model actually fit what we observe? We talked about this a bit using the correlation coefficient all the way back in section 4.1, but we're going to add some other measures as well that give us a really more in-depth idea of how these models associate with the observed data. And so we call these measures goodness of fit measures, hence the namesake of the section. So to work our way up to this, we'll go off of that example we were talking about before where the first thing we
1:39 did was we tried to predict the price of rent for an apartment around LSU by first considering simply the square footage i.e. the size as one predictor. So in this case, model one would be a simple regression equation because it only has one predictor variable. Models two and three would be multiple linear regression because they deal with two here or three here. So model two only looks at size and
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Brad Hall.