R-squared
R-squared is the share of the variation in y explained by the model: 1 - (residual sum of squares / total sum of squares). For a straight line with one predictor it equals r squared.
Last updated
Analogy
If R-squared is 0.6, the line accounts for 60 percent of why the y values differ.
Example
Total SS = 6Residual SS = 0.64+0.36+1+0.36+0.04 = 2.4R-squared = 1 - 2.4/6 = 0.60Also r squared = 0.77^2 = 0.60
In practice
It tells you how useful a model is for prediction, but not whether it is correct.
Practice
Flashcards
- What is R-squared for one predictor?r squared: the share of variation in y explained.
Interview questions
- For the points (1,2), (2,4), (3,5), (4,4), (5,5), find the least squares line and R-squared.
- Means 3 and 4
- Slope Sxy / Sxx = 6 / 10 = 0.6
- Intercept = 4 - 1.8 = 2.2
- R-squared = 0.60
- Residuals sum to zero
Questions people ask
Does a high R-squared mean the model is good?
Not necessarily. A model can have a high R-squared and still be wrong in form, as residual plots may show. Adding more predictors always raises R-squared, even useless ones, so adjusted R-squared, which penalises extra predictors, is used for comparing models.
What is a good R-squared value?
It depends on the field. Physics experiments may reach 0.99, while predicting human behaviour with 0.2 or 0.3 can still be useful. Judge R-squared against what is realistic for the problem, and against how the model will be used, since a rough guide may be enough for one task and useless for another.