Coefficient of Determination Calculator Formula

Understand the math behind the coefficient of determination calculator. Each variable explained with a worked example.

Formulas Used

R-squared

r_squared = pow(r, 2)

Variance Explained (%)

r_sq_pct = pow(r, 2) * 100

1 - R-squared

unexplained = 1 - pow(r, 2)

Unexplained Variance (%)

unexplained_pct = (1 - pow(r, 2)) * 100

Variables

VariableDescriptionDefault
rCorrelation Coefficient (r)0.85

How It Works

How to Calculate the Coefficient of Determination

Formula

R-squared = r^2

R-squared is the square of the Pearson correlation coefficient. It represents the proportion of variance in the dependent variable that is predictable from the independent variable. The remaining 1 - R^2 is unexplained variance.

Worked Example

If r = 0.85, how much variance does X explain in Y?

r = 0.85
  1. 01R-squared = 0.85^2 = 0.7225
  2. 02X explains 72.25% of the variance in Y
  3. 03Unexplained variance = 1 - 0.7225 = 0.2775 or 27.75%

Frequently Asked Questions

What is a good R-squared value?

It depends on the field. In physical sciences, R^2 > 0.9 is typical. In social sciences, R^2 > 0.3 may be noteworthy. In stock prediction, even R^2 = 0.05 can be valuable.

Can R-squared be negative?

In simple linear regression, R^2 = r^2 and is always between 0 and 1. In multiple regression with poor models, adjusted R-squared can be negative, indicating the model is worse than simply predicting the mean.

What is adjusted R-squared?

Adjusted R-squared penalizes for the number of predictors. It can decrease if a predictor does not improve the model enough to justify the lost degree of freedom. It is preferred for comparing models with different numbers of predictors.