Coefficient of Determination (R²)
From r to R²
For a group of students, the correlation between daily screen time ($x$, hours) and hours of sleep ($y$) is $r = -0.7$. Find $R^2$ and interpret it.
Square the correlation coefficient: $R^2 = r^2 = (-0.7)^2 = 0.49$ = $R^2 = 0.49$
Write it as a percent: $0.49 = 49\%$ = 49%
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
Answer: $R^2 = 0.49$: 49% of the variation in sleep is explained by the linear relationship with screen time. Squaring removes the minus sign, so $R^2$ is never negative.
R² from the Sums of Squares
An ice cream shop models daily sales with a regression line on temperature. The total variation of sales is $SS_{\text{tot}} = 80$ and the sum of squared residuals is $SS_{\text{res}} = 12$. Find $R^2$.
Find the part that is not explained: $\frac{SS_{\text{res}}}{SS_{\text{tot}}} = \frac{12}{80} = 0.15$ = 15% is left over
Subtract from 1: $R^2 = 1 - 0.15 = 0.85$ = $R^2 = 0.85$
Interpret: 85% of the variation in daily sales is explained by the linear relationship with temperature = 85% explained
Answer: $R^2 = 1 - \frac{12}{80} = 0.85$, so the line explains 85% of the variation in ice cream sales.
From R² Back to r
A regression of used car price ($y$, thousands of dollars) on age ($x$, years) gives $\hat{y} = -1.5x + 20$ and $R^2 = 0.64$. Find the correlation coefficient $r$.
Take the square root of $R^2$: $\sqrt{0.64} = 0.8$ = $|r| = 0.8$
Choose the sign from the slope: The slope $-1.5$ is negative: older cars are cheaper, so the correlation is negative = $r$ is negative
Write $r$: $r = -\sqrt{0.64} = -0.8$ = $r = -0.8$
Answer: $r = -0.8$. The square root gives $0.8$, and the negative slope tells you the sign. $r$ always has the same sign as the slope.
Calculating R² from Data
Five students recorded hours studied ($x$) and test score ($y$): $(1, 50)$, $(2, 60)$, $(3, 80)$, $(4, 70)$, $(5, 90)$. The regression line is $\hat{y} = 9x + 43$. Calculate $R^2$.
Find the mean of $y$ and $SS_{\text{tot}}$: $\bar{y} = \frac{50+60+80+70+90}{5} = 70$ $SS_{\text{tot}} = (-20)^2 + (-10)^2 + 10^2 + 0^2 + 20^2 = 400 + 100 + 100 + 0 + 400$ = $SS_{\text{tot}} = 1000$
Find the predicted values and residuals: $\hat{y} = 52, 61, 70, 79, 88$ Residuals $y - \hat{y}$: $-2, -1, 10, -9, 2$ = Residuals: $-2, -1, 10, -9, 2$
Find $SS_{\text{res}}$: $4 + 1 + 100 + 81 + 4$ = $SS_{\text{res}} = 190$
Calculate $R^2$: $R^2 = 1 - \frac{190}{1000} = 1 - 0.19 = 0.81$ = $R^2 = 0.81$
Answer: $R^2 = 0.81$: 81% of the variation in test scores is explained by the linear relationship with hours studied. Check: $r = \sqrt{0.81} = 0.9$, which matches the first scatter plot of this lesson.
High R², Wrong Model
The data $(1, 1)$, $(2, 4)$, $(3, 9)$, $(4, 16)$, $(5, 25)$ has the regression line $\hat{y} = 6x - 7$. Calculate $R^2$ and decide whether a straight line is a good model.
Find $SS_{\text{tot}}$: $\bar{y} = 11$, so $SS_{\text{tot}} = 100 + 49 + 4 + 25 + 196$ = $SS_{\text{tot}} = 374$
Find the residuals and $SS_{\text{res}}$: $\hat{y} = -1, 5, 11, 17, 23$, residuals $2, -1, -2, -1, 2$ $SS_{\text{res}} = 4 + 1 + 4 + 1 + 4$ = $SS_{\text{res}} = 14$
Calculate $R^2$: $R^2 = 1 - \frac{14}{374} \approx 0.96$ = $R^2 \approx 0.96$
Look at the pattern of the residuals: Signs: $+, -, -, -, +$. The residuals form a U shape instead of random scatter = The data curves
Answer: $R^2 \approx 0.96$ is very high, but the U-shaped residuals show that the data follows a curve ($y = x^2$). A high $R^2$ alone does not prove the linear model is correct: always check the residuals.
Mistake: Using $r$ as the percent: "$r = 0.5$, so 50% of the variation is explained"
Why: The percent of explained variation comes from $R^2$, not from $r$. You must square first.
Correct: $R^2 = 0.5^2 = 0.25$, so only 25% of the variation is explained.
Mistake: Forgetting the sign when going from $R^2$ back to $r$
Why: $\sqrt{0.49} = 0.7$ is always positive, but $r$ can be negative. $R^2$ hides the direction of the relationship.
Correct: Take the sign from the slope: if the slope is negative, $r = -\sqrt{R^2}$, for example $r = -0.7$.
Mistake: Thinking a high $R^2$ proves that $x$ causes $y$
Why: $R^2$ only measures how well a line fits the data. A confounding variable can drive both $x$ and $y$.
Correct: Say "81% of the variation in $y$ is explained by the linear relationship with $x$", never "$x$ causes 81% of $y$". Causation needs a controlled experiment.
Mistake: Thinking a high $R^2$ means a straight line is the right model
Why: Curved data can still give $R^2 = 0.96$. $R^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.
Sports Analytics
Coaches compare training data with race results to see how much of the difference in performance is linked to training.
If the correlation between weekly training hours and 100 m sprint time is $r = -0.85$, then $R^2 = 0.7225$: about 72% of the variation in sprint times is explained by the linear relationship with training hours.
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.
A model of price on floor area with $R^2 = 0.70$ explains 70% of the price variation; the other 30% comes from location, condition and other factors.
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.
If a higher dose goes with lower blood pressure (negative slope) and $R^2 = 0.36$, then $r = -0.6$: a moderate negative linear relationship.
The coefficient of determination $R^2$ is the share of the variation in $y$ explained by the linear relationship with $x$
For simple linear regression, $R^2 = r^2$, so squaring the correlation coefficient gives $R^2$
$R^2 = 1 - \frac{SS_{\text{res}}}{SS_{\text{tot}}}$ compares the leftover variation with the total variation
$R^2$ is between $0$ and $1$: $R^2 = 0.81$ means 81% of the variation in $y$ is explained
To go back from $R^2$ to $r$, take $\sqrt{R^2}$ and give it the sign of the slope
A high $R^2$ does not prove causation or a correct model: always check the residual plot
Q: Can R² be negative?
A: Not for a least squares regression line like the ones in this lesson: $SS_{\text{res}}$ is never larger than $SS_{\text{tot}}$, so $R^2$ stays between $0$ and $1$. Squaring $r$ also always gives a number that is $0$ or more.
Q: What counts as a good R²?
A: It depends on the field. In physics experiments, values above $0.95$ are common. When studying people (behavior, health, economics), an $R^2$ of $0.30$ can already be useful, because people are affected by many factors.
Q: Is R² always equal to r²?
A: Yes for simple linear regression with one explanatory variable, which is what this lesson covers. With several explanatory variables there is no single $r$, but $R^2 = 1 - \frac{SS_{\text{res}}}{SS_{\text{tot}}}$ still works.
Q: Why does R² say nothing about the direction of the relationship?
A: Because squaring removes the sign: $r = 0.8$ and $r = -0.8$ both give $R^2 = 0.64$. To know the direction, look at the slope of the regression line or at $r$ itself.
Coefficient of Determination (R²)
1 / 14
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.