Coefficient of Determination Explained with Worked Examples

The coefficient of determination is , the fraction of the variation in explained by the regression. For a straight-line fit it equals the square of the correlation, .

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Coefficient of determination means

Take , . The mean of is 4, so . The slope is , and the residual sum of squares is . Hence , and , the correlation (the correlation coefficient) of the data.

So 60% of the variation of is explained by and 40% is left in the residuals (the residual variance of a simple regression). The line itself is the least-squares line (the regression line, least squares). The same decomposition is the ANOVA table (ANOVA).

never decreases when predictors are added, so for model comparison use adjusted or information criteria (AIC and BIC). A high does not prove a causal link or that the straight-line model is right: always look at residuals. For several predictors see multiple regression.

What is it used for?

R squared tells what fraction of the variation in y is explained by the fitted model.

How to use coefficient of determination

  1. Compute .
  2. Fit the line and compute .
  3. Form .
  4. For simple regression check .

Graph

Data and the fitted line y = 2.2 + 0.6x, R² = 0.6mean point (3, 4)012345601234567Data and the fitted line y = 2.2 + 0.6x, R² = 0.6xyfitted lineGraph with x from 0 to 6 and y from 0 to 7. Shows data (5); the curve fitted line; point mean point (3, 4) at (3, 4).

The line passes through the mean point and explains 60% of the variation.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: R²

Find for , .

Worked example
Answer
0.60.6
  1. SST
  2. SSE
  3. R²

Example 2: residual sum of squares

Find from , , .

Worked example
Answer
2.42.4
  1. Formula

Example 3: the correlation

Find from , , .

Worked example
Answer
0.77460.7746
  1. Formula

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

SSE = 20, SST = 100

R² = 1 − 0.2

0.8.

r = 0.9

R² = r²

0.81.

Data (1,1), (2,2), (3,4)

fit y = −0.667 + 1.5x

SSE = 0.1667.

R² for that fit

1 − 0.1667/4.6667

0.9643.

Word problems

R² = 1 − SSE/SST is the fraction of variation in y explained by the fit. For simple linear regression R² = r².

From sums of squares

SSE = 20, SST = 100. Find R².

  1. 1 − 0.2
  2. Check: ✓0.8

From correlation

r = 0.9. Find R².

  1. 0.81
  2. Check: ✓0.81

SSE of a fit Higher

Residuals 1/6, −1/3, 1/6. Find SSE.

  1. 1/36 + 1/9 + 1/36
  2. Check: ✓0.1667

R² Higher

SST = 14/3. Find R².

  1. 1 − (1/6)/(14/3)
  2. Check: ✓0.9643

Common mistakes

R² = r

wrong ✗

R² = r² ✓

Square.

Higher R² means causal

wrong ✗

only fit ✓

No causation.

SSE/SST

unexplained ✗

1 − SSE/SST ✓

Explained.

Negative R²

possible with no intercept ✗

otherwise ≥ 0 ✓

Check model.

Exam tips

  1. R² = 1 − SSE/SST.
  2. = r² for one predictor.
  3. 0 to 1.
  4. Adding predictors raises R².
  5. Plot residuals.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. R² for SSE 5, SST 50 Foundation

0.9

2. R² for r = 0.5 Foundation

0.25

3. R² for SSE 30, SST 120 Foundation

0.75

4. R² for r = −0.8 Higher

0.64

5. R² for SSE 0, SST 10 Higher

1

6. R² for SSE 12, SST 15 Higher

0.2

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Coefficient of determination
R².
SSE
Sum of squared residuals.
SST
Total sum of squares.
Residual
Observed − fitted.
Explained variation
1 − SSE/SST.
Correlation (r)
Linear association.

Frequently asked questions

What is R²?

The fraction of variance explained.

How is it calculated?

1 − SSE/SST.

How is it related to r?

R² = r² for one predictor.

Does a high R² prove a good model?

No; check residuals.

Which page covers correlation?

correlation coefficient.

Which page covers multiple regression?

multiple regression.

More in Advanced statistics and stochastic processes and the formula sheets.