## Formula to Calculate the Coefficient of Determination

The Coefficient of Determination or R-squared can be defined as a measure of statistical as to how the raw data is nearer to the fitted line of regression. The formula for Coefficient of Determination is Squaring the below:

Where,

- r = correlation coefficient
- n = number of observations
- x = 1
^{st}variable in the context - y = 2
^{nd}variable

The Coefficient of Determination is squared of correlation. Hence to calculate the coefficient of determination, one needs to calculate the first correlation and then square the correlation calculated. This shall work only in linear regression and will not work when the relationship between variables is non-linear like exponential or squared. The coefficient of determination can also be termed as R^{2}. The higher the coefficient the better it is. Again, the coefficient of determination ranges from 0 to 1 just like the normal correlation that we calculate.

### Examples

#### Example #1

**Below are the data are given between X and Y, and X is an independent variable and Y is the dependent variable.**

You are required to calculate the Coefficient of Determination based on the above information.

**Solution:**

We have n = 6.

Let’s now input the values in the formula to arrive R^{2}.

Therefore, the calculation of the coefficient of determination is as follows,

- R= ( 6 * 99800 ) – ( 750 * 7800 ) / [(6 * 95500) – (750)
^{2}] * [(6 * 10480000) – (7800)^{2}]

**R will be –**

**R = 0.942908071**

**R ^{2}= 0.88907563**

Now, Coefficient of determination shall be square of r which is 0.88907563

#### Example #2

**The Govt of country X was researching about their economy and wanted to know if any sector needed a boost. They learned in the news that the Auto sector was suffering. They have taken data for the last 6 quarters and demand as well. They wanted to confirm if its due to weaker demand and hence they wanted to determine correlation.**

You are required to calculate the Coefficient of Determination.

**Solution:**

We can use the below formula by squaring them to calculate the Coefficient of Determination.

Let’s now input the values in the formula to arrive R^{2}.

We have n = 6.

Therefore, the calculation of the coefficient of determination is as follows,

- R= ( 6 * 3801 ) – ( 33 * 686 ) / [(6 * 199) – (33)
^{2}] * [(6 * 78478) – (686)^{2}]

**R will be –**

**R = 0.994100243**

**R ^{2 }= 0.988235294.**

Now, the Coefficient of determination shall be square of r which is 0.988235294.

#### Example #3

**Kusum has joined the clinic as a new assistant and she was given a task to analyze detail of one patient where she had to determine whether sugar level has increased due to eating chocolates.**

You are required to calculate the Coefficient of Determination.

**Solution:**

** **We can use below formula to calculate Coefficient of Determination

We have n = 4.

Let’s now input the values in the formula to arrive R^{2}.

Therefore, the calculation of the coefficient of determination is as follows,

- R = (4 * 2780 ) – ( 660 * 14 ) / [(4 * 133400) – (660)
^{2}] * [(4 * 60) – (14)^{2}]

**R will be –**

**R = 0.905354101**

**R**^{2 }= 0.819666048

Now, Coefficient of determination shall be square of r which is 0.819666048

### Relevance and Uses

In statistics, R^{2} is a measure that shall examine the capability of a model whether it can predict or can explain the result in the linear regression. In other words, it can be stated that R^{2} shall indicate how much of the proportion of variance is explained by the predictor variable (independent variable X) and the linear regression in the dependent variable (Y). These are used in rocket science and more or less are expected to be near 100% and the minimum would be 0.

### Recommended Articles

This has been a Guide to Coefficient of Determination Formula. Here we learn how to calculate the coefficient of determination using its formula with examples and downloadable excel template. You can learn more about excel modeling from the following articles –

- Practical Examples of Linear Regression
- What is Marginal Product Formula?
- Gini Coefficient Calculation
- Formula of Coefficient of Variation
- Beta Coefficient Calculation
- Formula of Standard Deviation

- 16 Courses
- 15+ Projects
- 90+ Hours
- Full Lifetime Access
- Certificate of Completion