Skip to content
Statculator
Correlation & Regression

Coefficient of Determination Calculator

Free coefficient of determination calculator. Find R² from x and y data, a correlation r, or SSR and SST, plus adjusted R² and step-by-step working.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try
Calculate R² from
Paired data (x, y)
#xyRemove row
1
2
3
4
5
6
7
8
9
10
Tip: paste rows straight from a spreadsheet.

R² is computed for the least-squares line ŷ = b₀ + b₁x fitted to these pairs.

Results

Coefficient of determination, R²
0.9158
91.58% of the variation in y is explained
Adjusted R²
0.9053
n = 10, k = 1
Correlation, r
-0.957
Total sum of squares, SST
186
Explained, SSR
170.3461
Unexplained, SSE
15.6539
Unexplained share, 1 − R²
0.0842
Regression line
ŷ = 48.9166 − 6.8138x
Residual standard error, s
1.3988
n and k
10, 1

Interpretation: The model accounts for 91.58% of the variation in y; the remaining 8.42% is left in the residuals. After penalizing for 1 predictor with n = 10, the adjusted R² is 0.9053. A high R² does not by itself show that the model is the right shape or that x causes y.

Scatter plot of 10 points with fitted line202530y2.42.62.83.03.23.43.63.84.04.24.44.6x(2.5, 32)(3, 30)(3.2, 26)(3.5, 27)(3.8, 22)(4, 23)(4.2, 19)(4.5, 18)(2.8, 28)(3.6, 25)R² = 0.916
Vertical distances from the points to the line are the residuals that make up SSE.

Sum-of-squares decomposition

#xyŷ(y − ȳ)²(ŷ − ȳ)²(y − ŷ)²
12.53231.8824947.36170.0139
233028.47512512.07612.3254
33.22627.112314.46181.2372
43.52725.068140.00463.7321
53.82223.02493.90461.0485
642321.6612411.14751.7923
74.21920.29843622.10461.686
84.51818.25434945.50460.0647
92.82829.8378923.40463.3776
103.62524.386800.37610.3761
ΣSST = 186SSR = 170.3461SSE = 15.6539

Step-by-step solution

  1. 1

    Fit the least-squares line

    b₁ = Sxy / Sxx = -25 / 3.669 = -6.8138
    b₀ = ȳ − b₁x̄ = 25 − (-6.8138)(3.51) = 48.9166
    ŷ = 48.9166 − 6.8138x
  2. 2

    Find the total sum of squares

    SST = Σ(y − ȳ)² = 186
  3. 3

    Split SST into explained and unexplained parts

    Each row of the decomposition table contributes to these sums.

    SSR = Σ(ŷ − ȳ)² = 170.3461
    SSE = Σ(y − ŷ)² = 15.6539
    Check: SSR + SSE = 186 = SST
  4. 4

    Divide the explained variation by the total

    R² = SSR / SST = 170.3461 / 186 = 0.9158
    or R² = 1 − SSE / SST = 1 − 15.6539 / 186 = 0.9158
  5. 5

    Confirm with the correlation coefficient

    r = -0.957, r² = 0.9158
  6. 6

    Adjust for the number of predictors

    With n = 10 observations and k = 1 predictor.

    R²adj = 1 − (1 − R²)(n − 1) / (n − k − 1)
    R²adj = 1 − (1 − 0.9158)(10 − 1) / (10 − 1 − 1) = 0.9053

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

  1. Under Calculate R² from, choose Data, Correlation r or Sums of squares.
  2. 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.
  3. 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.
  4. 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.

  1. Find the means x̄ and ȳ, then the slope b₁ = Sxy / Sxx and the intercept b₀ = ȳ − b₁x̄.
  2. For each point, compute the fitted value ŷ = b₀ + b₁x.
  3. Add up the total sum of squares, SST = Σ(y − ȳ)².
  4. Add up the residual sum of squares, SSE = Σ(y − ŷ)². The explained part is SSR = SST − SSE.
  5. Divide: R² = SSR / SST, or equivalently R² = 1 − SSE / SST.
  6. 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.

From sums of squares
R² = SSR / SST = 1 − SSE / SST
Decomposition
SST = SSR + SSE: Σ(y − ȳ)² = Σ(ŷ − ȳ)² + Σ(y − ŷ)²
From the correlation (one predictor)
R² = r²
Adjusted R²
R²adj = 1 − (1 − R²)(n − 1) / (n − k − 1)
Formula symbols
SymbolMeaning
SSTtotal sum of squares, the variation of y around its mean
SSRregression (explained) sum of squares
SSEerror (residual) sum of squares
rPearson correlation between x and y
ŷvalue predicted by the model
n, knumber 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?

  1. 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.
  2. 02Total variation: SST = Σ(y − 25)² = 186.
  3. 03Residual variation: SSE = Σ(y − ŷ)² = 15.6539, so SSR = 186 − 15.6539 = 170.3461.
  4. 04R² = 170.3461 / 186 = 0.9158. Equivalently r = −0.9570 and r² = 0.9158.
  5. 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 rR² = r²Variation explained
±0.300.099%
±0.500.2525%
±0.700.4949%
±0.800.6464%
±0.900.8181%
±0.950.902590.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.

SettingTypical R²
Physical laws, calibration curvesOften above 0.95
Engineering and process dataAbout 0.7 to 0.95
Economics and business forecastingAbout 0.3 to 0.8
Psychology, education, individual behaviourOften 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?

Divide the explained variation by the total variation: R² = SSR / SST, which is the same as 1 − SSE / SST. For simple linear regression it also equals the square of the correlation coefficient, so r = 0.8 gives R² = 0.64. The result is the share of the variation in y that the regression line accounts for.

What does an R² of 0.9 mean?

An R² of 0.9 means the model accounts for 90% of the variation in the response variable around its mean, and 10% remains unexplained in the residuals. It does not mean predictions are 90% accurate; the typical size of a prediction error is given by the residual standard error.

Is R² the same as r squared?

For a simple linear regression with one predictor and an intercept, yes: R² equals the square of Pearson’s correlation r between x and y. With several predictors, R² is the square of the multiple correlation R, which is the correlation between the observed y values and the model’s fitted values.

What is the difference between R² and adjusted R²?

R² never decreases when you add a predictor, even a useless one. Adjusted R² applies a penalty for the number of predictors k relative to the sample size n, so it falls when a new variable adds less than chance would. Use adjusted R² to compare models with different numbers of predictors.

Can R² be negative?

Ordinary R² for a least-squares model with an intercept is always between 0 and 1. Adjusted R² can be negative when the model explains very little relative to its number of predictors. R² computed on new data, or for a model without an intercept, can also be negative because the model can do worse than simply predicting the mean.

How do I calculate R² from an ANOVA table?

Divide the regression (model) sum of squares by the total sum of squares: R² = SSR / SST. If the table gives only the residual sum of squares, use R² = 1 − SSE / SST. Choose the Sums of squares option above, enter the two values, and add n and k to get the adjusted R² as well.

How do you find r from the coefficient of determination?

Take the square root of R² and give it the sign of the regression slope: r = +√R² if the line rises and r = −√R² if it falls. For example, R² = 0.64 with a negative slope gives r = −0.8. This only works for simple linear regression with one predictor.

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/