Coefficient of Determination Calculator

Coefficient of Determination Calculator

Find R², the share of variation a model explains, from raw X and Y data, from observed and predicted values, or straight from a correlation r, with adjusted R² and the sums of squares.

R² = 1 − SSE ÷ SST

Enter both lists of values

What is the Coefficient of Determination?

The coefficient of determination, R², is the share of the variation in an outcome that a model accounts for. R² = 0.8 means the model's predictions capture 80% of how much the outcome varies; the other 20% is left unexplained.

It compares the model's squared errors with those of the simplest possible prediction, the mean. A model no better than the mean scores 0; a perfect fit scores 1. A model that's worse than the mean can even score below 0.

For a straight-line fit with one predictor, R² is just the square of Pearson's r. With several predictors, adjusted R² is the fairer figure, because plain R² never goes down when you add variables, even useless ones.

Coefficient of Determination Formula

As given in the NIST/SEMATECH e-Handbook, section 4.4.4, and OpenStax Introductory Statistics, section 12.3. See Sources.

1. Total and leftover variation

SST = Σ(y − ȳ)²
SSE = Σ(y − ŷ)²

2. The explained share

R² = 1 − SSE ÷ SST
Simple linear regression: R² = r²

3. Adjusting for model size

Adjusted R² = 1 − (1 − R²)(n − 1) ÷ (n − p − 1)

Worked Example: Advertising Spend and Sales

Given:
Monthly ad spend (£000) 10, 20, 30, 40, 50, 60 and sales (£000) 25, 41, 48, 66, 72, 85.
Step 1:
Fit the best straight line:
sales = 15.067 + 1.1743 × spend
Step 2:
Sums of squares:
SST = 2,446.83 · SSE = 33.68
Step 3:
R² and adjusted R²:
1 − 33.68 ÷ 2,446.83 = 0.9862 · adjusted 0.9828
Result:
R² = 0.986

Ad spend accounts for about 99% of the month-to-month variation in sales. That says the line fits well, not that the spending caused the sales.

Why Adjusted R² Falls as Predictors Are Added

A model with R² = 0.80 on 20 observations, if adding predictors brought no real improvement.

Adjusted R² for different numbers of predictors
PredictorsR²Adjusted R²
10.800.789
20.800.776
50.800.729
100.800.578
150.800.05

Common R² Mistakes

  • Chasing a higher R² by adding variables. Plain R² always rises. Use adjusted R² or a held-out test set to compare models of different sizes.
  • Treating a high R² as proof the model is right. A curve fitted with a straight line can still give R² above 0.9 while missing the pattern. Check the residuals.
  • Comparing R² across different outcomes. R² depends on how much the outcome varies. It's only comparable between models of the same data.
  • Expecting high R² everywhere. In social science and biology, an R² of 0.2 can be a useful finding; in physics, 0.99 may be disappointing.

Coefficient of Determination FAQs

What is a good R²?

It depends on the field. Tightly controlled physical measurements often exceed 0.95; human behaviour rarely gets past 0.5.

Can R² be negative?

Yes, when predictions are worse than simply using the mean. It happens with models applied to new data or fitted without an intercept.

Is R² the same as r²?

For a straight-line fit with one predictor and an intercept, yes. For other models, R² is defined by 1 − SSE/SST.

What does adjusted R² do?

It subtracts a penalty for each predictor, so adding a useless variable lowers it. It can be negative.

Does a high R² mean good predictions?

Not necessarily. R² is relative. The residual standard error tells you how far off predictions typically are, in the data’s own units.

How do I get R² in Excel?

=RSQ(y_range, x_range) for a straight line, or tick “Display R-squared” on a chart trendline.

What do SST and SSE stand for?

Total sum of squares (variation around the mean) and error sum of squares (variation left around the predictions). Their difference is the explained part.

Why enter the number of predictors?

Adjusted R² needs it. For a single X variable, leave it at 1.

Sources

Related Tools