R Squared Calculator
How much of the variation your model explains — R² from observed and predicted values, with the adjusted version that penalises extra predictors.
R² = 1 − SS_residual ÷ SS_total.
How the r squared calculator works
R² = 1 − SS_residual ÷ SS_total. It compares your model against the simplest possible one — always predicting the mean. R² = 0 means you did no better than that; R² = 1 means the predictions are exact.
Adjusted R² subtracts a penalty for each predictor, because plain R² can only rise when you add variables, even useless ones. On out-of-sample data R² can go negative, which simply means the model is worse than the mean.
Formula: R² = 1 − SSres/SStot; adj = 1 − (1−R²)(n−1)/(n−k−1)
Worked examples
| Inputs | R² | Note |
|---|---|---|
| A good linear fit | 90% | R² about 96% |
| Perfect predictions | 100% | R² = 100% |
| Predicting the mean | 0% | R² = 0 |
FAQFrequently asked questions
What does R² actually measure?
How much better your model is than always predicting the mean, in squared-error terms.
Is a high R² always good?
No. Time-series data can produce R² above 0.99 from pure trend, and a model can fit training data perfectly and predict nothing.
Can R² be negative?
Yes, on data the model was not fitted to. It means the model does worse than the mean — a genuinely useful warning.
When should I use adjusted R²?
Whenever comparing models with different numbers of predictors. Plain R² can only go up when you add variables, so it always favours the bigger model.
What is a good R² value?
Entirely field-dependent. Physics experiments expect 0.99; human behaviour research is pleased with 0.3.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- National curriculum in England — Mathematics — the terms and methods taught in UK schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.