Adjusted R-Squared Penalizes Overfitting by Predictor Count
Adjusted R² is the usual R² with a charge for every predictor you add. For a least squares model with an intercept and d predictors fit on n observations, James, Witten, Hastie, and Tibshirani write it as 1 − [RSS/(n − d − 1)] / [TSS/(n − 1)], where RSS is the residual sum of squares and TSS is the total sum of squares. The ordinary R² is 1 − RSS/TSS, and it has a built-in flaw. When you add a predictor to a least squares fit on the same observations, the training RSS cannot increase, so R² cannot fall. The authors put it more strongly: RSS always decreases as more variables are added, so R² always increases. A model gets credit for every extra knob, including knobs that fit noise.
Adjusted R² fixes this by dividing each sum of squares by its degrees of freedom: RSS by n − d − 1 and TSS by n − 1. Adding a predictor shrinks RSS a little and also shrinks n − d − 1 by one, so the ratio RSS/(n − d − 1) may go up or down. The authors note that maximizing adjusted R² is equivalent to minimizing exactly that ratio. Their intuition: once the correct variables are in, noise variables cut RSS only slightly, but they still raise d, so the statistic falls.
Try it by hand. Take n = 10 observations with TSS = 100, so TSS/(n − 1) = 100/9 = 11.11. Model A has one predictor and RSS = 40. Then R² = 1 − 40/100 = 0.60, and adjusted R² = 1 − (40/8)/11.11 = 1 − 5/11.11 = 0.55. Model B adds a second predictor and trims RSS to 39. Now R² = 0.61, a gain, but adjusted R² = 1 − (39/7)/11.11 = 1 − 5.571/11.11 = 0.499. The extra predictor bought one point of RSS and cost five hundredths of adjusted R². Plain R² applauds it. Adjusted R² says no. These numbers are invented to make the arithmetic easy to follow.
The trap: believing adjusted R² must rise whenever R² does. The example above is a counterexample, and it needs no tricks. Treating adjusted R² as the final word is also a mistake: the authors say that although it is popular and intuitive, it is not as well motivated in statistical theory as AIC, BIC, and Cp.
Prof Rod's rule: use adjusted R² to compare models with different numbers of predictors, then confirm the winner on data it has never seen.