Coefficient of Determination Formula

Coefficient of determination is the proportion of the total variation in the response variable y that is explained by the linear relationship with the explanatory variable x.

The Formula

r2=1−SSresidualSStotal=1−∑(yi−y^i)2∑(yi−yˉ)2

Ask yourself: Am I reporting the fraction of y's variation explained by the linear model (a 0-to-1 number), not the slope or the correlation's sign?

Quick example

Correlation between study hours and test score: r=0.9. r2=0.81 Interpretation: 81% of the variation in test scores is explained by the linear relationship with study hours.

Notation

r2 ranges from 0 to 1. SStotal = total sum of squares. SSresidual = residual sum of squares.

What this formula means

The proportion of the total variation in the response variable y that is explained by the linear relationship with the explanatory variable x. It equals the square of the correlation coefficient: r2.

The total variation in y is a pie. The regression line claims the slice it can explain, r2, and the residuals keep the rest, 1−r2. A thin slice means x explains little; a nearly whole pie means the points hug the line. The pie says how much is explained, never which way the line tilts.

Formal view

r2=1−SSresSStot=1−∑(yi−y^i)2∑(yi−yˉ)2 where 0≤r2≤1

Worked examples

Example 1

medium
A regression model has SST=500 (total variation) and SSE=125 (unexplained variation). Calculate R2 and interpret its meaning.
Show solution

Answer

R2=0.75. The model explains 75% of variation in y.

First step

1.
R2=1−SSESST=1−125500=1−0.25=0.75

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Free: full solutions on 3 topics a day. No card.

Every topic, every day: the Family plan

Example 2

hard
Two models predict house prices: Model 1 (size only): R2=0.60. Model 2 (size + neighborhood + age): R2=0.85. Explain what the increase in R2 means and what caution should be applied with multi-variable R2.

Example 3

medium
A model has SST=1200 and r2=0.7. Find the explained sum of squares SSR and the residual SSE.

Common mistakes

  • Reporting r when the question asks for r2 - square the correlation; r=0.7 gives r2=0.49, not 0.7.
  • Reading r2 as causation - it measures explained variation, never that x causes y.
  • Letting r2 go negative or above 1 - it's a proportion between 0 and 1, so any value outside that range is an error.

Why this formula matters

A slope says how fast y changes; r2 says how much that trend matters next to everything else affecting y. Two studies can find the same slope with r2=0.9 and r2=0.1: in the first x predicts y well, in the second it barely helps. Without r2, a weak but real trend can be presented as a strong predictor.

Frequently asked questions

What is the Coefficient of Determination formula?

The proportion of the total variation in the response variable y that is explained by the linear relationship with the explanatory variable x. It equals the square of the correlation coefficient: r2.

How do you use the Coefficient of Determination formula?

Use r2 when a question asks what fraction or percent of the variation in y is explained by x, or how well a line fits overall. Square r, or compute 1−SSresidualSStotal, and state it as a percent of the variation in y. If the question asks about direction, use the sign of r or of the slope. If it asks how much y changes per unit of x, that is the slope b. If it asks about one point's miss, that is a residual.

What do the symbols mean in the Coefficient of Determination formula?

r2 ranges from 0 to 1. SStotal = total sum of squares. SSresidual = residual sum of squares.

Why is the Coefficient of Determination formula important in Math?

A slope says how fast y changes; r2 says how much that trend matters next to everything else affecting y. Two studies can find the same slope with r2=0.9 and r2=0.1: in the first x predicts y well, in the second it barely helps. Without r2, a weak but real trend can be presented as a strong predictor.

What do students get wrong about Coefficient of Determination?

The procedure for coefficient of determination is the easy part; the trap is reporting r when the question asks for r2. Asking "Am I reporting the fraction of y's variation explained by the linear model (a 0-to-1 number), not the slope or the correlation's sign?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

What should I learn before the Coefficient of Determination formula?

Before studying the Coefficient of Determination formula, you should understand: correlation, linear regression lsrl, residuals.