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 for the residual sum of squares of a least-squares fit. For nested least-squares fits of the same response on the same observations,
so with the same total sum of squares in both, the larger model’s 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 or a rise in is not, on its own, evidence that the added term describes anything real.
Example The straight-line model is nested in the quadratic model , which gives the line when . The models and with two different predictors are in general not nested in each other, and a model for cannot be compared in this way with a model for , 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 cannot be compared.
Partial F test
Definition Let model 1 have coefficients, counting the intercept, and let model 0 be model 1 with of those coefficients set to zero, so it has . Fit both by least squares to the same observations of the same response, with design matrices of full column rank and . To test , that the omitted coefficients are all zero, against , that at least one of them is not, compute
Suppose the mean function of model 1 is correct and, given the predictors, the errors are independent and normal with mean and a common variance. Then under the statistic has the distribution, large values count against , and the p-value is the probability that an variable is at least the observed . When the statistic equals the square of the statistic for the added coefficient in model 1, and the F test agrees with the two-sided 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 each added term is expected to remove about one error variance of squared error, so values near 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 . Model A has coefficients and , and model B adds one coefficient and has . Then
If the classical conditions hold, the p-value with and degrees of freedom is . At a significance level of chosen in advance, 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 coefficients in all, fitted to observations with . Let be its estimate of the error variance and the sample variance of the response. The adjusted R-squared is
or equivalently
It never exceeds , and it is negative when . For two nested models fitted to the same observations, is higher for the larger model exactly when the partial F statistic comparing them is greater than , and the two values are equal when .
In plain words Ordinary compares sums of squares, which never favor the smaller of two nested models. Adjusted compares variance estimates, dividing each sum of squares by its degrees of freedom, so an added coefficient has to reduce 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, . Model C adds one more coefficient to model B and has .
| Model | ||||
|---|---|---|---|---|
| A | ||||
| B | ||||
| C |
Going from B to C raises but lowers , in line with the partial F statistic , which is below .
Multicollinearity
Definition Multicollinearity means that a predictor is close to a linear combination of the other predictors in the data. For a numerical predictor in a least-squares model with an intercept, regress on the other predictors, with an intercept, and call the of this auxiliary regression . When the variance inflation factor is
If the errors are uncorrelated with common variance , the estimate of the coefficient of has, given the predictor values,
where is the sum of squared deviations of from its mean. So is the factor by which this variance exceeds its value when is uncorrelated with the other predictors, with and unchanged, and 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 is not ten times too large, and a rule-of-thumb cutoff is no substitute for asking why the predictors are related.
Example If , then , and the standard error of is times what it would be with , other things equal. With the factor on the variance is and on the standard error .
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 the data depend on the coefficient vector only through the mean vector and the error distribution, so the coefficients are identifiable exactly when the columns of 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 in every record of a model with an intercept. Then
so only the combination enters the fitted values. The pairs and both give , which at equals , , and either way. The data identify but not and 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 candidate predictors are unrelated to the response and each is tested at the level. If the tests were independent, the probability that at least one comes out significant would be
Reporting only the winner, with its p-value below , makes the result of a search look like a confirmed finding.
Check yourself
- In a regression with an intercept, regressing the predictor on the other predictors gives . Find and the factor by which the standard error of exceeds its value for an uncorrelated predictor. A colleague concludes that is four times too large. Is that right?
Show the answer
The variance inflation factor is , so the sampling variance of is four times, and its standard error times, what it would be if were uncorrelated with the other predictors, with the same error variance and the same spread of . The colleague is wrong. The VIF describes how much would vary from sample to sample, not whether it is too large. If the linear model is correct, is still unbiased, but for a given estimate of the error variance a confidence interval for is twice as wide as it would be in the uncorrelated comparison.
- For observations with , a model with coefficients has , and a model that adds one coefficient to it has . Find and for both models and the partial F statistic. Why do the adjusted values agree?
Show the answer
The values of are and . With , the adjusted values are and . The partial F statistic is
The drop in , which is , exactly equals the larger model’s residual mean square, also , and is precisely the case in which adjusted neither rises nor falls. Under the classical assumptions, , so these data give no clear evidence for the added term, which is not the same as evidence that its coefficient is zero.
- A model with an intercept uses predictors and , and every record has . Since is not a multiple of , someone expects all three coefficients to be identifiable. Are they? Which combinations are identified?
Show the answer
They are not. Substituting gives
The columns of the design matrix are linearly dependent, since in every record. For example, the coefficient vectors and both give . When takes at least two different values, the identified quantities are , 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.