Skip to content

What does R squared tell you

R², the coefficient of determination, tells you the proportion of variance in the dependent variable that is explained by the independent variables in a regression model. It ranges from 0 to 1, with higher values indicating a larger share of explained variation, though it does not guarantee predictive accuracy or imply causation.

Statistics · Regression


What R² Measures

R², also called the coefficient of determination, quantifies how much of the total variability in the response variable is captured by the regression model. It is defined as the ratio of the regression sum of squares (SSR) to the total sum of squares (SST), i.e., R2=SSRSSTR^{2}=\frac{SSR}{SST}. An R² of 0.80 means that 80 % of the observed variation is explained by the predictors, while the remaining 20 % is due to other factors or random error. The metric is unit‑free, making it easy to compare model fit across different data sets.

Worked example: imagine five students with hours studied (X) and test scores (Y) as follows: (1, 65), (2, 70), (3, 78), (4, 85), (5, 90). The mean of Y is 73.6. Compute SST = Σ(Y‑Yˉ\bar{Y})² = (65‑73.6)²+(70‑73.6)²+…+(90‑73.6)² = 560.8. Fit a simple linear regression and obtain predicted scores Y^\hat{Y} = 60 + 6X, giving SSR = Σ(Y^\hat{Y}Yˉ\bar{Y})² = 448.6. Then R2=448.6/560.80.80R^{2}=448.6/560.8\approx 0.80, indicating that 80 % of the score variation is explained by hours studied, leaving 20 % unexplained.

Key points to remember about R²

  • Ranges from 0 to 1 for ordinary least‑squares regression
  • Higher values indicate a larger proportion of explained variance
  • Does not imply causation or guarantee predictive power
  • Can increase simply by adding more predictors, even irrelevant ones

Steps to compute R² from regression output

  1. 1Calculate the total sum of squares: SST = Σ(yiy_iyˉ\bar{y}
  2. 2Calculate the regression sum of squares: SSR = Σ(y^\hat{y}_i‑yˉ\bar{y}
  3. 3Compute R² = SSR / SST
  4. 4Optionally compute unexplained proportion: 1‑R²

Sample data and resulting R²

Hours StudiedTest Score
165
270
378
485
590

Limitations of R²: a high value can arise from over‑fitting, especially when many predictors are included relative to the sample size. R² does not reflect bias in the predictions, nor does it assess whether residuals meet the assumptions of linear regression. For models with non‑linear relationships or categorical outcomes, adjusted R², AIC, BIC, or cross‑validated error provide more reliable assessments of model quality.

Check yourself

If a regression model has R² = 0.64, what percentage of the total variance in the response variable remains unexplained?

Get this as a lesson built for you

Describe what you are studying and Lernex writes the lesson and the questions around it. Free, and it takes about a minute.

Try it

No account needed to try it.

What people ask next