Back to Lesson

Teacher Guide: Coefficient of Determination (R²)

Learn what R² tells you about a regression line, how to calculate it from r or from sums of squares, and why a high R² does not prove causation.

Use this lesson with your class

Free, no student accounts needed.

Share with students

Students open the lesson and practise with instant feedback.

Printable worksheet

All practice problems on paper, with a separate answer key.

Class quiz

10 questions on Regression. Students join with a name, you see everyone's score.

For Teachers

Learning Objectives
  • Calculate R2R^2 from the correlation coefficient using R2=r2R^2 = r^2
  • Calculate R2R^2 from SSresSS_{\text{res}} and SStotSS_{\text{tot}} using R2=1−SSresSStotR^2 = 1 - \frac{SS_{\text{res}}}{SS_{\text{tot}}}
  • Interpret R2R^2 in context as the percent of variation in yy explained by the linear relationship with xx
  • Find rr from R2R^2 using the sign of the slope
  • Explain why a high R2R^2 does not prove causation or a correct model, and use residuals to check the fit
Prerequisites
  • • Correlation Coefficient: what rr measures and why −1≤r≤1-1 \le r \le 1
  • • Linear Regression: finding and using a line of best fit y^=mx+b\hat{y} = mx + b
  • • Residuals: observed minus predicted values and residual plots
  • • Scatter Plots and squaring decimals, square roots and percents
Discussion Starters
  • 1. Two models have R2=0.64R^2 = 0.64, one with r=0.8r = 0.8 and one with r=−0.8r = -0.8. How are they the same and how are they different?
  • 2. Why do you think we square the residuals before adding them instead of just adding them?
  • 3. If a model has R2=0.30R^2 = 0.30, is it useless? When could it still be helpful?
  • 4. Ice cream sales and sunburns have a high R2R^2. Does ice cream cause sunburn? What else could explain it?
  • 5. How could curved data still give a high R2R^2 for a straight line?
Common Misconceptions

R2R^2 is the percent of points that lie on the regression line

Remediation: Show a data set where no point is exactly on the line but R2=0.81R^2 = 0.81. Explain that R2R^2 compares leftover variation with total variation, it does not count points.

R2=rR^2 = r, so an rr of 0.70.7 means 70% is explained

Remediation: Have students compute 0.72=0.490.7^2 = 0.49 and compare 49% with 70%. Repeat with r=0.3r = 0.3 (R2=0.09R^2 = 0.09) to show how quickly the explained share drops.

A high R2R^2 means xx causes yy and the line is the correct model

Remediation: Use the curved data set y=x2y = x^2 (high R2R^2, U-shaped residuals) and a confounding example such as ice cream and sunburns. Ask students what R2R^2 cannot see.

Differentiation Ideas

For Struggling Students:

  • • Start with R2=r2R^2 = r^2 only, using a calculator for the squares
  • • Use a sentence frame: "___% of the variation in ___ is explained by the linear relationship with ___"
  • • Give SSresSS_{\text{res}} and SStotSS_{\text{tot}} directly before asking students to compute them

For On-Level Students:

  • • Calculate SStotSS_{\text{tot}}, SSresSS_{\text{res}} and R2R^2 for small data sets of 5 points
  • • Go from R2R^2 back to rr using the sign of the slope
  • • Compare two models of the same data and decide which explains more variation

For Advanced Students:

  • • Show that SStot=SSres+SSregSS_{\text{tot}} = SS_{\text{res}} + SS_{\text{reg}} for the least squares line and that R2=SSregSStotR^2 = \frac{SS_{\text{reg}}}{SS_{\text{tot}}}
  • • Explore how one outlier changes R2R^2
  • • Fit a curve to the data y=x2y = x^2 and compare its R2R^2 and residuals with the straight line
Standards Alignment
  • HSS.ID.C.8 (CCSS.MATH.CONTENT.HSS.ID.C.8)

    Compute (using technology) and interpret the correlation coefficient of a linear fit

  • HSS.ID.B.6.B (CCSS.MATH.CONTENT.HSS.ID.B.6.B)

    Informally assess the fit of a function by plotting and analyzing residuals

  • HSS.ID.C.9 (CCSS.MATH.CONTENT.HSS.ID.C.9)

    Distinguish between correlation and causation

Lesson Resources
  • visualStrong vs Weak Fit Scatter Plots

    Two scatter plots with trend lines and residuals: one with r=0.9r = 0.9 (R2=0.81R^2 = 0.81) and one with r=0.3r = 0.3 (R2=0.09R^2 = 0.09)

  • activityExplained or Not?

    Students collect class data (arm span and height, shoe size and test score), find R2R^2 with a calculator and argue which relationship is stronger

  • worksheetR² Practice

    Convert between rr and R2R^2, calculate R2R^2 from sums of squares and write interpretations in context

Lesson Content

Everything students see: definition, examples, common mistakes, applications. Tap to open.

Definition

The coefficient of determination, written R2R^2, tells you how much of the variation in the response variable yy is explained by the linear relationship with the explanatory variable xx.
For simple linear regression (one xx, one yy), it is the square of the correlation coefficient:
R2=r2R^2 = r^2
It can also be calculated from two sums of squares:
R2=1−SSresSStotR^2 = 1 - \frac{SS_{\text{res}}}{SS_{\text{tot}}}
  • SStot=∑(yi−yˉ)2SS_{\text{tot}} = \sum (y_i - \bar{y})^2 is the total variation of the yy-values around their mean
  • SSres=∑(yi−y^i)2SS_{\text{res}} = \sum (y_i - \hat{y}_i)^2 is the variation that is left over after using the regression line (the sum of squared residuals, written SSR in the Residuals lesson)
R2R^2 is always between 00 and 11. If R2=0.81R^2 = 0.81, then **81% of the variation in yy is explained by the linear relationship with xx**, and the other 19% is not explained by the line.

Worked Examples

For a group of students, the correlation between daily screen time (xx, hours) and hours of sleep (yy) is r=−0.7r = -0.7. Find R2R^2 and interpret it.
1

Square the correlation coefficient

R2=r2=(−0.7)2=0.49R^2 = r^2 = (-0.7)^2 = 0.49 → R2=0.49R^2 = 0.49
2

Write it as a percent

0.49=49%0.49 = 49\% → 49%
3

Interpret in context

49% of the variation in hours of sleep is explained by the linear relationship with screen time. The other 51% comes from other factors. → 49% explained, 51% not explained

Common Mistakes

Using rr as the percent: "r=0.5r = 0.5, so 50% of the variation is explained"

Why it's wrong: The percent of explained variation comes from R2R^2, not from rr. You must square first.

Correct: R2=0.52=0.25R^2 = 0.5^2 = 0.25, so only 25% of the variation is explained.

Forgetting the sign when going from R2R^2 back to rr

Why it's wrong: 0.49=0.7\sqrt{0.49} = 0.7 is always positive, but rr can be negative. R2R^2 hides the direction of the relationship.

Correct: Take the sign from the slope: if the slope is negative, r=−R2r = -\sqrt{R^2}, for example r=−0.7r = -0.7.

Thinking a high R2R^2 proves that xx causes yy

Why it's wrong: R2R^2 only measures how well a line fits the data. A confounding variable can drive both xx and yy.

Correct: Say "81% of the variation in yy is explained by the linear relationship with xx", never "xx causes 81% of yy". Causation needs a controlled experiment.

Thinking a high R2R^2 means a straight line is the right model

Why it's wrong: Curved data can still give R2=0.96R^2 = 0.96. R2R^2 does not show patterns in the residuals.

Correct: Always look at the residual plot. Random scatter supports the line; a U shape or another pattern means a different model fits better.

Why It Matters

Once you have a regression line, the next question is: how good is it? R2R^2 answers this with one number.
  • Science: researchers report R2R^2 to show how well a model describes their measurements
  • Business: analysts compare sales models and keep the one that explains more of the variation
  • Sports: coaches check how much of the variation in sprint times is explained by training hours
  • Medicine: doctors see how strongly a dose is linked to a change in blood pressure
Knowing what R2R^2 does not say is just as important: a high R2R^2 does not prove that xx causes yy, and it does not prove that a straight line is the right model. You still need to look at the residuals.

Real World Applications

Sports Analytics

Coaches compare training data with race results to see how much of the difference in performance is linked to training.

Example:

If the correlation between weekly training hours and 100 m sprint time is r=−0.85r = -0.85, then R2=0.7225R^2 = 0.7225: about 72% of the variation in sprint times is explained by the linear relationship with training hours.

1Try It Yourself

For a swimming club, the correlation between weekly training hours and 50 m race time is r=−0.9r = -0.9.

What is R2R^2? Give it as a decimal.

Step 1: Write the mathematical expression

Square the correlation coefficient:

Real Estate Pricing

Real estate analysts build regression models for house prices and use $R^2$ to judge whether a model is good enough to use for valuations.

Example:

A model of price on floor area with R2=0.70R^2 = 0.70 explains 70% of the price variation; the other 30% comes from location, condition and other factors.

2Try It Yourself

For a model of apartment prices on floor area, the total variation is SStot=500SS_{\text{tot}} = 500 and the sum of squared residuals is SSres=75SS_{\text{res}} = 75 (both in squared thousands of dollars).

What is R2R^2? Give it as a decimal.

Step 1: Write the mathematical expression

Use R2=1−SSresSStotR^2 = 1 - \frac{SS_{\text{res}}}{SS_{\text{tot}}}:

Medicine and Dosage

In clinical studies, researchers check how strongly the dose of a medicine is linked to a change in a measurement such as blood pressure.

Example:

If a higher dose goes with lower blood pressure (negative slope) and R2=0.36R^2 = 0.36, then r=−0.6r = -0.6: a moderate negative linear relationship.

3Try It Yourself

A study finds that a higher dose goes with lower blood pressure. The regression line has a negative slope and R2=0.64R^2 = 0.64.

What is the correlation coefficient rr?

Step 1: Write the mathematical expression

Take the square root and choose the sign from the slope:

Key Takeaways

  • 1The coefficient of determination R2R^2 is the share of the variation in yy explained by the linear relationship with xx
  • 2For simple linear regression, R2=r2R^2 = r^2, so squaring the correlation coefficient gives R2R^2
  • 3R2=1−SSresSStotR^2 = 1 - \frac{SS_{\text{res}}}{SS_{\text{tot}}} compares the leftover variation with the total variation
  • 4R2R^2 is between 00 and 11: R2=0.81R^2 = 0.81 means 81% of the variation in yy is explained
  • 5To go back from R2R^2 to rr, take R2\sqrt{R^2} and give it the sign of the slope
  • 6A high R2R^2 does not prove causation or a correct model: always check the residual plot

Frequently Asked Questions

Can R² be negative?

Not for a least squares regression line like the ones in this lesson: SSresSS_{\text{res}} is never larger than SStotSS_{\text{tot}}, so R2R^2 stays between 00 and 11. Squaring rr also always gives a number that is 00 or more.

What counts as a good R²?

It depends on the field. In physics experiments, values above 0.950.95 are common. When studying people (behavior, health, economics), an R2R^2 of 0.300.30 can already be useful, because people are affected by many factors.

Is R² always equal to r²?

Yes for simple linear regression with one explanatory variable, which is what this lesson covers. With several explanatory variables there is no single rr, but R2=1−SSresSStotR^2 = 1 - \frac{SS_{\text{res}}}{SS_{\text{tot}}} still works.

Why does R² say nothing about the direction of the relationship?

Because squaring removes the sign: r=0.8r = 0.8 and r=−0.8r = -0.8 both give R2=0.64R^2 = 0.64. To know the direction, look at the slope of the regression line or at rr itself.

Glossary

Coefficient of determination (R2R^2)
The share of the variation in yy that is explained by the linear relationship with xx; a number from 00 to 11
Total sum of squares (SStotSS_{\text{tot}})
∑(yi−yˉ)2\sum (y_i - \bar{y})^2: the total variation of the yy-values around their mean
Sum of squared residuals (SSresSS_{\text{res}}, also SSR)
∑(yi−y^i)2\sum (y_i - \hat{y}_i)^2: the variation left over after using the regression line
Residual
The difference between an observed and a predicted value: yi−y^iy_i - \hat{y}_i
Explained variation
The part of the total variation in yy that the regression line accounts for: SStot−SSresSS_{\text{tot}} - SS_{\text{res}}

Formula Card

R² from r

R2=r2R^2 = r^2

For simple linear regression, square the correlation coefficient

R² from sums of squares

R2=1−SSresSStotR^2 = 1 - \frac{SS_{\text{res}}}{SS_{\text{tot}}}

One minus the share of the variation that is left over

Total sum of squares

SStot=∑(yi−yˉ)2SS_{\text{tot}} = \sum (y_i - \bar{y})^2

Squared distances of the y-values from their mean

Sum of squared residuals

SSres=∑(yi−y^i)2SS_{\text{res}} = \sum (y_i - \hat{y}_i)^2

Squared distances of the y-values from the regression line

r from R²

r=±R2r = \pm\sqrt{R^2}

Use the sign of the slope of the regression line

More in This Topic