Coefficient of Determination: How to Calculate It and Interpret the Result

What Is the Coefficient of Determination?

The coefficient of determination is a statistical measurement that examines how differences in one variable can be explained by the difference in a second variable when predicting the outcome of a given event. This coefficient is more commonly known as r-squared (or r2). It assesses how strong the linear relationship is between two variables and it's heavily relied upon by investors when conducting trend analysis.

This coefficient generally answers a key question: What percentage of a stock's price movement is attributed to the index's price movement if it's listed on an index and experiences price movements?

Key Takeaways

  • The coefficient of determination is a complex idea centered on statistical analysis of data and financial modeling.
  • It's used to explain the relationship between an independent and dependent variable.
  • The coefficient of determination is commonly called r-squared (or r2) for the statistical value it represents.
  • This measure is represented as a value between 0.0 and 1.0 where a value of 1.0 indicates a perfect correlation. This is a reliable model for future forecasts.
  • A value of 0.0 suggests that asset prices aren't a function of dependency on the index. 
Coefficient of Determination

Investopedia / Julie Bang

Understanding the Coefficient of Determination

The coefficient of determination is a measurement that's used to explain how much the variability of one factor is caused by its relationship to another factor. This correlation is represented as a value between 0.0 and 1.0 or 0% to 100%.

A value of 1.0 indicates a 100% price correlation and is a reliable model for future forecasts. A value of 0.0 suggests that the model shows that prices aren't a function of dependency on the index.

A value of 0.20 suggests that 20% of an asset's price movement can be explained by the index. A value of 0.50 indicates that 50% of its price movement can be explained by it.

The coefficient of determination is the square of the correlation coefficient also known as "r" in statistics. The value "r" can result in a negative number but r2 can't result in a negative number because r-squared is the result of "r" multiplied by itself or squared. The square of a negative number is always a positive value.

Calculating the Coefficient of Determination

Calculating the coefficient of determination is achieved by creating a scatter plot of the data and a trend line.

You'd collect the prices as shown in this table if you were to plot the closing prices for the S&P 500 and Apple (AAPL) stock for trading days from Dec. 21 to Jan. 20, Apple is listed on the S&P 500.

S&P Daily Close APPL Daily Close
Jan. 20 $3,972.61 $137.87
19 $3,898.85 $135.27
18 $3,928.86 $135.21
17 $3,990.97 $135.94
13 $3,999.09 $134.76
12 $3,983.17 $133.41
11 $3,969.61 $133.49
10 $3,919.25 $130.73
9 $3,892.09 $130.15
6 $3,895.08 $129.62
5 $3,808.10 $125.02
4 $3,852.97 $126.36
3 $3,824.14 $125.07
Dec. 30 $3,839.50 $139.93
29 $3,849.28 $129.61
28 $3,783.22 $126.04
27 $3,829.25 $130.03
23 $3,844.82 $131.86
22 $3,822.39 $132.23
21 $3,878.44 $135.45

You'd then create a scatter plot. How well the data fits the regression model on a graph is referred to as the goodness of fit. It measures the distance between a trend line and all the data points that are scattered throughout the diagram.

APPL Daily Close vs. S&P Daily Close Coefficient of Determination

Spreadsheets

Most spreadsheets use the same formula to calculate the r2 of a dataset. If the data reside in columns A and B on your sheet:

= RSQ ( A1 : A10 , B1 : B10 )

You get an r2 of 0.347 using this formula and highlighting the corresponding cells for the S&P 500 and Apple prices, suggesting that the two prices are less correlated than if the r2 was between 0.5 and 1.0.

Manual Calculation

Calculating the coefficient of determination manually involves several steps. First, gather the data as in the previous table then calculate all the values you need as shown in this table:

  • x= S&P 500 daily close
  • y = APPL daily close
x x2 y y2 xy
Jan. 20 $3,972.61 $15,781,630.21 $137.87 $19,008.14 $547,703.74
19 $3,898.85 $15,201,031.32 $135.27 $18,297.97 $527,397.44
18 $3,928.86 $15,435,940.90 $135.21 $18,281.74 $531,221.16
17 $3,990.97 $15,927,841.54 $135.94 $18,479.68 $542,532.46
13 $3,999.09 $15,992,720.83 $134.76 $18,160.26 $538,917.37
12 $3,983.17 $15,865,643.25 $133.41 $17,798.23 $531,394.71
11 $3,969.61 $15,757,803.55 $133.49 $17,819.58 $529,903.24
10 $3,919.25 $15,360,520.56 $130.73 $17,090.33 $512,363.55
9 $3,892.09 $15,148,364.57 $130.15 $16,939.02 $506,555.51
6 $3,895.08 $15,171,648.21 $129.62 $16,801.34 $504,880.27
5 $3,808.10 $14,501,625.61 $125.02 $15,630.00 $476,088.66
4 $3,852.97 $14,845,377.82 $126.36 $15,966.85 $486,861.29
3 $3,824.14 $14,624,046.74 $125.07 $15,642.50 $478,285.19
Dec. 30 $3,839.50 $14,741,760.25 $139.93 $19,580.40 $537,261.24
29 $3,849.28 $14,816,956.52 $129.61 $16,798.75 $498,905.18
28 $3,783.22 $14,312,753.57 $126.04 $15,886.08 $476,837.05
27 $3,829.25 $14,663,155.56 $130.03 $16,907.80 $497,917.38
23 $3,844.82 $14,782,640.83 $131.86 $17,387.06 $506,977.97
22 $3,822.39 $14,610,665.31 $132.23 $17,484.77 $505,434.63
21 $3,878.44 $15,042,296.83 $135.45 $18,346.70 $525,334.70
Sum (Σ) $77,781.69 $302,584,424.00 $2,638.05 $348,307.23 $10,262,772.73

Use this formula and substitute the values for each row of the table where n equals the number of samples taken. That's 20 in this case:

r 2 = ( n ( x y ) ( x ) ( y ) [ n x 2 ( x ) 2 ] × [ n y 2 ( y ) 2 ] ) 2 \begin{aligned}&r ^ 2 = \Big ( \frac {n ( \sum xy) - ( \sum x )( \sum y ) }{ \sqrt { [ n \sum x ^ 2 - ( \sum x ) ^ 2 ] } \times \sqrt { [ n \sum y ^ 2 - ( \sum y ) ^ 2 ] } } \Big ) ^ 2 \\\end{aligned} r2=([nx2(x)2]×[ny2(y)2]n(xy)(x)(y))2

Where √ represents the square root of the product in the brackets that follow it.

r 2 = ( 20 ( 10 , 262 , 772.73 ) ( 77 , 781.69 ) ( 2 , 638.05 ) [ 20 ( 302 , 584 , 424 ) ( 77 , 781.69 ) 2 ] × [ 20 ( 348 , 307.23 ) ( 2 , 638.05 ) 2 ] ) 2 \begin{aligned}&r ^ 2 = \Big ( \tiny { \frac {20 ( 10,262,772.73) - ( 77,781.69 )( 2,638.05 ) }{ \sqrt { [ 20 ( 302,584,424 ) - ( 77,781.69 ) ^ 2 ] } \times \sqrt { [ 20 ( 348,307.23 ) - ( 2,638.05 ) ^ 2 ] } } } \Big ) ^ 2 \\\end{aligned} r2=([20(302,584,424)(77,781.69)2]×[20(348,307.23)(2,638.05)2]20(10,262,772.73)(77,781.69)(2,638.05))2

You now have:

1. ( 20 × 10 , 262 , 772.73 ) ( 77 , 781.69 × 2 , 638.05 ) = 63 , 467.32 2. ( ( 20 × 302 , 584 , 424 ) ( 77 , 781.69 ) 2 = 1 , 697 , 180.74 = 1 , 302.76 3. ( ( 20 × 10 , 262 , 772.73 ) ( 2 , 638.05 ) 2 = 6 , 836.85 = 82.69 \begin{aligned}&1. \tiny { ( 20 \times 10,262,772.73 ) - ( 77,781.69 \times 2,638.05 ) = 63,467.32 } \\&2. \tiny { (\sqrt { ( 20 \times 302,584,424 ) - ( 77,781.69 ) ^ 2 } = \sqrt { 1,697,180.74 } = 1,302.76 } \\&3. \tiny { (\sqrt { ( 20 \times 10,262,772.73 ) - ( 2,638.05 ) ^ 2 } = \sqrt { 6,836.85 } = 82.69 }\\\end{aligned} 1.(20×10,262,772.73)(77,781.69×2,638.05)=63,467.322.((20×302,584,424)(77,781.69)2=1,697,180.74=1,302.763.((20×10,262,772.73)(2,638.05)2=6,836.85=82.69

Now multiply steps two and three, divide step one by the result, and square it:

( 63 , 467.32 1 , 302.76 × 82.69 ) 2 = 0.347 \begin{aligned}&\Big ( \frac { 63,467.32 }{ 1,302.76 \times 82.69 } \Big ) ^ 2 = 0.347\end{aligned} (1,302.76×82.6963,467.32)2=0.347

You can see how this can become very tedious with lots of room for error, particularly if you're using more than a few weeks of trading data.

Interpreting the Coefficient of Determination

When you have the coefficient of determination you use it to evaluate how closely the price movements of the asset you're evaluating correspond to the price movements of an index or benchmark. The coefficient of determination for the period was 0.347 in the Apple and S&P 500 example,

Apple is listed on many indexes so you can calculate the r2 to determine if it corresponds to any other indexes' price movements.

A coefficient of determination of 0.357 shows that Apple stock price movements are somewhat correlated to the index because 1.0 demonstrates a high correlation and 0.0 shows no correlation.

One aspect to consider is that r-squared doesn't tell analysts whether the coefficient of determination value is intrinsically good or bad. It's their discretion to evaluate the meaning of this correlation and how it may be applied in future trend analyses.

How Do You Interpret a Coefficient of Determination?

The coefficient of determination shows the level of correlation between one dependent and one independent variable. It's also called r2 or r-squared. The value should be between 0.0 and 1.0. The closer it is to 0.0, the less correlated the dependent value. The closer to 1.0, the more correlated the value.

What Does R-Squared Tell You in Regression?

R-squared in regression tells you whether there's a dependency between two values and how much dependency one value has on the other.

What If the Coefficient of Determination Is Greater Than 1?

The coefficient of determination can't be more than one because the formula always results in a number between 0.0 and 1.0. Something is incorrect if it's greater or less than these numbers.

The Bottom Line

The coefficient of determination is a ratio that shows how dependent one variable is on another. Investors use it to determine how correlated an asset's price movements are with its listed index.

It doesn't demonstrate dependency on the index when an asset's r2 is closer to zero. It's more dependent on the price moves the index makes if its r2 is closer to 1.0.

Article Sources
Investopedia requires writers to use primary sources to support their work. These include white papers, government data, original reporting, and interviews with industry experts. We also reference original research from other reputable publishers where appropriate. You can learn more about the standards we follow in producing accurate, unbiased content in our editorial policy.
  1. Pennsylvania State University Eberly College of Science. "STAT 462 Applied Regression Analysis: 2.5 - The Coefficient of Determination, r-squared."

  2. LibreTexts Statistics. "10.6: The Coefficient of Determination."

  3. Nasdaq. "APPL Historical Data."

  4. Nasdaq. "SPX Historical Data."

Open a New Bank Account
×
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.
Open a New Bank Account
×
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.