Advertisement

Coefficient of determination calculator

Measure fit relative to a constant prediction at the observed mean. Choose observed predictions, paired x and y for a fitted line, sums of squares or simple-regression correlation.

Calculator

R squared
0.500000
Adjusted R squared
0.000000
SSE
1.000000
SST
2.000000
Squared residual contributions
Observed yPredicted yResidualSquared residual
1.0000001.0000000.0000000.000000
2.0000002.0000000.0000000.000000
3.0000002.0000001.0000001.000000

Advertisement

How this calculator works

R squared compares squared prediction error with the variation around the observed response mean. It can be negative when predictions perform worse than that mean. The correlation shortcut applies to ordinary simple linear regression with an intercept; it is not a general replacement for SSE and SST. Adjusted R squared accounts for the number of predictor terms and needs positive residual degrees of freedom.

Formula

R² = 1 - SSE/SST; adjusted R² = 1 - (1 - R²)(n - 1)/(n - k - 1). For simple OLS with intercept, R² = r².

Worked example

Observed values 1, 2, 3 and predictions 1, 2, 2 give SSE 1, SST 2 and R squared 0.5. With correlation 0.8, n = 10 and one predictor, R squared is 0.64 and adjusted R squared is 0.595.

Advertisement

Frequently asked questions

Can R squared be negative?

Yes. Arbitrary predictions or models without an intercept can perform worse than the response mean.

Does high R squared prove a good model?

No. Check residual patterns, scientific plausibility, uncertainty and performance on new data.

Why reject constant responses?

SST is zero, so the usual ratio defining R squared has a zero denominator.

Sources

Advertisement