GOODNESS OF FIT
R-Squared Calculator
Calculate the coefficient of determination from observed and predicted values. This page uses R² = 1 − SSE/SST with an explicit constant-target convention; it does not refit a regression model.
YOUR DATA
Enter observed and predicted values
Paste paired numeric columns or upload a CSV/TSV file. Use a period as the decimal mark. Up to 5 MB and 5,000 observations are accepted.
The file is read locally in your browser.
YOUR RESULTS
Observed versus predicted fit
Errors by observation
Error = predicted − observed.
| Row | Observed | Predicted | Error |
|---|
Formula and convention
SSE = Σ(observed − predicted)². SST = Σ(observed − mean observed)². When SST is greater than zero, R² = 1 − SSE/SST. R² may be negative when predictions are worse than using the observed mean as a baseline.
When all observed values are identical, SST is zero and R² is undefined for this calculator, even if the predictions match exactly. This avoids treating a zero-variation target as a regularised perfect score.
Interpretation and limitations
R² is relative to the observed values and the specific evaluation sample. It is not the percentage of outcomes caused by the predictors, a probability that the model is correct, or a guarantee of performance on future data. Compare R² only when the target, observations and evaluation procedure are comparable.
What R² cannot tell you
- It does not show average error in the target’s original units; use RMSE or MAE for error scale.
- It can be high when predictions are systematically biased or when important errors occur in a small group.
- It does not establish causality, statistical significance or generalisation.