Unit 9, lesson 68

Comparing Regression Models and Multicollinearity

How to compare nested models with the partial F test and adjusted R-squared, how the variance inflation factor measures coefficient uncertainty due to multicollinearity, and what identifiability and model selection mean.

  • Video 68
  • Multiple Regression and Model Building

A regression with one predictor usually leaves some variation in the response unexplained. Adding a second predictor and refitting by least squares on the same data lowers the residual sum of squares, or at worst leaves it unchanged. Does that make the larger model better? This lesson compares nested models with the partial F test and with adjusted R-squared, explains why closely related predictors make individual coefficients unstable or impossible to separate, and shows what searching through many candidate models does to the conclusions drawn afterward.

Key terms

Nested models

Definition A model is nested in a larger model when every mean function the smaller model allows is also allowed by the larger one. For linear models of the same response this holds when the column space of the smaller design matrix lies inside the column space of the larger one, for example when the smaller model is the larger one with some coefficients set to zero. Write SSE\text{SSE} for the residual sum of squares of a least-squares fit. For nested least-squares fits of the same response on the same observations,

SSElarger≤SSEsmaller,\text{SSE}_{\text{larger}} \le \text{SSE}_{\text{smaller}} ,

so with the same total sum of squares SST\text{SST} in both, the larger model’s R2=1−SSE/SSTR^2 = 1 - \text{SSE}/\text{SST} is at least as large as the smaller model’s.

In plain words The larger model can reproduce the smaller fit by setting its extra coefficients to zero, so on the data used for fitting its squared error is never larger. That improvement is guaranteed by algebra, which is why a drop in SSE\text{SSE} or a rise in R2R^2 is not, on its own, evidence that the added term describes anything real.

Example The straight-line model β0+β1x\beta_0 + \beta_1 x is nested in the quadratic model β0+β1x+β2x2\beta_0 + \beta_1 x + \beta_2 x^2, which gives the line when β2=0\beta_2 = 0. The models β0+β1x1\beta_0 + \beta_1 x_1 and β0+β2x2\beta_0 + \beta_2 x_2 with two different predictors are in general not nested in each other, and a model for YY cannot be compared in this way with a model for log⁡(Y/y0)\log(Y/y_0), whose residuals are on a different scale. If adding a predictor with missing values silently drops records, the two fits no longer use the same observations and their values of SSE\text{SSE} cannot be compared.

Partial F test

Definition Let model 1 have p1p_1 coefficients, counting the intercept, and let model 0 be model 1 with qq of those coefficients set to zero, so it has p0=p1−qp_0 = p_1 - q. Fit both by least squares to the same nn observations of the same response, with design matrices of full column rank and n>p1n > p_1. To test H0H_0, that the qq omitted coefficients are all zero, against H1H_1, that at least one of them is not, compute

F=(SSE0−SSE1)/qSSE1/(n−p1).F = \frac{(\text{SSE}_0 - \text{SSE}_1)/q}{\text{SSE}_1/(n - p_1)} .

Suppose the mean function of model 1 is correct and, given the predictors, the errors are independent and normal with mean 00 and a common variance. Then under H0H_0 the statistic has the Fq, n−p1F_{q,\, n - p_1} distribution, large values count against H0H_0, and the p-value is the probability that an Fq, n−p1F_{q,\, n - p_1} variable is at least the observed FF. When q=1q = 1 the statistic equals the square of the tt statistic for the added coefficient in model 1, and the F test agrees with the two-sided tt test.

In plain words The numerator is the drop in squared error per added coefficient, and the denominator estimates the error variance from the larger model. Under H0H_0 each added term is expected to remove about one error variance of squared error, so values near 11 are ordinary. The word partial means the extra terms are judged with the smaller model’s terms kept in place. Testing a block of terms jointly answers a different question from scanning their separate p-values and keeping the smallest one.

Example Twelve observations have SST=100\text{SST} = 100. Model A has 22 coefficients and SSE=40\text{SSE} = 40, and model B adds one coefficient and has SSE=30\text{SSE} = 30. Then

F=(40−30)/130/9=3.F = \frac{(40 - 30)/1}{30/9} = 3 .

If the classical conditions hold, the p-value with 11 and 99 degrees of freedom is P(F1,9≥3)≈0.117P(F_{1,9} \ge 3) \approx 0.117. At a significance level of 0.050.05 chosen in advance, H0H_0 is not rejected. That does not show that the added coefficient is zero or that model A is true. It says only that these twelve observations do not give clear evidence of the added term’s contribution.

Adjusted R-squared

Definition Consider a least-squares model with an intercept and pp coefficients in all, fitted to n>pn > p observations with SST>0\text{SST} > 0. Let s2=SSE/(n−p)s^2 = \text{SSE}/(n - p) be its estimate of the error variance and sy2=SST/(n−1)s_y^2 = \text{SST}/(n - 1) the sample variance of the response. The adjusted R-squared is

Rˉ2=1−s2sy2,\bar{R}^2 = 1 - \frac{s^2}{s_y^2} ,

or equivalently

Rˉ2=1−(1−R2) n−1n−p.\bar{R}^2 = 1 - (1 - R^2)\,\frac{n - 1}{n - p} .

It never exceeds R2R^2, and it is negative when s2>sy2s^2 > s_y^2. For two nested models fitted to the same observations, Rˉ2\bar{R}^2 is higher for the larger model exactly when the partial F statistic comparing them is greater than 11, and the two values are equal when F=1F = 1.

In plain words Ordinary R2R^2 compares sums of squares, which never favor the smaller of two nested models. Adjusted R2R^2 compares variance estimates, dividing each sum of squares by its degrees of freedom, so an added coefficient has to reduce SSE\text{SSE} by enough to make up for the residual degree of freedom it uses. It describes fit to the data at hand with a penalty for size. It does not estimate the error on new data and is not a general rule for choosing a model.

Example For the twelve observations, sy2=100/11s_y^2 = 100/11. Model C adds one more coefficient to model B and has SSE=29\text{SSE} = 29.

ModelppSSE\text{SSE}R2R^2Rˉ2\bar{R}^2
A2240400.600.600.560.56
B3330300.700.70≈0.6333\approx 0.6333
C4429290.710.710.601250.60125

Going from B to C raises R2R^2 but lowers Rˉ2\bar{R}^2, in line with the partial F statistic (30−29)/(29/8)≈0.276(30 - 29)/(29/8) \approx 0.276, which is below 11.

Multicollinearity

Definition Multicollinearity means that a predictor is close to a linear combination of the other predictors in the data. For a numerical predictor xjx_j in a least-squares model with an intercept, regress xjx_j on the other predictors, with an intercept, and call the R2R^2 of this auxiliary regression Rj2R_j^2. When Rj2<1R_j^2 < 1 the variance inflation factor is

VIF⁡j=11−Rj2.\operatorname{VIF}_j = \frac{1}{1 - R_j^2} .

If the errors are uncorrelated with common variance σ2\sigma^2, the estimate bjb_j of the coefficient of xjx_j has, given the predictor values,

Var⁡(bj)=σ2SjjVIF⁡j,\operatorname{Var}(b_j) = \frac{\sigma^2}{S_{jj}} \operatorname{VIF}_j ,

where SjjS_{jj} is the sum of squared deviations of xjx_j from its mean. So VIF⁡j\operatorname{VIF}_j is the factor by which this variance exceeds its value when xjx_j is uncorrelated with the other predictors, with σ2\sigma^2 and SjjS_{jj} unchanged, and VIF⁡j\sqrt{\operatorname{VIF}_j} is the factor for the standard error.

In plain words When predictors move together in the data, the data say a lot about their combined association with the response and little about how to divide it among them. Individual coefficients then have inflated standard errors, and their values and even their signs can change a lot with small changes in the data, while fitted values for profiles like those in the data can stay stable. A VIF measures uncertainty, not bias. A coefficient with VIF 1010 is not ten times too large, and a rule-of-thumb cutoff is no substitute for asking why the predictors are related.

Example If Rj2=0.9R_j^2 = 0.9, then VIF⁡j=1/0.1=10\operatorname{VIF}_j = 1/0.1 = 10, and the standard error of bjb_j is 10≈3.16\sqrt{10} \approx 3.16 times what it would be with Rj2=0R_j^2 = 0, other things equal. With Rj2=0.5R_j^2 = 0.5 the factor on the variance is 22 and on the standard error 2≈1.41\sqrt{2} \approx 1.41.

Identifiability

Definition A parameter of a model is identifiable when different values of it always give different distributions of the observable data. In a linear regression with design matrix XX the data depend on the coefficient vector β\beta only through the mean vector XβX\beta and the error distribution, so the coefficients are identifiable exactly when the columns of XX are linearly independent. Under perfect collinearity some column is an exact linear combination of the others, distinct coefficient vectors give the same fitted values, and least squares has infinitely many solutions. Some combinations of the coefficients can still be identifiable.

In plain words If two settings of the coefficients make exactly the same predictions for every possible record of this kind, no amount of such data can tell them apart. Software usually drops a column or reports a missing estimate. More data with the same exact relation does not help. Data in which the relation fails, or a restriction chosen in advance, can.

Example Suppose x2=2x1x_2 = 2x_1 in every record of a model with an intercept. Then

β1x1+β2x2=(β1+2β2) x1,\begin{aligned} &\beta_1 x_1 + \beta_2 x_2 \\[0.4em] &\quad = (\beta_1 + 2\beta_2)\, x_1 , \end{aligned}

so only the combination β1+2β2\beta_1 + 2\beta_2 enters the fitted values. The pairs (β1,β2)=(2,1)(\beta_1, \beta_2) = (2, 1) and (4,0)(4, 0) both give 4x14x_1, which at x1=0,1,2,3x_1 = 0, 1, 2, 3 equals 00, 44, 88 and 1212 either way. The data identify β1+2β2\beta_1 + 2\beta_2 but not β1\beta_1 and β2\beta_2 separately.

Model selection

Definition Model selection is the use of data to choose among candidate models, for example by deciding which predictors, interactions or curved terms to include. The selection procedure is everything that was tried, such as tests, criteria and plots, together with the rule for picking a model. Standard p-values and confidence intervals assume a model fixed before the data were seen. When the model is chosen by searching the same data, they generally lose their stated properties, because they ignore the uncertainty of the selection itself.

In plain words Start from what the model is for. For prediction, judge the whole procedure, search included, on observations not used to fit or choose the model. For explaining an association, choose adjustment variables from knowledge of the design and the subject. Dropping a confounder because its p-value is large changes what the remaining coefficients mean. Record what was searched and label findings of the search as exploratory unless new data or a method that accounts for the selection confirms them, as with multiple testing.

Example Suppose 2020 candidate predictors are unrelated to the response and each is tested at the 0.050.05 level. If the 2020 tests were independent, the probability that at least one comes out significant would be

1−0.9520≈0.64.1 - 0.95^{20} \approx 0.64 .

Reporting only the winner, with its p-value below 0.050.05, makes the result of a search look like a confirmed finding.

Check yourself

  1. In a regression with an intercept, regressing the predictor x3x_3 on the other predictors gives R2=0.75R^2 = 0.75. Find VIF⁡3\operatorname{VIF}_3 and the factor by which the standard error of b3b_3 exceeds its value for an uncorrelated predictor. A colleague concludes that b3b_3 is four times too large. Is that right?
Show the answer

The variance inflation factor is 1/(1−0.75)=41/(1 - 0.75) = 4, so the sampling variance of b3b_3 is four times, and its standard error 4=2\sqrt{4} = 2 times, what it would be if x3x_3 were uncorrelated with the other predictors, with the same error variance and the same spread of x3x_3. The colleague is wrong. The VIF describes how much b3b_3 would vary from sample to sample, not whether it is too large. If the linear model is correct, b3b_3 is still unbiased, but for a given estimate of the error variance a confidence interval for β3\beta_3 is twice as wide as it would be in the uncorrelated comparison.

  1. For n=11n = 11 observations with SST=100\text{SST} = 100, a model with 33 coefficients has SSE=40\text{SSE} = 40, and a model that adds one coefficient to it has SSE=35\text{SSE} = 35. Find R2R^2 and Rˉ2\bar{R}^2 for both models and the partial F statistic. Why do the adjusted values agree?
Show the answer

The values of R2R^2 are 1−40/100=0.601 - 40/100 = 0.60 and 1−35/100=0.651 - 35/100 = 0.65. With sy2=100/10=10s_y^2 = 100/10 = 10, the adjusted values are 1−(40/8)/10=0.51 - (40/8)/10 = 0.5 and 1−(35/7)/10=0.51 - (35/7)/10 = 0.5. The partial F statistic is

F=(40−35)/135/7=1.F = \frac{(40 - 35)/1}{35/7} = 1 .

The drop in SSE\text{SSE}, which is 55, exactly equals the larger model’s residual mean square, also 55, and F=1F = 1 is precisely the case in which adjusted R2R^2 neither rises nor falls. Under the classical assumptions, P(F1,7≥1)≈0.351P(F_{1,7} \ge 1) \approx 0.351, so these data give no clear evidence for the added term, which is not the same as evidence that its coefficient is zero.

  1. A model with an intercept uses predictors x1x_1 and x2x_2, and every record has x2=x1+5x_2 = x_1 + 5. Since x2x_2 is not a multiple of x1x_1, someone expects all three coefficients to be identifiable. Are they? Which combinations are identified?
Show the answer

They are not. Substituting gives

β0+β1x1+β2(x1+5)=(β0+5β2)+(β1+β2) x1.\begin{aligned} &\beta_0 + \beta_1 x_1 + \beta_2 (x_1 + 5) \\[0.4em] &\quad = (\beta_0 + 5\beta_2) \\[0.4em] &\qquad + (\beta_1 + \beta_2)\, x_1 . \end{aligned}

The columns of the design matrix are linearly dependent, since x2−x1−5⋅1=0x_2 - x_1 - 5 \cdot 1 = 0 in every record. For example, the coefficient vectors (β0,β1,β2)=(1,2,1)(\beta_0, \beta_1, \beta_2) = (1, 2, 1) and (6,3,0)(6, 3, 0) both give 6+3x16 + 3x_1. When x1x_1 takes at least two different values, the identified quantities are β0+5β2\beta_0 + 5\beta_2, β1+β2\beta_1 + \beta_2 and their linear combinations. The condition concerns linear dependence among all the columns, the intercept column included, not only whether one predictor is a multiple of another.

How this lesson connects