Welcome to our third lesson on using regression for interpretation. In our previous session, we moved from the mechanics of calculating OLS coefficients to the art of interpreting them. You learned how to translate each coefficient, , into a specific, quantifiable insight about the marginal effect of one variable while holding others constant. We saw this in action for both the bra-fitting and relationship-management scenarios, uncovering the unique impact of factors like age, quality time, and communication frequency.
Now that we have a model and can interpret what it says, we must ask a critical question: how good is the model? A model's interpretations are only as reliable as the model itself. This lesson directly addresses the learning outcome of evaluating a multiple linear regression model's fit. We will explore two essential diagnostic tools: the coefficient of determination, or R-squared, which tells us about the model's overall explanatory power, and the analysis of residuals, which helps us check if the foundational assumptions of our model are met.
Measuring Explanatory Power: The Coefficient of Determination ()
The first question to ask about a model's fit is, "How much of the puzzle does this model solve?" R-squared, or , provides the answer. It measures the proportion of the total variation in the outcome variable () that is explained by the predictor variables in our model. Its value ranges from 0 to 1, where a value of 1 means the model explains 100% of the variation (a perfect fit) and a value of 0 means it explains none.
To calculate , we must first partition the total variation in our data.
- Total Sum of Squares (SST): This is the total variation of the outcome variable around its mean, . It's what we are trying to explain.
- Residual Sum of Squares (SSR): This is the variation that is not explained by our model. It's the sum of the squared differences between the actual values () and the model's predicted values (). This is the leftover, or residual, variation.
With these two components, the R-squared is simply:
This formula intuitively shows that as our model's errors (SSR) get smaller relative to the total variation (SST), the value approaches 1.
Let's calculate this for our two scenarios using the same 5-observation samples we have been working with.
Numerical Example 1: Bra-Fitting Business
Recall our model:
First, we need to calculate SST. The observed Cup Size Changes () were {1, 0, 2, 3, -1}.
- The mean is .
- The SST is .
Next, we calculate SSR. This requires the predicted values () and residuals () for each client.
| Client | (Prediction) | (Residual) | ||
|---|---|---|---|---|
| 1 (30, 3) | 1 | 0.45 | 0.55 | 0.3025 |
| 2 (25, 1) | 0 | -0.21 | 0.21 | 0.0441 |
| 3 (45, 5) | 2 | 1.55 | 0.45 | 0.2025 |
| 4 (50, 8) | 3 | 2.43 | 0.57 | 0.3249 |
| 5 (22, 2) | -1 | -0.12 | -0.88 | 0.7744 |
| Sum | 0.90 | 1.6484 |
The Residual Sum of Squares is .
Now we can calculate :
Interpretation: Approximately 83.5% of the variation in the required cup size change among these clients is explained by their age and the years since their last fitting. This is a very high , suggesting our model has strong explanatory power for this sample.
The Problem with and the Solution: Adjusted
A known issue with is that it will never decrease when you add a new predictor to the model, even if that predictor is completely irrelevant. This can tempt researchers to add many variables to artificially inflate their .
Adjusted R-squared corrects for this by penalizing the score for each additional predictor. It provides a more honest measure of a model's explanatory power.
The formula is:
where is the number of observations and is the number of predictors.
For our bra-fitting model, , , and .
The adjusted is 67.0%. The significant drop from 83.5% is typical when the sample size () is small, as the penalty for each predictor is more severe. It suggests that with a larger, more robust dataset, the true explanatory power might be closer to this lower value.
Diagnosing the Model: Residual Analysis
A high is encouraging, but it isn't the whole story. The interpretations of our OLS coefficients are only valid if certain assumptions are met. As a statistician, you know these as linearity, independence, homoscedasticity (constant variance), and normality of errors. Residual analysis is our primary tool for checking these assumptions.
The residuals () are the errors of our model. By examining their pattern, we can spot violations of the OLS assumptions. The most common diagnostic is a plot of the residuals against the predicted values ().
- What we want to see: A random, boring scatter of points around the horizontal line at 0, with no discernible shape. This indicates the model is well-behaved.
- What we don't want to see:
- A curve (e.g., a U-shape): Suggests the relationship isn't linear, and we might need to add polynomial terms (like ).
- A funnel or cone shape: Suggests the variance of the errors is not constant (heteroscedasticity). The model is less accurate for some ranges of predictions than others.
Let's perform this analysis conceptually for our relationship scenario.
Numerical Example 2: Polyandrous Relationship Study
Recall our model:
The observed Satisfaction scores () were {7, 5, 4, 9, 6}.
- The mean is .
- The SST is .
Now, let's build our residual table.
| Person | (Prediction) | (Residual) | ||
|---|---|---|---|---|
| A (10, 5) | 7 | 7.71 | -0.71 | 0.5041 |
| B (5, 3) | 5 | 5.66 | -0.66 | 0.4356 |
| C (2, 8) | 4 | 4.12 | -0.12 | 0.0144 |
| D (12, 2) | 9 | 8.72 | 0.28 | 0.0784 |
| E (8, 6) | 6 | 6.80 | -0.80 | 0.6400 |
| Sum | -2.01 | 1.6725 |
First, let's calculate the and adjusted .
An adjusted of 77.4% is quite strong. The model, based on quality time and communication frequency, seems to explain a large portion of the variance in relationship satisfaction.
Now for the residual analysis. We would plot the residuals {-0.71, -0.66, -0.12, 0.28, -0.80} on the y-axis against the predicted values {7.71, 5.66, 4.12, 8.72, 6.80} on the x-axis.
Without plotting, we can still examine the pairs: (), (), (), (), ().
There is no glaring pattern here. The residuals are mostly negative, with one positive. There isn't an obvious funnel or curve. With only five points, a definitive conclusion is impossible, but we see no immediate, dramatic red flags that would invalidate our model's assumptions. In a real research context, you would use a much larger dataset to make these plots more informative.
A quick note: you might have noticed the sum of residuals was not zero in either example. This is because the coefficients we are using were derived from a larger, more complete dataset. When you apply a model to a small subsample of data (or any data other than the exact set used to fit it), the sum of residuals will not be zero. This is expected. For the original dataset that generated the model, the sum of residuals is always exactly zero.
Conclusion
In this lesson, you have learned how to move beyond interpreting coefficients to evaluating the regression model as a whole. You now have the tools to quantify its performance and diagnose potential issues.
Key Takeaways:
- R-squared () measures the proportion of variance in the outcome that your model explains.
- Adjusted R-squared () provides a more honest measure by penalizing the model for having more predictors, making it essential for comparing models with different numbers of variables.
- Residuals () are the model's errors and are the key to diagnostics.
- Analyzing the pattern of residuals versus predicted values is a crucial step to check for violations of OLS assumptions like linearity and homoscedasticity. A high on a model that violates these assumptions can be dangerously misleading.
So far in this module, we have focused entirely on multiple linear regression, where the outcome variable is continuous (like cup size change or a satisfaction score). But many important questions involve binary outcomes—success/failure, purchase/no purchase, good fit/bad fit. Our next lesson will introduce you to a new and powerful tool for precisely these situations as we set up a logistic regression model for a binary outcome, which will become the foundation for building scorecards.