Coefficient of Determination Calculator (Rsquared)
Use our coefficient of determination calculator to find the socalled Rsquared of any two variable dataset. If you've ever wondered what the coefficient of determination is, keep reading, as we will give you both the Rsquared formula and an explanation of how to interpret the coefficient of determination. We also provide an example of how to find the Rsquared of a dataset by hand, and what the relationship is between the coefficient of determination and Pearson correlation.
What is the coefficient of determination?
In linear regression analysis, the coefficient of determination describes what proportion of the dependent variable's variance can be explained by the independent variable(s). In other words, the coefficient of determination assesses how well the real data points are approximated by regression predictions, thus quantifying the strength of the linear relationship between the explained variable and the explanatory variable(s). Because of that, it is sometimes called the goodness of fit of a model.
Most of the time, the coefficient of determination is denoted as R^{2}, simply called "R squared".
How to use this coefficient of determination calculator?
Our Rsquared calculator determines the coefficient of determination, R^{2}, for you if you are working with a simple linear regression, Y ~ aX + b
:

Input your data points into the appropriate rows. Extra rows will appear as you write;

When at least three points are in place, our coefficient of determination calculator will return the value of R^{2} at the bottom of the calculator, along with an interpretation; and

Decide whether you want to see just a basic summary, or the full details of the calculation.
How to interpret the coefficient of determination?

The coefficient of determination, or the Rsquared value, is a value between
0.0
and1.0
that expresses what proportion of the variance inY
can be explained byX
:
If R^{2} = 1, then we have a perfect fit, which means that the values of
Y
are fully determined (i.e., without any error) by the values ofX
, and all data points lie precisely at the estimated line of best fit. 
If R^{2} = 0, then our model is no better at predicting the values of
Y
than the model which always returns the average value ofY
as a prediction.


Multiplying R^{2} by 100%, you get the percentage of the variance in
Y
which is explained with help ofX
. For instance:
If R^{2} = 0.8, then 80% of the variance in
Y
is predicted byX

If R^{2} = 0.5 then half of the variance in
Y
can be explained byX


The complementary percentage, i.e., (1  R^{2}) * 100%, quantifies the unexplained variance:
 If R^{2} = 0.6, then 60% of the variance in
Y
has been explained with help ofX
, while the remaining 40% remains unaccounted for.
 If R^{2} = 0.6, then 60% of the variance in
The formula for the coefficient of determination
Let
(x_{1}, y_{1}), ..., (x_{n}, y_{n})
be our sample data, and let

ȳ be the average of y_{1}, ..., y_{n}; and

ŷ_{1}, ..., ŷ_{n} be the fitted (predicted) values of the simple regression model Y ~ aX + b.
Before we give the Rsquared formula, we need to define three types of sums of squares:

The sum of squares of errors (SSE in short), also called the residual sum of squares:
SSE= ∑(y_{i}  ŷ_{i})²
SSE quantifies the discrepancy between real values of Y and those predicted by our model. Based on SSE, you can compute the mean squared error (MSE). If you're not yet familiar with this concept, visit our MSE calculator.

The regression sum of squares (shortened to SSR), which is sometimes also called the explained sum of squares:
SSR = ∑(ŷ_{i}  ȳ)²
SSR measures the difference between the values predicted by the regression model and those predicted in the most basic way, namely by ignoring X completely and using only the average value of Y as a universal predictor.

The total sum of squares (SST), which quantifies the total variability in Y:
SST = ∑(y_{i}  ȳ)²
It turns out that those three sums of squares satisfy:
SST= SSR + SSE
so you only need to calculate any two of them, and the remaining one can be easily found!
It's time for the formula for the coefficient of determination, R^{2}! Here are a few (equivalent) formulae:
R^{2} = SSR / SST
or
R^{2} = 1  SSE / SST
or
R^{2} = SSR / (SSR + SSE)
How to find the coefficient of determination?
Let us determine the coefficient of determination for the following data:
(0, 1), (2, 4), (4, 4)

Calculate the mean of y's, so, for 1, 4, 4, ȳ = 3

Use our simple linear regression calculator to fit the model Y ~ aX + b to our data: Y ~ 0.75x + 1.5

With the help of the regression line, determine the fitted (predicted) values using ŷ_{i} = 0.75x_{i} + 1.5:
ŷ_{1} = 1.5
ŷ_{2} = 3
ŷ_{3} = 4.5

Compute SST: square the differences between y_{i} and ȳ, then sum the results:
(1  3)^{2} = 4
(4  3)^{2} = 1
(4  3)^{2} = 1
SST = 4 + 1 + 1 = 6

Compute SSR: square the differences between ŷ_{i} and ȳ, then sum the results:
(1.5  3)^{2} = 2.25
(3  3)^{2} = 0
(4.5  3)^{2} = 2.25
SSR = 2.25 + 0 + 2.25 = 4.5

Apply the Rsquared formula:
R^{2} = SSR / SST = 4.5 / 6 = 0.75
Rsquared and correlation
In simple linear leastsquares regression, Y ~ aX + b, the coefficient of determination R^{2} coincides with the square of the Pearson correlation coefficient between x_{1}, ..., x_{n} and y_{1}, ..., y_{n}. Discover this concept with Omni's Pearson correlation calculator.
For instance:
 Suppose you know the correlation of your data set: r = 0.9;
 To find the coefficient of determination, just square the correlation coefficient: r^{2} = 0.81;
 Convert the result to a percentage: 0.81 = 81%; and
 You may now conclude that the values of X account for 81% of variability observed in Y.