Coefficient of determination
R²
How much of the total variation a fitted line accounts for: 1 minus the residual sum of squares over the total sum of squares.
R²=0.8
R² equals 1 minus (2 divided by 10), equals 1 minus 0.2, equals 0.8
Den här sidan finns på svenska. Byt till svenska
Definition — what does that mean?
How much of the variation in y a model explains. 1 means every point sits on the line; 0 means the line explains nothing.
In Swedish: Determinationskoefficient
R²
How much of the total variation a fitted line accounts for: 1 minus the residual sum of squares over the total sum of squares.
R²=0.8
R² equals 1 minus (2 divided by 10), equals 1 minus 0.2, equals 0.8
You are given
SStot is the total sum of squares, how far the y-values lie from their mean, squared and
added up. SSres is the residual sum of squares, how far they lie from the model’s line.
R² is the share of the total that the model removes.
Five points: (1, 2), (2, 3), (3, 5), (4, 4), (5, 6). The mean of y is 4, and the least squares line is y = 1.3 + 0.9x.
The line explains 81% of the variation in y.
For a straight line fitted by least squares, R² is the square of the correlation coefficient: here r = 0.9 and 0.9² = 0.81. R² loses the sign, so a strongly falling relationship and a strongly rising one both give an R² close to 1.
Can R² be negative?
Not for a least squares line with a constant term. For a model forced through the origin, or tested on new
data, it can: the model then does worse than simply guessing the mean.
| Solve for | Rearranged | With the numbers | Comes to |
|---|---|---|---|
| R² | 1 | 1 | 0.8 |
| SSres | SStot(1 | 10(1 | 2 |
| SStot | SSres1 | 21 | 10 |
Last reviewed October 6, 2026 ·How pages are reviewed
Statistics and probabilityAll formulas
Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.