Lesson 8 of 8 · 15 min

The coefficient of determination, R2R^2

Calculate the coefficient of determination from raw data or from rr, convert between rr and R2R^2, and interpret R2R^2 as the percentage of variation in the response variable explained by the explanatory variable.

What you will be able to do

  • Calculate R2R^2 from raw data with technology, or by squaring rr.
  • Find rr from R2R^2, using the direction of the association for the sign.
  • Interpret R2R^2 in context as the percentage of variation explained.
  • Use R2R^2 to compare how well different explanatory variables account for the same response.

Exam marks vary from student to student. Some of that variation lines up with how many hours each student studied; the rest comes from everything else — sleep, what they already knew, the questions on the day.

The coefficient of determination, R2R^2, measures how much of the variation in the response variable lines up with the explanatory variable through a linear association.

Interactive

How much is explained?

For these 12 students r=0.851r = 0.851 and R2=0.724R^2 = 0.724. The line shows the linear trend. Drag points away from it and R2R^2 drops, because more of the variation in marks is left unexplained.

Coefficient of determination
R2=r2R^2 = r^2

Definition

Coefficient of determination

R2R^2 is the proportion of the variation in the response variable that can be explained by the variation in the explanatory variable.

  • It lies between 0 and 1, so it is often written as a percentage: R2=0.724R^2 = 0.724 is 72.4%.
  • It is never negative, because it is a square.
  • The closer it is to 1 (100%), the more of the variation the linear association explains.

Key idea

The interpretation to write

R2=0.724R^2 = 0.724, so 72.4% of the variation in exam marks can be explained by the variation in hours of study.

The other 27.6% of the variation is due to other factors. Always name the response variable first and the explanatory variable second.

For a data set, r=0.85r = 0.85. Find the coefficient of determination, R2R^2.

To calculate R2R^2 from raw data, find rr with technology and square it — use the unrounded value from the calculator's memory where you can. Some calculators show r2r^2 directly, and in a spreadsheet =RSQ(y-range, x-range) gives it in one step.

Worked example

Calculate and interpret R2R^2 from raw data

  • Complex familiar
  • Technology active

Twelve students recorded the hours per week they spent studying for a subject and their exam mark.

Study (hours per week)234556789101112
Exam mark (%)524861557058667463817285

(a) Calculate the coefficient of determination, correct to three decimal places.

(b) Interpret it in the context of the data.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Calculate rr with technology, then square the unrounded value.

  2. Write R2R^2 as a percentage.

  3. Interpret it as the percentage of variation in the response variable explained by the variation in the explanatory variable.

Watch out for

  • Writing "72.4% of the variation in study hours is explained by exam marks". The response variable (marks) comes first.

Going the other way, a square root gives the size of rr but not its sign, because 0.820.8^2 and (−0.8)2(-0.8)^2 both equal 0.640.64. Take the sign from the direction of the association.

  • for a positive association, − for a negative one
r=±R2r = \pm\sqrt{R^2}

Worked example

Find rr from R2R^2

  • Simple familiar
  • Technology active

For a sample of used cars of one model, the coefficient of determination between odometer reading and price is R2=0.5929R^2 = 0.5929. Cars with higher odometer readings tend to sell for less.

(a) Find Pearson's correlation coefficient, rr.

(b) Describe the strength and direction of the linear association.

3 steps

Try it yourself first, then check the working one step at a time.

Method

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

  2. Take the sign from the direction of the association.

  3. Describe the strength from the size of rr.

Watch out for

  • Giving r=0.77r = 0.77 and forgetting that the association is negative.

The scatterplot of a data set shows a positive linear association, and R2=0.36R^2 = 0.36. Find rr.

Common mistake

Three ways to lose the mark

  • Reading rr as a percentage: r=0.7r = 0.7 does not mean 70% is explained. R2=0.49R^2 = 0.49, so 49% is.
  • Reversing the variables: it is the variation in the response explained by the explanatory variable.
  • Dropping the sign: R2=0.64R^2 = 0.64 with a negative association gives r=−0.8r = -0.8, not 0.80.8.

The marks scatter widely around their mean (dashed) but much less around the trend line. The trend accounts for 72.4% of the variation.

Why "explained variation"?

Without knowing a student's study hours, your best single guess for their mark is the mean, about 65.4. The marks scatter widely around that dashed line: this spread is the total variation in marks.

Knowing the hours, you can guess from the trend line instead, and the marks scatter much less around it. The spread that is left is the unexplained variation. Measuring each spread by adding the squared vertical distances,

R2=1−variation around the trend linevariation around the mean=1−396.81436.9≈0.724.R^2 = 1 - \frac{\text{variation around the trend line}}{\text{variation around the mean}} = 1 - \frac{396.8}{1436.9} \approx 0.724.

For a straight-line trend this is exactly r2r^2. You will meet the trend line properly — the least-squares line — in Bivariate data analysis 2.

Worked example

Choose the better explanatory variable

  • Complex unfamiliar
  • Technology active

A property manager in Townsville wants to understand weekly rents. For eight houses she recorded the number of bedrooms, the distance to the beach and the weekly rent.

HouseABCDEFGH
Bedrooms22333445
Distance to beach (km)7.53.28.42.65.11.84.40.9
Weekly rent ($)420470480530560610590680

Which variable — number of bedrooms or distance to the beach — explains more of the variation in weekly rent? Justify your answer.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Calculate rr for each explanatory variable against the same response variable.

  2. Square each to get R2R^2, and compare the percentages of variation explained.

  3. Compare sizes, not signs.

  4. Comment on the size and source of the sample.

Watch out for

  • Choosing distance because −0.737-0.737 is "smaller" than 0.9520.952, or rejecting it because it is negative. Compare the sizes of rr, or compare R2R^2.

For a sample of Queensland wheat farms, the coefficient of determination between annual rainfall (mm) and wheat yield (tonnes per hectare) is R2=0.64R^2 = 0.64. Which statement is correct?

Choose one answer

Note

What R² does not tell you

A high R2R^2 shows that a linear association explains much of the variation. It does not show that one variable causes the other, and, like rr, it is only meaningful when the scatterplot is linear.

Summary

  • R2=r2R^2 = r^2 is the proportion of the variation in the response variable that can be explained by the variation in the explanatory variable.

  • R2R^2 lies between 0 and 1 and is often written as a percentage. It is never negative.

  • Interpret it as "[R² as a percentage] of the variation in [response] can be explained by the variation in [explanatory]".

  • r=±R2r = \pm\sqrt{R^2}, with the sign of the direction of the association.

  • To compare explanatory variables, compare R2R^2 (or the size of rr): the larger it is, the more variation is explained.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 8 of 80% read

Save your progress with a free account