Statistics
Coefficient of determination
The core definition: one minus the fraction of total variation left unexplained by the model. It gives 1 for a perfect fit, 0 for predicting the mean, and a negative value for a model worse than the mean.
Last updated
The Formula
R-squared = 1 - SSresidual / SStotal
The core definition: one minus the fraction of total variation left unexplained by the model. It gives 1 for a perfect fit, 0 for predicting the mean, and a negative value for a model worse than the mean.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| R-squared | Coefficient of determination | dimensionless | The explained share of the total variance, expressed as a fraction rather than a percentage. |
| SSresidual | Residual sum of squares | squared units | Sum over all cases of the squared difference between the observed value and its prediction. |
| SStotal | Total sum of squares | squared units | Sum over all cases of the squared difference between the observed value and the mean of observations. |
What Each Symbol Means
R-squareddimensionless
Coefficient of determination
The explained share of the total variance, expressed as a fraction rather than a percentage.
SSresidualsquared units
Residual sum of squares
Sum over all cases of the squared difference between the observed value and its prediction.
SStotalsquared units
Total sum of squares
Sum over all cases of the squared difference between the observed value and the mean of observations.
See It Worked With Real Numbers
A formula on its own does not tell you which number goes where. The how to calculate the coefficient of determination page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.
Where This Formula Appears
This equation is the working core of How To Calculate The Coefficient Of Determination, filed under Math. Every number the guide produces comes from substituting into this one line.
Common Questions
What is the formula for Coefficient of determination?
The formula for Coefficient of determination is R-squared = 1 - SSresidual / SStotal. The core definition: one minus the fraction of total variation left unexplained by the model. It gives 1 for a perfect fit, 0 for predicting the mean, and a negative value for a model worse than the mean.
What does each symbol in Coefficient of determination stand for?
R-squared is coefficient of determination; SSresidual is residual sum of squares; SStotal is total sum of squares.
What units should I use with Coefficient of determination?
Substitute R-squared in dimensionless, SSresidual in squared units, SStotal in squared units. Convert every input to those units before you start, because the equation only returns the right answer when the units on both sides agree.
What is a common mistake when using Coefficient of determination?
Forgetting to square the residuals. Adding raw observed-minus-predicted gaps lets positive and negative errors cancel. The residuals in the default case are -1, 0, 1 and 1, which sum to 1 rather than 3, and that wrong total would give a misleading R-squared. Always square before summing so every gap contributes positively.