Coefficient of Determination

Coefficient of Determination (R²) indicates how much of the variation in your outcome variable is explained by a regression model's predictors.

R2=proportion of variation explainedR^2 = \text{proportion of variation explained}

Solve a problem with Coefficient of Determination

Type the problem. The solver will use Coefficient of Determination where Coefficient of Determination is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Coefficient of Determination takes
RR
Coefficient of Determination
SymbolMeaning
RRRepresents the correlation coefficient from which R² is derived; it ranges from -1 to 1 and measures the strength and direction of a linear relationship. Confusing R with R² is common—squaring the correlation gives R², which is always between 0 and 1 and represents only the proportion of variation explained, regardless of direction.

When to use it

Use R² when you fit a regression model to measure what proportion of the variation in your outcome is captured by the predictors.

Level

Usually taught in: Statistics

Worked examples

1. Calculating R² for Study Hours vs Test Scores

Problem

A teacher fits the regression line y^=50+5x\hat{y} = 50 + 5x to model test scores (yy) based on study hours (xx) for 5 students. The observed test scores were 61, 68, 82, 84, and 92 when study hours were 2, 4, 6, 7, and 8 respectively. Calculate R2R^2.
  1. y^1=60,y^2=70,y^3=80,y^4=85,y^5=90\hat{y}_1 = 60, \quad \hat{y}_2 = 70, \quad \hat{y}_3 = 80, \quad \hat{y}_4 = 85, \quad \hat{y}_5 = 90

    Substitute each study hour into y^=50+5x\hat{y} = 50 + 5x to find the predicted test score for each student.

  2. e1=6160=1,e2=6870=2,e3=8280=2,e4=8485=1,e5=9290=2e_1 = 61 - 60 = 1, \quad e_2 = 68 - 70 = -2, \quad e_3 = 82 - 80 = 2, \quad e_4 = 84 - 85 = -1, \quad e_5 = 92 - 90 = 2

    Calculate residuals as the difference between observed and predicted scores for each student.

  3. RSS=12+(2)2+22+(1)2+22=1+4+4+1+4=14\text{RSS} = 1^2 + (-2)^2 + 2^2 + (-1)^2 + 2^2 = 1 + 4 + 4 + 1 + 4 = 14

    Square each residual and sum them to find the residual sum of squares.

  4. yˉ=61+68+82+84+925=3875=77.4\bar{y} = \frac{61 + 68 + 82 + 84 + 92}{5} = \frac{387}{5} = 77.4

    Find the mean of all observed test scores.

  5. TSS=(6177.4)2+(6877.4)2+(8277.4)2+(8477.4)2+(9277.4)2=268.96+88.36+21.16+43.56+213.16=635.2\text{TSS} = (61 - 77.4)^2 + (68 - 77.4)^2 + (82 - 77.4)^2 + (84 - 77.4)^2 + (92 - 77.4)^2 = 268.96 + 88.36 + 21.16 + 43.56 + 213.16 = 635.2

    Calculate the total sum of squares by summing the squared deviations of each score from the mean.

  6. R2=114635.2=10.0220=0.978R^2 = 1 - \frac{14}{635.2} = 1 - 0.0220 = 0.978

    Apply the formula R2=1RSSTSSR^2 = 1 - \frac{\text{RSS}}{\text{TSS}} to find the coefficient of determination.

Answer: R20.978 or 97.8%R^2 \approx 0.978 \text{ or } 97.8\%

This high R2R^2 value means that approximately 97.8% of the variation in test scores is explained by study hours. The regression model fits the data very well, showing that study hours are a strong predictor of test performance.

2. Calculating R² for Altitude vs Temperature

Problem

A scientist measures air temperature at different altitudes. The regression line is y^=206x\hat{y} = 20 - 6x where xx is altitude in km and yy is temperature in °C. For altitudes 1, 2, 3, and 4 km, the observed temperatures were 12.5, 9.8, 3.2, and -3.5 °C. Calculate R2R^2.
  1. y^1=206(1)=14,y^2=8,y^3=2,y^4=4\hat{y}_1 = 20 - 6(1) = 14, \quad \hat{y}_2 = 8, \quad \hat{y}_3 = 2, \quad \hat{y}_4 = -4

    Substitute each altitude into the regression equation y^=206x\hat{y} = 20 - 6x to get the predicted temperature.

  2. e1=12.514=1.5,e2=9.88=1.8,e3=3.22=1.2,e4=3.5(4)=0.5e_1 = 12.5 - 14 = -1.5, \quad e_2 = 9.8 - 8 = 1.8, \quad e_3 = 3.2 - 2 = 1.2, \quad e_4 = -3.5 - (-4) = 0.5

    Calculate residuals as the difference between observed and predicted temperatures at each altitude.

  3. RSS=(1.5)2+(1.8)2+(1.2)2+(0.5)2=2.25+3.24+1.44+0.25=7.18\text{RSS} = (-1.5)^2 + (1.8)^2 + (1.2)^2 + (0.5)^2 = 2.25 + 3.24 + 1.44 + 0.25 = 7.18

    Square each residual and sum them to get the residual sum of squares.

  4. yˉ=12.5+9.8+3.2+(3.5)4=224=5.5\bar{y} = \frac{12.5 + 9.8 + 3.2 + (-3.5)}{4} = \frac{22}{4} = 5.5

    Find the mean of the observed temperatures.

  5. TSS=(12.55.5)2+(9.85.5)2+(3.25.5)2+(3.55.5)2=49+18.49+5.29+81=153.78\text{TSS} = (12.5 - 5.5)^2 + (9.8 - 5.5)^2 + (3.2 - 5.5)^2 + (-3.5 - 5.5)^2 = 49 + 18.49 + 5.29 + 81 = 153.78

    Calculate the total sum of squares as the sum of squared deviations from the mean.

  6. R2=17.18153.78=10.0467=0.953R^2 = 1 - \frac{7.18}{153.78} = 1 - 0.0467 = 0.953

    Use the formula R2=1RSSTSSR^2 = 1 - \frac{\text{RSS}}{\text{TSS}} to find the coefficient of determination.

Answer: R20.953 or 95.3%R^2 \approx 0.953 \text{ or } 95.3\%

An R2R^2 of 0.953 indicates that 95.3% of temperature variation is explained by altitude alone, showing an excellent fit. The remaining 4.7% of variation might come from seasonal effects, weather patterns, or measurement error.

3. Calculating R² for Video Game Level vs Points

Problem

In a video game, a player's total points should grow with their level. The regression model is y^=100+50x\hat{y} = 100 + 50x where xx is the level and yy is total points earned. For levels 1 through 5, the actual points were 145, 195, 305, 395, and 510. Calculate R2R^2.
  1. y^1=150,y^2=200,y^3=250,y^4=300,y^5=350\hat{y}_1 = 150, \quad \hat{y}_2 = 200, \quad \hat{y}_3 = 250, \quad \hat{y}_4 = 300, \quad \hat{y}_5 = 350

    Calculate expected points for each level using y^=100+50x\hat{y} = 100 + 50x.

  2. e1=145150=5,e2=195200=5,e3=305250=55,e4=395300=95,e5=510350=160e_1 = 145 - 150 = -5, \quad e_2 = 195 - 200 = -5, \quad e_3 = 305 - 250 = 55, \quad e_4 = 395 - 300 = 95, \quad e_5 = 510 - 350 = 160

    Find residuals showing how actual points differ from the model's predicted values.

  3. RSS=(5)2+(5)2+552+952+1602=25+25+3025+9025+25600=37700\text{RSS} = (-5)^2 + (-5)^2 + 55^2 + 95^2 + 160^2 = 25 + 25 + 3025 + 9025 + 25600 = 37700

    Square each residual and sum them.

  4. yˉ=145+195+305+395+5105=15505=310\bar{y} = \frac{145 + 195 + 305 + 395 + 510}{5} = \frac{1550}{5} = 310

    Calculate the mean of all observed point values.

  5. TSS=(145310)2+(195310)2+(305310)2+(395310)2+(510310)2=87700\text{TSS} = (145 - 310)^2 + (195 - 310)^2 + (305 - 310)^2 + (395 - 310)^2 + (510 - 310)^2 = 87700

    Calculate the total sum of squares from all deviations from the mean.

  6. R2=13770087700=50000877000.571R^2 = 1 - \frac{37700}{87700} = \frac{50000}{87700} \approx 0.571

    Apply the formula to find R2R^2.

Answer: R20.571 or 57.1%R^2 \approx 0.571 \text{ or } 57.1\%

An R2R^2 of approximately 0.571 means only about 57% of points variation is explained by level alone. The remaining 43% comes from other factors like bonus multipliers, combo streaks, or difficulty mode, showing the limitations of using level alone to predict points.

Common mistakes

Where Coefficient of Determination usually goes wrong
Answer came out wrong
I calculated the correlation coefficient r=0.8r = -0.8, so R2=0.8R^2 = -0.8.
Square the correlation: R2=(0.8)2=0.64R^2 = (-0.8)^2 = 0.64, meaning 64% of the variation is explained by the relationship.
R2=0.85R^2 = 0.85 means 85% of my predictions were correct.
Interpret correctly: R2=0.85R^2 = 0.85 means the regression line explains 85% of the observed variation in the response variable, but says nothing about prediction accuracy.
My R2R^2 is 0.5, so the model is bad and I should choose a different method.
Always interpret R2R^2 in the context of your field: compare to similar published studies, consider the practical importance of the unexplained variation, and consult domain experts.
The mistakeWhy it is wrongThe fix
I calculated the correlation coefficient r=0.8r = -0.8, so R2=0.8R^2 = -0.8.The correlation coefficient rr can be negative because it shows direction, but R2R^2 is always non-negative because it is rr squared, and squaring a negative number gives a positive result.Square the correlation: R2=(0.8)2=0.64R^2 = (-0.8)^2 = 0.64, meaning 64% of the variation is explained by the relationship.
R2=0.85R^2 = 0.85 means 85% of my predictions were correct.R2R^2 measures the proportion of variation explained by the model, not the percentage of correct predictions; it describes how well the line fits the data, not how often predictions hit the mark.Interpret correctly: R2=0.85R^2 = 0.85 means the regression line explains 85% of the observed variation in the response variable, but says nothing about prediction accuracy.
My R2R^2 is 0.5, so the model is bad and I should choose a different method.Whether R2=0.5R^2 = 0.5 is good depends entirely on the context and field; in social sciences and psychology, 0.5 is often considered very good, while in physics or engineering, it might indicate a poor fit.Always interpret R2R^2 in the context of your field: compare to similar published studies, consider the practical importance of the unexplained variation, and consult domain experts.

Tips and when to use something else

  • R2R^2 always falls between 0 and 1 (or 0% and 100%); if you calculate a value outside this range, you made an arithmetic error, such as swapping RSS and TSS or using the wrong formula.
  • Never rely on R2R^2 alone—always plot your data and residuals visually, because R2R^2 can be high even when the relationship is actually nonlinear or when a few outliers distort the fit.
  • When comparing two regression models with different numbers of predictors, use adjusted R2R^2 instead of regular R2R^2, because adjusted R2R^2 penalizes adding unnecessary predictors and prevents overfitting.
  • For a simple two-variable relationship, R2R^2 equals the square of Pearson's correlation coefficient: R2=r2R^2 = r^2, so you can convert between them quickly.

Frequently asked questions

What is the difference between R2R^2 and the correlation coefficient rr?
The correlation coefficient rr measures both strength and direction of a linear relationship and ranges from -1 to 1. R2R^2 is simply rr squared, ranges from 0 to 1, and shows only the proportion of variation explained; the sign (direction) is lost when you square.
Can R2R^2 be greater than 1 or negative?
No, R2R^2 must always be between 0 and 1 (or 0% and 100%) when calculated correctly. If you get a value outside this range, you have made a calculation error, such as using the wrong formula or accidentally reversing residual and total sums of squares.
Why should I care about R2R^2 if I already have a regression equation?
R2R^2 tells you how much to trust your equation's predictions. A high R2R^2 (near 1) means the equation fits well and your predictions will be reliable; a low R2R^2 (near 0) means other factors strongly influence the outcome, so predictions based on the equation alone will be unreliable.
Does a high R2R^2 guarantee my model is useful?
High R2R^2 is necessary but not sufficient for a good model. You must also verify that the relationship is truly linear, that residuals are scattered randomly with no pattern, that there are no influential outliers, and that the model makes practical sense in your specific context.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18