Checking prediction R squared after changing both value scales
Convert both the actual and predicted lists with the same scale and offset, and the prediction R squared does not change. This guide verifies that with a score of -0.5 and a temperature example.
The same score on two scales
Start with actual values 1, 2, 3 and predictions 2, 3, 4. The squared misses add up to 3, the actual values have a total squared deviation of 2, and R squared is 1 - 3/2 = -0.5. Now multiply both lists by 10 and add 5. The actual values become 15, 25, 35 and the predictions become 25, 35, 45. Each miss is now 10, so the squared misses add up to 300. The actual values deviate from their mean of 25 by -10, 0 and 10, which gives 200. R squared is 1 - 300/200 = -0.5. The page runs both versions through the R squared calculator and gets the same number twice.
Why the offset cancels
Adding a constant b to every actual value and every prediction leaves each difference between them unchanged, since (p + b) - (a + b) = p - a. The numerator, the sum of squared misses, therefore does not change. The mean of the actual values rises by b, and each actual value rises by b as well, so the deviations from the mean are unchanged, and so is the denominator. A shared offset is invisible to the score. This is why you can shift a series to start at zero, express temperatures from a different reference point or subtract a baseline before scoring without altering R squared.
Why a common scale cancels
Multiplying every value by k multiplies each miss by k and each deviation from the mean by k. Squaring turns that into a factor of k squared in both the numerator and the denominator, and the ratio does not move. The factor can be any nonzero number, positive or negative, though unit conversions use positive ones. The score depends only on the ratio of total squared misses to total squared variation, and a common change of units multiplies both by the same amount. This is the reason R squared is described as unitless, unlike mean squared error, which grows by k squared when you change the unit.
A temperature conversion
Celsius to Fahrenheit is a linear conversion, F = 1.8C + 32. Take actual readings of 20, 22 and 24 degrees Celsius and predictions of 21, 23 and 25. The misses are all 1, so the squared misses add up to 3. The actual values deviate from their mean of 22 by -2, 0 and 2, giving 8. R squared is 1 - 3/8 = 0.625. In Fahrenheit the actual values are 68, 71.6 and 75.2, and the predictions are 69.8, 73.4 and 77. Each miss is 1.8, so the squared misses add up to 3 × 3.24 = 9.72. The deviations from the mean of 71.6 are -3.6, 0 and 3.6, giving 25.92. R squared is 1 - 9.72/25.92 = 0.625, unchanged.
Mean squared error does change
The comparison clarifies what R squared adds. In the temperature example the mean squared error is 1 in Celsius and 3.24 in Fahrenheit, because the unit changed the size of every miss. A report that quotes MSE or RMSE must therefore state the unit. R squared removes that dependence by dividing by the spread of the actual values in the same unit. For that reason it is handy for comparing a model across data sets with different units, though it also depends on how spread out the actual values are, so a sample with a narrow range can give a low score even when the misses are small. The same misses of 1 against actual values that vary by only 0.1 would give a very poor score, and against values that vary by 100 would give a score near 1.
Converting only one list breaks the match
The property needs both lists to be converted in the same way. If you convert only the predictions, the misses change and the score changes. Take actual values 1, 2, 3 and multiply only the predictions by 10 after the original 2, 3, 4, which gives 20, 30, 40. The misses are 19, 28 and 37, the squared misses add up to 2,514, and R squared is 1 - 2,514/2 = -1,256. A mismatch of this kind often occurs in practice when a model is trained on a scaled target and its output is compared with the original units without inverting the transformation. The remedy is to apply the inverse conversion to the predictions first, or to convert the actual values with the same rule, and only then score. The huge negative number is a useful alarm: scores far below -1 usually point to a units problem and not to a model that is merely mediocre.
Nonlinear transformations are different
The result holds for linear conversions only. Taking logarithms, square roots or any other curved transformation of both lists changes the relative sizes of the misses and of the deviations, and the score generally changes. A model scored on the log scale and on the original scale will report two different values, and neither is wrong. They answer different questions: one about relative errors and one about absolute errors. When a source reports R squared, check which scale it was computed on before comparing it with your own figure.
Checking your own unit handling
The invariance gives a handy regression test for scoring code and spreadsheets. Take any small pair of lists, compute the score, then apply one linear conversion to both lists and compute again. The two scores should agree to rounding. A mismatch points to a bug, for example a conversion applied to one column only, a constant added after scoring, a mean taken from the converted predictions instead of the converted actual values, or mixed units inside a column. In the Celsius and Fahrenheit example the 0.625 matches in both units, so the check passes. It is worth running whenever data move between systems that store values in different units, because a hidden unit mismatch otherwise shows up only as an unexplained change in a model score.
What an unchanged score means
A score that stays at -0.5 under a change of units shows that the conversion preserved the relationship between predictions and actual values. It does not mean the predictions improved or worsened. The predictions in this example are worse than predicting the mean in both versions. The example carries no threshold for acceptable scores and uses short lists for transparency, so use it to verify unit handling and not to evaluate models.
Reproduce the checks
Original scale
Open the R Squared Calculator and enter:
- Actual
1,2,3- Predicted
2,3,4
Expected output:
R squared
-0.5The score uses the supplied actual variation.
Common converted scale
Open the R Squared Calculator and enter:
- Actual
15,25,35- Predicted
25,35,45
Expected output:
R squared
-0.5The numerator and denominator gain the same squared scale factor.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- Primary definition and convention reference ↗ · 2026-10-08