Compute the regression R2 from the decomposition of the dependent variable's variation into explained, total and residual sums of squares.
The idea
The variation in the dependent variable Y is measured by the total sum of squares (TSS), the sum of squared deviations of Y from its mean. It splits into two parts: the explained sum of squares (ESS), the variation captured by the fitted values, and the residual sum of squares (SSR), the variation left in the errors. When the regression includes an intercept, the explained and residual parts add up exactly to the total: TSS = ESS + SSR. R² is the explained share of the total and lies between 0 and 1: R² = ESS ÷ TSS = 1 − SSR ÷ TSS. TSS depends only on Y, so it does not change when regressors are added to the same sample, while SSR cannot rise and ESS cannot fall. With n observations and k regressors, the standard error of regression is SER = √[SSR ÷ (n − k − 1)]. Mean squares in an ANOVA table are sums of squares divided by their degrees of freedom, so convert them back to sums of squares before computing R².
Formulas
R² from the sums of squares
R² = 1 − SSR ÷ TSS
- SSR
- the residual sum of squares
- TSS
- the total sum of squares of Y around its mean
Regression with an intercept, so TSS = ESS + SSR and R² also equals ESS ÷ TSS. The trap is using mean squares from an ANOVA table without converting them back to sums.
Standard error of the regression
SER = √[SSR ÷ (n − k − 1)]
- SSR
- the residual sum of squares
- n
- the number of observations
- k
- the number of regressors
Run in reverse it recovers SSR = SER² × (n − k − 1), which with TSS = (n − 1) × variance of Y gives R².
A practice question
Which expression gives the R2 of an OLS regression with an intercept in terms of the explained (ESS), residual (SSR) and total (TSS) sums of squares?
- ESS/SSRWhy not: Compares explained to unexplained variation, which is not bounded by 1; the denominator should be the total.
- SSR/TSSWhy not: This is the unexplained fraction, 1 - R2.
- ESS/TSS, which equals 1 - SSR/TSS - correct
- 1 - ESS/TSSWhy not: This also gives the unexplained fraction rather than R2; it mixes the two forms of the formula.
With an intercept, TSS = ESS + SSR. R2 is the explained fraction of total variation, ESS/TSS, or equivalently 1 - SSR/TSS.
A harder one
An output table reports an explained sum of squares of 63 and a residual sum of squares of 147. The total sum of squares is not shown. The R2 is closest to:
- 0.70Why not: Reports the unexplained fraction SSR/TSS.
- 0.43Why not: Uses the explained to residual ratio and does not build TSS = ESS + SSR.
- 2.33Why not: Inverts the explained to residual ratio, which is neither R2 nor bounded by 1.
- 0.30 - correct
TSS = ESS + SSR = 63 + 147 = 210. R2 = 63/210 = 0.30.
The hardest tier
A regression has R2 = 0.64 and an explained sum of squares of 160. Adding two explanatory variables to the same sample reduces the residual sum of squares by 10. The new R2 is closest to:
- 0.67Why not: Treats the 10 as a reduction in the total sum of squares, which does not change when regressors are added.
- 0.68 - correct
- 0.50Why not: Divides the residual sum of squares by ESS instead of TSS.
- 0.74Why not: Adds 10 percentage points to R2, mixing a sum-of-squares change with a ratio.
TSS = ESS/R2 = 160/0.64 = 250, so SSR = 90. After adding the variables SSR = 80; TSS is unchanged. R2 = 1 - 80/250 = 0.68.
In the app: 6 practice questions on this outcome, spaced review that brings it back before you forget it.
Start free →More in Regression with Multiple Explanatory Variables
- Contrast the assumptions made in single regression with those made in multiple regression.
- Explain how the coefficients of a multiple regression should be read.
- Interpret the goodness-of-fit measures R2 and adjusted-R2 for both single and multiple regressions.
- Test several regression coefficients together with joint hypothesis tests, build confidence intervals for them, and interpret the findings.