ArticleslgStudy

mathematics

Coefficient of determination

Coefficient of determination is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Coefficient of determination rather than just read about it. In short: In statistics, the coefficient of determination, denoted R2 or r2 and pronounced "R squared", is the proportion of the variation in the dependent variable that is predictable from the independent variable(s). It is a statistic used in the context of statistical models whose main purpose is either the prediction of future outcomes or the testing of hypotheses, on the basis of other related information.

Coefficient of determination — main illustration
Coefficient of determination — illustration

Key takeaways

  • Coefficient of determination belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Coefficient of determination to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Coefficient of determination from memory before moving on to harder problems.

Reference excerpt

In statistics, the coefficient of determination, denoted R2 or r2 and pronounced "R squared", is the proportion of the variation in the dependent variable that is predictable from the independent variable(s). It is a statistic used in the context of statistical models whose main purpose is either the prediction of future outcomes or the testing of hypotheses, on the basis of other related information. It provides a measure of how well observed outcomes are replicated by the model, based on the proportion of total variation of outcomes explained by the model. There are several definitions of R2 that are only sometimes equivalent. In simple linear regression (which includes an intercept), r2 is simply the square of the sample correlation coefficient (r), between the observed outcomes and the observed predictor values. If additional regressors are included, R2 is the square of the coefficient of multiple correlation. In both such cases, the coefficient of determination is always smaller than 1 and usually greater than 0. Cases where R2 is negative can arise when the predictions that are being compared to the corresponding outcomes have not been derived from a model-fitting procedure using those data. Even if a model-fitting procedure has been used, R2 may still be negative, for example when linear regression is conducted without including an intercept, or when a non-linear function is used to fit the data. In cases where negative values arise, the mean of the data provides a better fit to the outcomes than do the fitted function values, according to this particular criterion. The coefficient of determination can be more intuitively informative than MAE, MAPE, MSE, and RMSE in regression analysis evaluation, as the former can be expressed as a percentage, whereas the latter measures have arbitrary ranges. It also proved more robust for poor fits compared to SMAPE on certain test datasets. When evaluating the goodness-of-fit of simulated (Ypred) versus measured (Yobs) values, it is not appropriate to base this on the R2 of the linear regression (i.e., Yobs=m·Ypred + b). The R2 quantifies the degree of any linear correlation between Yobs and Ypred, while for the goodness-of-fit evaluation only one specific linear correlation should be taken into consideration: Yobs=1·Ypred + 0 (i.e., the 1:1 line).

Definitions

A data set has n values marked y1, ..., yn (collectively known as yi or as a vector y=[y1, ..., yn]T), each associated with a fitted (or modeled, or predicted) value f1, ..., fn (known as fi, or sometimes ŷi, as a vector f). Define the residuals as ei=yi − fi (forming a vector e). If y¯ is the mean of the observed data: y¯=1n∑i=1nyi then the variability of the data set can be measured with two sums of squares formulas:

The sum of squares of residuals, also called the residual sum of squares: SSres=∑i(yi−fi)2=∑iei2 The total sum of squares (proportional to the variance of the data): SStot=∑i(yi−y¯)2 The most general definition of the coefficient of determination is R2=1−SSresSStot In the best case, the modeled values exactly match the observed values, which results in SSres=0 and R2=1. A baseline model, which always predicts y, will have R2=0.

Relation to unexplained variance

In a general form, R2 can be seen to be related to the fraction of variance unexplained (FVU), since the second term compares the unexplained variance (variance of the model's errors) with the total variance (of the data): R2=1−FVU

As explained variance A larger value of R2 implies a more successful regression model. Suppose R2=0.49. This implies that 49% of the variability of the dependent variable in the data set has been accounted for, and the remaining 51% of the variability is still unaccounted for. For regression models, the regression sum of squares, also called the explained sum of squares, is defined as

SSreg=∑i(fi−y¯)2 In some cases, as in linear regression, the total sum of squares equals the sum of the two other sums of squares defined above:

SSres+SSreg=SStot See Partitioning in the general OLS model for a derivation of this result for one case where the relation holds. When this relation does hold, the above definition of R2 is equivalent to

R2=SSregSStot=SSreg/nSStot/n where n is the number of observations (cases) on the variables. In this form R2 is expressed as the ratio of the explained variance (variance of the model's predictions, which is SSreg / n) to the total variance (sample variance of the dependent variable, which is SStot / n). This partition of the sum of squares holds for instance when the model values ƒi have been obtained by linear regression. A milder sufficient condition reads as follows: The model has the form

fi=α^+β^qi where the qi are arbitrary values that may or may not depend on i or on other free parameters (the common choice qi = xi is just one special case), and the coefficient estimates α^ and β^ are obtained by minimizing the residual sum of squares. This set of conditions is an important one and it has a number of implications for the properties of the fitted residuals and the modelled values. In particular, under these conditions:

f¯=y¯.

As squared correlation coefficient In linear least squares multiple regression (with fitted intercept and slope), R2 equals ρ2(y,f) the square of the Pearson correlation coefficient between the observed y and modeled (predicted) f data values of the dependent variable. In a linear least squares regression with a single explanator (with fitted intercept and slope), this is also equal to ρ2(y,x) the squared Pearson correlation coefficient between the dependent variable y and explanatory variable x. It should not be confused with the correlation coefficient between two explanatory variables, defined as

… excerpt ends here. Continue reading the full article.

Illustrations

Coefficient of determination illustration
Coefficient of determination: R2=1−SSresSStot
The better the linear regression (on the right) fits the data in comparison to the simple average (on the left graph), the closer the value of R2 is to 1. The areas of the blue squares represent the squared residuals with respect to the linear regression. The areas of the red squares represent the squared residuals with respect to the average value.
R2=1−SSresSStot The better the linear regression (on the right) fits the data in comparison to the simple average (on the left graph), the closer the value of R2 is to 1. The areas of the blue squares represent the squared residuals with respect to the linear regression. The areas of the red squares represent the squared residuals with respect to the average value.
Coefficient of determination: This is an example of residuals of regression models in smaller and larger spaces based on ordinary least square regression.
This is an example of residuals of regression models in smaller and larger spaces based on ordinary least square regression.
Coefficient of determination: Comparison of the Theil–Sen estimator (black) and simple linear regression (blue) for a set of points with outliers. Because of the many outliers, neither of the regression lines fits the data well, as measured by the fact that neither gives a very high R2.
Comparison of the Theil–Sen estimator (black) and simple linear regression (blue) for a set of points with outliers. Because of the many outliers, neither of the regression lines fits the data well, as measured by the fact that neither gives a very high R2.
Coefficient of determination: Schematic of the bias and variance contribution into the total error
Schematic of the bias and variance contribution into the total error

Worked examples

Example 1 — a first encounter with Coefficient of determination

Start with the simplest possible case. Write down what Coefficient of determination claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Coefficient of determination before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Coefficient of determination ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Coefficient of determination

In research
Coefficient of determination appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Coefficient of determination in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Coefficient of determination is common in secondary-school and first-year university syllabi. It links to neighbouring topics Income inequality metrics, Least squares, Mathematical terminology, so understanding it makes those chapters shorter.
In everyday life
Look for Coefficient of determination outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Coefficient of determination” →

How to study Coefficient of determination in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Coefficient of determination means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Coefficient of determination out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Coefficient of determination in simple terms?

In statistics, the coefficient of determination, denoted R2 or r2 and pronounced "R squared", is the proportion of the variation in the dependent variable that is predictable from the independent variable(s). It is a statistic used in the context of statistical models whose main purpose is either t…

Why does Coefficient of determination matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Coefficient of determination?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Coefficient of determination.

Tags

  • Income inequality metrics
  • Least squares
  • Mathematical terminology
  • Regression diagnostics
  • Statistical deviation and dispersion
  • Statistical ratios

Keep exploring