R-Squared
GeneralCoefficient of Determination
The proportion of variance in a dependent variable that is explained by a regression model, ranging from 0 (no explanatory power) to 1 (perfect fit).
Definition
R-squared, also called the coefficient of determination, is the proportion of variance in a dependent variable that is explained by a regression model, expressed on a scale from 0 to 1 (or 0% to 100%). An R-squared of 0.75, for example, means the model explains 75% of the variation seen in the outcome variable, while the remaining 25% is due to factors outside the model or random noise.
R-squared is the standard headline statistic reported alongside any regression model to communicate how well the model fits the data. The Linear Regression Calculator reports R-squared directly as part of its output, letting users judge at a glance how reliable the fitted line is likely to be for prediction.
Because R-squared is derived from correlation, it is closely linked to the Correlation Coefficient computed by the Correlation Coefficient Calculator — in simple linear regression, squaring Pearson's r gives R-squared directly.
Formula
R² = 1 − (SSres ÷ SStot)
Where SSres is the sum of squared residuals (actual minus predicted values) and SStot is the total sum of squares (actual values minus their mean). For simple linear regression with one predictor, this simplifies to:
R² = r²
where r is the Pearson correlation coefficient between the predictor and outcome.
Worked Example
A simple linear regression of advertising spend against sales produces a Pearson correlation coefficient of r = 0.85.
R² = 0.85² = 0.7225
This means the regression model explains approximately 72.25% of the variance in sales, while the remaining 27.75% is attributable to other factors, such as seasonality, pricing, or competitor activity, not captured by the model.
Key Things to Know
- Bounded between 0 and 1: an R-squared of 1 means the model explains all variance in the outcome; 0 means it explains none.
- Equals r² in simple regression: in a single-predictor model, R-squared is exactly the square of the Correlation Coefficient.
- Always rises with more predictors: adding variables to a model can only increase or maintain R-squared, even if those variables are meaningless — adjusted R-squared corrects for this.
- Doesn't confirm causation or model validity: a high R-squared reflects fit to the sample data, not proof that the model is correctly specified or will generalize well.
Related Calculators
Frequently Asked Questions