R-Squared Calculator

R-Squared is evaluated from Actual Y1, Predicted Ŷ1 and Actual Y2. The calculation reports R-Squared, Variance Explained and SS Residuals.

Results

Thanks — we’ve logged this for review.

About the R-Squared Calculator

R-Squared is treated here as a quantitative relation between Actual Y1, Predicted Ŷ1, Actual Y2 and Predicted Ŷ2 and R-Squared, Variance Explained, SS Residuals and SS Total.

The calculator uses a multi formula configuration. Each reported value is read as a direct evaluation of the stored rules with the declared field formats and units.

Formula basis:
R^2 = 1 - (residual sum of squares / total sum of squares)

Interpret the outputs in the order shown by the result fields. Optional inputs affect only the outputs that depend on those variables.

Formula & How It Works

The calculation applies the following relations exactly as recorded in the metadata:

R^2 = 1 - (residual sum of squares / total sum of squares)

Each output field is produced by substituting the supplied inputs into the relevant relation and then applying the declared rounding or text format.

Worked Examples

Example 1: House price model: Actual vs. predicted prices ($K)

Inputs

y1: 250 yh1: 245 y2: 320 yh2: 330 y3: 180 yh3: 190 y4: 450 yh4: 440 y5: 380 yh5: 375 y6: 290 yh6: 295 y7: 510 yh7: 500 y8: 220 yh8: 225
R-Squared: 0.998. Variance Explained: 99.8%. SS Residuals: 500. SS Total: 250,560. RMSE: 7.0711. Interpretation: Excellent fit (>=90% variance explained)

With Actual Y1 = 250, Predicted Ŷ1 = 245, Actual Y2 = 320 and Predicted Ŷ2 = 330 as the stated inputs, the result is R-Squared = 0.998, Variance Explained = 99.8% and SS Residuals = 500. Each value corresponds to the declared output fields.

Example 2: Sales forecast vs. actuals ($M): Monthly data

Inputs

y1: 4.2 yh1: 3.9 y2: 5.1 yh2: 5.3 y3: 3.8 yh3: 4.1 y4: 6.2 yh4: 5.8 y5: 4.9 yh5: 5.2 y6: 5.5 yh6: 5.4
R-Squared: 0.9926. Variance Explained: 99.26%. SS Residuals: 0.48. SS Total: 64.981. RMSE: 0.2191. Interpretation: Excellent fit (>=90% variance explained)

With Actual Y1 = 4.2, Predicted Ŷ1 = 3.9, Actual Y2 = 5.1 and Predicted Ŷ2 = 5.3 as the stated inputs, the result is R-Squared = 0.9926, Variance Explained = 99.26% and SS Residuals = 0.48. Each value corresponds to the declared output fields.

Example 3: Linear regression fit: Advertising spend vs. revenue

Inputs

y1: 100 yh1: 95 y2: 150 yh2: 140 y3: 80 yh3: 90 y4: 200 yh4: 195 y5: 120 yh5: 125 y6: 170 yh6: 165 y7: 90 yh7: 100 y8: 130 yh8: 135 y9: 210 yh9: 205 y10: 160 yh10: 155
R-Squared: 0.9737. Variance Explained: 97.37%. SS Residuals: 475. SS Total: 18,090. RMSE: 6.892. Interpretation: Excellent fit (>=90% variance explained)

With Actual Y1 = 100, Predicted Ŷ1 = 95, Actual Y2 = 150 and Predicted Ŷ2 = 140 as the stated inputs, the result is R-Squared = 0.9737, Variance Explained = 97.37% and SS Residuals = 475. Each value corresponds to the declared output fields.

Example 4: Weather vs. ice cream sales: Poor fit example

Inputs

y1: 50 yh1: 70 y2: 80 yh2: 60 y3: 40 yh3: 65 y4: 90 yh4: 75 y5: 60 yh5: 68
R-Squared: 0.8098. Variance Explained: 80.98%. SS Residuals: 1,714. SS Total: 9,010. RMSE: 13.092. Interpretation: Good fit (70-90% explained)

With Actual Y1 = 50, Predicted Ŷ1 = 70, Actual Y2 = 80 and Predicted Ŷ2 = 60 as the stated inputs, the result is R-Squared = 0.8098, Variance Explained = 80.98% and SS Residuals = 1,714. Each value corresponds to the declared output fields.

Common Use Cases

  • Calculate R-squared from actual and predicted values
  • Evaluate regression model goodness of fit
  • Compare explanatory power of different models