Coefficient of determination (r²)
By Jude Wallis · Published
The coefficient of determination, r-squared, is the fraction of the variation in the response variable that the regression line explains, from 0 to 1.
(read r squared) is the proportion of the variation in the response variable that is explained by the linear relationship with the explanatory variable . Equivalently, it measures how much of the squared prediction error is removed by using the least-squares line instead of predicting for everyone:
Six students study 1, 2, 3, 4, 5 and 6 hours and score 60, 72, 65, 78, 71 and 86. The least-squares line is . The scores have mean 72, and their squared deviations from 72 sum to 426. The line leaves residuals of -2, 6, -5, 4, -7 and 4, whose squares sum to 146. So : about 66 percent of the variation in scores is explained by the linear relationship with study time, and the other 34 percent is not.
The correlation for these data is , and squaring it returns the same 0.657, which is where the name comes from. Squaring also throws away the sign, so a data set with would report the identical . The statistic reports strength of linear fit and never direction, so quote alongside it whenever direction matters.
What 66 percent does not mean: that 66 percent of the points lie on the line, that study time causes 66 percent of the score, or that predictions from the line are 66 percent accurate. It is a statement about variation and about nothing else.
An close to 1 also does not confirm that a line was the right model. A curved relationship can still produce a high while the residual plot shows an obvious arc, and it is that plot, not the size of , that decides whether a linear model belongs on the data. is also unitless, which makes it easy to compare across settings but useless for saying how wrong a single prediction is likely to be. The standard deviation of the residuals answers that second question, in the units of , and the two statistics are usually reported together.
Where this comes up
More regression and correlation terms, or browse the full statistics glossary.