Coefficient of Determination Calculator

Enter observed and predicted values to measure model fit using the coefficient of determination (R²).

R-squared

0.9455

Total sum of squares (SStot): 6.9720

Residual sum of squares (SSres): 0.3800

How to Use This Calculator

  1. Enter actual (observed) values in the left box.
  2. Enter predicted values from your model in the right box.
  3. Review R-squared and the associated sums of squares.
  4. Use R² to assess how well your model explains variation in the data.

Formula

SStot = Σ (yi − ȳ)²

SSres = Σ (yi − ŷi

R² = 1 − (SSres / SStot)

ȳ is the mean of actual values; ŷi are predicted values. R² ranges from −∞ to 1; negative values indicate poor fit compared to the mean-only model.

Full Description

The coefficient of determination measures how well predicted values approximate actual outcomes. Values near 1 indicate excellent fit, while values near 0 (or negative) suggest little explanatory power.

Use adjusted R² for models with multiple predictors to account for overfitting and compare models with different numbers of predictors.

Frequently Asked Questions

Can R² be negative?

Yes. When SSres exceeds SStot, the model performs worse than predicting the mean.

Is higher R² always better?

A higher R² indicates better explanatory power, but check for overfitting and consider adjusted R² for multivariate models.

Do actual and predicted values need to be sorted?

No. Input pairs should correspond row-wise, but order is arbitrary.

How many pairs do I need?

At least two pairs to compute variance; more observations improve reliability.