Lesson 8 of 8 · 15 min
The coefficient of determination,
Calculate the coefficient of determination from raw data or from , convert between and , and interpret as the percentage of variation in the response variable explained by the explanatory variable.
What you will be able to do
- Calculate from raw data with technology, or by squaring .
- Find from , using the direction of the association for the sign.
- Interpret in context as the percentage of variation explained.
- Use 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, , measures how much of the variation in the response variable lines up with the explanatory variable through a linear association.
For these 12 students and . The line shows the linear trend. Drag points away from it and drops, because more of the variation in marks is left unexplained.
Definition
Coefficient of determination
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: 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
, 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, . Find the coefficient of determination, .
To calculate from raw data, find with technology and square it — use the unrounded value from the calculator's memory where you can. Some calculators show directly, and in a spreadsheet =RSQ(y-range, x-range) gives it in one step.
Worked example
Calculate and interpret from raw data
Twelve students recorded the hours per week they spent studying for a subject and their exam mark.
| Study (hours per week) | 2 | 3 | 4 | 5 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Exam mark (%) | 52 | 48 | 61 | 55 | 70 | 58 | 66 | 74 | 63 | 81 | 72 | 85 |
(a) Calculate the coefficient of determination, correct to three decimal places.
(b) Interpret it in the context of the data.
Step 1: Calculate r with technology
With study hours as and exam mark as , technology gives
Step 2: Square the unrounded value of r
Squaring the rounded value happens to give here too, but rounding first can change the last decimal place.
Step 3: Write it as a percentage
Step 4: Interpret in context
72.4% of the variation in exam marks can be explained by the variation in hours of study per week. The remaining 27.6% is due to other factors.
Try it yourself first, then check the working one step at a time.
Answer
(a) . (b) 72.4% of the variation in exam marks can be explained by the variation in hours of study per week.
Method
Calculate with technology, then square the unrounded value.
Write as a percentage.
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 but not its sign, because and both equal . Take the sign from the direction of the association.
- for a positive association, − for a negative one
Worked example
Find from
For a sample of used cars of one model, the coefficient of determination between odometer reading and price is . Cars with higher odometer readings tend to sell for less.
(a) Find Pearson's correlation coefficient, .
(b) Describe the strength and direction of the linear association.
Step 1: Take the square root
Step 2: Choose the sign
Price tends to fall as the odometer reading rises, so the association is negative and .
Both and equal 0.5929, so alone can't give the sign. The direction of the association decides it.
Step 3: Describe the association
, which is at least 0.75, so there is a strong negative linear association between odometer reading and price.
Try it yourself first, then check the working one step at a time.
Answer
(a) . (b) A strong negative linear association between odometer reading and price.
Method
.
Take the sign from the direction of the association.
Describe the strength from the size of .
Watch out for
Giving and forgetting that the association is negative.
The scatterplot of a data set shows a positive linear association, and . Find .
Common mistake
Three ways to lose the mark
- Reading as a percentage: does not mean 70% is explained. , so 49% is.
- Reversing the variables: it is the variation in the response explained by the explanatory variable.
- Dropping the sign: with a negative association gives , not .
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,
For a straight-line trend this is exactly . You will meet the trend line properly — the least-squares line — in Bivariate data analysis 2.
Worked example
Choose the better explanatory variable
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.
| House | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| Bedrooms | 2 | 2 | 3 | 3 | 3 | 4 | 4 | 5 |
| Distance to beach (km) | 7.5 | 3.2 | 8.4 | 2.6 | 5.1 | 1.8 | 4.4 | 0.9 |
| Weekly rent ($) | 420 | 470 | 480 | 530 | 560 | 610 | 590 | 680 |
Which variable — number of bedrooms or distance to the beach — explains more of the variation in weekly rent? Justify your answer.
Step 1: Set up the two analyses
Weekly rent is the response variable in both. Compare each explanatory variable, bedrooms and distance to the beach, against rent.
Step 2: Calculate r for each
Bedrooms and rent: , a strong positive linear association.
Distance and rent: , a moderate negative linear association.
Step 3: Convert each to R²
Bedrooms: , so 90.6% of the variation in rent is explained.
Distance: , so 54.3% of the variation in rent is explained.
puts both on the same scale, explained variation, and removes the sign. A negative is not a sign of a weaker association.
Step 4: Compare and decide
The number of bedrooms explains 90.6% of the variation in weekly rent, compared with 54.3% for distance to the beach, so the number of bedrooms explains more of the variation.
Step 5: Comment on reasonableness
The conclusion rests on only eight houses in one city, so a larger sample would make it more reliable. Both variables are associated with rent, and in practice they act together.
Complex unfamiliar questions usually reward a comment on the limitations of the data.
Try it yourself first, then check the working one step at a time.
Answer
The number of bedrooms. It explains about 90.6% of the variation in weekly rent (), compared with about 54.3% for distance to the beach ().
Method
Calculate for each explanatory variable against the same response variable.
Square each to get , and compare the percentages of variation explained.
Compare sizes, not signs.
Comment on the size and source of the sample.
Watch out for
Choosing distance because is "smaller" than , or rejecting it because it is negative. Compare the sizes of , or compare .
For a sample of Queensland wheat farms, the coefficient of determination between annual rainfall (mm) and wheat yield (tonnes per hectare) is . Which statement is correct?
Note
What R² does not tell you
A high shows that a linear association explains much of the variation. It does not show that one variable causes the other, and, like , it is only meaningful when the scatterplot is linear.
Summary
is the proportion of the variation in the response variable that can be explained by the variation in the explanatory variable.
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]".
, with the sign of the direction of the association.
To compare explanatory variables, compare (or the size of ): 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.