What is a Coefficient of Determination Calculator?
The coefficient of determination, written R² or R squared, is the proportion of the variation in a response variable y that a regression model explains. It equals SSR / SST, or 1 − SSE / SST, and for a simple linear regression it is the square of the correlation coefficient r. R² runs from 0 (the model explains none of the variation) to 1 (every point lies on the fitted line), so R² = 0.90 means the model accounts for 90% of the variation in y.
What the Coefficient of Determination Calculator does
This coefficient of determination calculator finds R² three ways: from raw x and y data (it fits the least-squares line and splits the total sum of squares row by row), from a correlation coefficient r, or from sums of squares taken from an ANOVA or regression output (SSR and SST, or SSE and SST). When you also give the sample size and number of predictors it reports the adjusted R². It works as an R squared calculator or R² calculator whichever of the three starting points you have, and every result comes with the step-by-step working.
Use it to judge how much of the spread in y a model accounts for, to check a value in software output, or to compare models fitted to the same response. If you only need r, use the Correlation Coefficient Calculator; for the sums of squares on their own, the Sum of Squares Calculator. If you need the full regression (slope tests, residuals, predictions), use the Linear Regression Calculator or, for several predictors, the Multiple Linear Regression Calculator.
How to use the Coefficient of Determination Calculator
- Under Calculate R² from, choose Data, Correlation r or Sums of squares.
- For data, enter one (x, y) pair per row, or paste two columns from a spreadsheet. For r, type the correlation. For sums of squares, pick which pair you have and enter the values.
- To get adjusted R² outside data mode, fill in Sample size, n and Number of predictors, k. In data mode, n is counted for you and k = 1.
- Read R² as a percentage of variation explained, and check the decomposition table or bar chart to see the explained and unexplained parts.
How to calculate the coefficient of determination by hand
To find the coefficient of determination from paired data, fit the regression line and compare the variation it explains with the total variation in y. These are the same steps the calculator shows in its solution.
- Find the means x̄ and ȳ, then the slope b₁ = Sxy / Sxx and the intercept b₀ = ȳ − b₁x̄.
- For each point, compute the fitted value ŷ = b₀ + b₁x.
- Add up the total sum of squares, SST = Σ(y − ȳ)².
- Add up the residual sum of squares, SSE = Σ(y − ŷ)². The explained part is SSR = SST − SSE.
- Divide: R² = SSR / SST, or equivalently R² = 1 − SSE / SST.
- Shortcut for one predictor: compute the correlation r and square it. Both routes give the same number.
Coefficient of determination formula
All three routes lead to the same number for a least-squares fit with an intercept.
| Symbol | Meaning |
|---|---|
| SST | total sum of squares, the variation of y around its mean |
| SSR | regression (explained) sum of squares |
| SSE | error (residual) sum of squares |
| r | Pearson correlation between x and y |
| ŷ | value predicted by the model |
| n, k | number of observations and number of predictors |
Some textbooks write SSR for the residual sum of squares and SSE for the explained one. Here SSR is always the regression (explained) part; check which convention your source uses before entering values.
Adjusted R² can only rise when a new predictor improves the fit by more than chance would, so it is the better measure for comparing models with different numbers of predictors.
Definitions follow standard references: Penn State STAT 462, lesson 2.5: The Coefficient of Determination and the NIST/SEMATECH e-Handbook of Statistical Methods, §4.4.4.
Worked example
Worked example: car weight and fuel economy
Problem. Ten cars have weights x (1,000 lb) of 2.5, 3.0, 3.2, 3.5, 3.8, 4.0, 4.2, 4.5, 2.8, 3.6 and fuel economy y (mpg) of 32, 30, 26, 27, 22, 23, 19, 18, 28, 25. What share of the variation in mpg does weight explain?
- 01Means: x̄ = 3.51 and ȳ = 25. Sxx = 3.669 and Sxy = −25, so b₁ = −25 / 3.669 = −6.8138 and the least-squares line is ŷ = 48.9166 − 6.8138x.
- 02Total variation: SST = Σ(y − 25)² = 186.
- 03Residual variation: SSE = Σ(y − ŷ)² = 15.6539, so SSR = 186 − 15.6539 = 170.3461.
- 04R² = 170.3461 / 186 = 0.9158. Equivalently r = −0.9570 and r² = 0.9158.
- 05Adjusted R² with n = 10 and k = 1: 1 − (1 − 0.9158)(9 / 8) = 0.9053.
Answer. Weight explains about 91.6% of the variation in fuel economy among these cars (adjusted R² = 0.9053). The remaining 8.4% is left in the residuals and reflects factors the model does not include.
Coefficient of determination from the correlation coefficient
With one predictor, R² = r². Squaring removes the sign, so r = −0.9 and r = +0.9 both give R² = 0.81: R² tells you how strong the linear fit is but not its direction. Going the other way, r = ±√R², and you take the sign from the slope of the line.
Because squaring shrinks values below 1, R² is always smaller than |r|. A correlation of 0.5 sounds moderate, but it explains only a quarter of the variation in y.
| Correlation r | R² = r² | Variation explained |
|---|---|---|
| ±0.30 | 0.09 | 9% |
| ±0.50 | 0.25 | 25% |
| ±0.70 | 0.49 | 49% |
| ±0.80 | 0.64 | 64% |
| ±0.90 | 0.81 | 81% |
| ±0.95 | 0.9025 | 90.25% |
How to interpret R²
Read R² as a share of variation. An R² of 0.9 means the model accounts for 90% of the variation in y around its mean, and 10% is left in the residuals. In the worked example above, R² = 0.9158: car weight accounts for about 92% of the differences in fuel economy among the ten cars.
R² does not say how accurate individual predictions are. Two models can share an R² of 0.9 and still have very different prediction errors if y is measured on different scales; the residual standard error s gives the typical size of an error in the units of y. R² also says nothing about whether a straight line is the right shape, so check the scatter plot and residuals as well.
What counts as a good R²?
There is no universal threshold. What matters is the purpose of the model and how noisy the outcome is. The ranges below are rough illustrations of what is common in different kinds of data, not targets or cut-offs. Compare an R² with other models of the same response in your field rather than with a fixed number, and judge the model on its residuals and prediction error as well.
| Setting | Typical R² |
|---|---|
| Physical laws, calibration curves | Often above 0.95 |
| Engineering and process data | About 0.7 to 0.95 |
| Economics and business forecasting | About 0.3 to 0.8 |
| Psychology, education, individual behaviour | Often 0.1 to 0.4 |
Multiple R² and adjusted R²
In a multiple regression with k predictors, R² is still SSR / SST, and it equals the square of the multiple correlation R: the correlation between the observed y values and the fitted values ŷ. It is no longer the square of any single pairwise correlation.
Plain R² can never fall when you add a predictor, even one that is pure noise. Adjusted R² = 1 − (1 − R²)(n − 1) / (n − k − 1) corrects for this by charging each extra predictor against the sample size, so it is the number to use when comparing models with different numbers of predictors on the same response. Enter n and k in the Correlation r or Sums of squares mode to get it here, or fit the whole model with the Multiple Linear Regression Calculator.
Common use cases
- Reporting a regression: R² summarizes the fit in one number that non-specialists understand as “percent of variation explained”.
- Checking software output: recompute R² from the SSR and SST in an ANOVA table, or from a reported r.
- Comparing models: use adjusted R² to compare models with different numbers of predictors on the same response.
- Calibration: confirming that an instrument’s readings are almost perfectly linear in a reference standard.
Assumptions and limitations
- Not a test of correctness: a curved relationship can still give a high R² for a straight line. Always inspect the residuals or the scatter plot.
- Always rises with more predictors: adding any variable, even pure noise, cannot lower R². Use adjusted R² when comparing models of different sizes.
- Sensitive to outliers and range: one extreme point, or data spread over a wide range of x, can inflate R²; a narrow range of x can deflate it.
- Not comparable across responses: R² for a model of y and for a model of log y are measuring different variations.
- No causation: a high R² shows association, not that x causes y.
- Through-the-origin models: if a model has no intercept, software often reports an uncentred R² that is not comparable with the usual one.
Frequently asked questions
How do you calculate the coefficient of determination?
What does an R² of 0.9 mean?
Is R² the same as r squared?
What is the difference between R² and adjusted R²?
Can R² be negative?
How do I calculate R² from an ANOVA table?
How do you find r from the coefficient of determination?
Cite this page
Statculator. (2026, November 14). Coefficient of Determination Calculator. Retrieved November 14, 2026, from https://statculator.com/correlation-regression/coefficient-of-determination-calculator/