Definitionintro
Coefficient of determination
Also called R-squared, adjusted R-squared.
The fraction of the variance of the response that the regression explains, one minus the residual sum of squares over the total sum of squares.
The coefficient of determination of a least squares fit with an intercept is the fraction of the variation of the response around its mean that the fitted values account for: . It lies between 0 and 1, equals the squared correlation between and , and in simple regression equals the squared correlation between and . Adding a predictor never lowers it, so the adjusted divides each sum of squares by its degrees of freedom. measures how much of the spread a linear fit removes in this sample. It does not measure whether the model is right, and a low value does not mean the slopes are 0. The test of that question is the F-test.
Definition
Let be the -vector of responses, an design matrix of rank whose columns include the intercept column , the ordinary least squares fitted values, and the mean of . Define
With an intercept, and , so . Assume . The coefficient of determination is
The adjusted coefficient replaces each sum of squares by its unbiased variance estimate under the model:
With slopes this is , the form in many texts.
Facts. For a model with an intercept:
- . if and only if ; if and only if all fitted slopes are 0, so .
- , the squared multiple correlation coefficient. In simple regression, .
- Adding a column to never increases RSS (the old fit is still available), so never decreases. increases if and only if the t statistic of the new coefficient satisfies , and it can be negative.
- The overall F statistic is a monotone function of : .
- If the errors are iid normal and all slopes are 0, has the Beta law, with mean . So pure noise gives a positive on average, and is the reason is centered near 0 in that case.
Examples and non-examples
Five points. For and : , , the fit is , , so , which is . With and , .
A useless predictor. Add the column , unrelated to the story. RSS drops to 3.5, so rises to 0.65, while falls.
Out-of-sample. The leave-one-out version, with , is for the five points: most of the in-sample 0.64 does not survive prediction of new points. On a test set, can be negative.
The same for four different pictures. In each of Anscombe's four data sets of 11 points, the fitted line is close to and to three digits. One set is a linear cloud, one an exact parabola, one a line with one outlier, and one a vertical stack with a single far point that decides the slope. cannot tell them apart; a plot can.
Range dependence. In simple regression with slope and error variance , the population value is . The same law, sampled over a wider range of , gives a larger . Comparing across studies with different designs compares the designs as much as the models.
Non-example: a fit without an intercept. Fit on through the origin. The slope is and , larger than , so . The decomposition fails because . Many programs then report the uncentered , which compares the fit with the zero model, not with the mean, and is not comparable with an ordinary . Kvålseth (1985) lists eight formulas that agree with an intercept and disagree without it.
Non-example: a large as proof of a good model. A curved relation fitted by a line, trending time series, or many predictors for few points all give a high . A low with a clearly nonzero slope is common when the noise is large, and the slope can still be estimated well.
Related definitions
- Overall F-test. Tests whether all slopes are 0. It is a function of , and ; alone has no level.
- Partial . for a nested pair of models: the fraction of the remaining variation that the added columns remove.
- and the variance inflation factor. The of predictor regressed on the other predictors, with .
- Pseudo-. For a generalized linear model there is no unique analogue; McFadden's and the deviance-based versions are common, and they are not on the same scale as .
- Mean squared error. ; is one minus the ratio of the mean squared error of the fit to that of the constant predictor .
- Cross-validation and information criteria. For model choice, out-of-sample error or the Akaike information criterion penalize size properly; penalizes it weakly.
References
- Tarald O. Kvålseth, Cautionary note about R^2, The American Statistician 39(4), 1985, pp. 279 to 285, The whole paper (the competing formulas for R^2, their disagreement without an intercept, and the recommended definition 1 - RSS/TSS)
- F. J. Anscombe, Graphs in statistical analysis, The American Statistician 27(1), 1973, pp. 17 to 21, The four data sets with the same fitted line and the same correlation but very different shapes
- George A. F. Seber and Alan J. Lee, Linear Regression Analysis, second edition, Wiley, 2003, Chapter 4 (the sums of squares of the fit, the multiple correlation coefficient and the overall F-test)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag DCG94B Edit this page History Report an error Markdown