Tutorials › Regression Analysis (Undergraduate) › R-Squared Without an Intercept

Model Fit and Nested Comparisons · Tutorial 251 of 991

R-Squared Without an Intercept

Understand why R-squared without an intercept depends on its denominator, and how to interpret and report the value a software package provides.

Intermediate 10 min read

What You'll Learn

  • Define centered and uncentered R-squared and identify the denominator each uses.
  • Explain why a no-intercept least-squares fit need not have residuals that sum to zero.
  • Derive the sum-of-squares identity that applies to an uncentered least-squares fit.
  • Recognize how a centered R-squared can be negative without an intercept.
  • Compare the centered and uncentered values in worked examples.
  • Report an R-squared value with its convention clearly stated.

Why the Intercept Matters for R-Squared

R-squared is often introduced as a summary of how much variation in a response is accounted for by a regression model. That familiar interpretation relies on a particular sum-of-squares decomposition, which holds for the usual least-squares model with an intercept. When a model is fitted without an intercept, the fitted values need not average to the observed response mean, and the residuals need not sum to zero. As a result, the familiar decomposition can fail.

A further complication is that “R-squared” can refer to different calculations. The centered version compares residual error with variation around the response mean. The uncentered version compares residual error with the sum of squared responses around zero. These denominators are different, so the two values need not agree—even when the fitted model includes an intercept.

Definition: For observed responses \(y_1,\ldots,y_n\), fitted values \(\hat{y}_1,\ldots,\hat{y}_n\), and residuals \(e_i=y_i-\hat{y}_i\), the residual sum of squares is \(SSE=\sum_{i=1}^n e_i^2\). The centered total sum of squares is \(SST=\sum_{i=1}^n(y_i-\bar{y})^2\). The centered R-squared is \(R^2_{\mathrm{centered}}=1-SSE/SST\), provided \(SST>0\). The uncentered R-squared is \(R^2_{\mathrm{uncentered}}=1-SSE/\sum_{i=1}^n y_i^2\), provided \(\sum_{i=1}^n y_i^2>0\).

The formulas have different reference points. Centered R-squared assesses residual error relative to deviations from the sample mean. Uncentered R-squared assesses residual error relative to squared responses measured from zero. The uncentered denominator is sometimes called the uncentered total sum of squares, but it is not the usual variation around the mean.

What Least Squares Guarantees Without an Intercept

Consider a simple regression through the origin, \(y_i=\beta x_i+\varepsilon_i\), fitted by least squares with no intercept. For observed pairs \((x_i,y_i)\), assume at least one \(x_i\) is nonzero. Least squares chooses \(\hat{\beta}\) to minimize \(SSE=\sum_i(y_i-\hat{\beta}x_i)^2\). This fitting rule gives

$$ \hat{\beta}=\frac{\sum_i x_i y_i}{\sum_i x_i^2}. $$

At the least-squares solution, the residuals are orthogonal to the predictor values: \(\sum_i x_i e_i=0\). Since \(\hat{y}_i=\hat{\beta}x_i\), it follows that \(\sum_i\hat{y}_i e_i=0\) as well. Expanding \(y_i=\hat{y}_i+e_i\) and summing squares therefore gives

$$ \sum_i y_i^2 =\sum_i(\hat{y}_i+e_i)^2 =\sum_i\hat{y}_i^2+2\sum_i\hat{y}_i e_i+\sum_i e_i^2 =\sum_i\hat{y}_i^2+SSE. $$

This is an exact uncentered decomposition. It explains why the uncentered R-squared equals \(\sum_i\hat{y}_i^2/\sum_i y_i^2\) for this least-squares fit. It does not establish the usual centered decomposition. In particular, orthogonality to the predictor does not imply that the residuals sum to zero.

Key result: For a least-squares regression through the origin, the uncentered sums of squares decompose as \(\sum_i y_i^2=\sum_i\hat{y}_i^2+SSE\). The centered identity \(SST=SSR+SSE\), with \(SSR=\sum_i(\hat{y}_i-\bar{y})^2\), is not guaranteed.

Why the Centered Decomposition Can Fail

To see the role of the residual sum, write \(y_i-\bar{y}=(\hat{y}_i-\bar{y})+e_i\) and expand the centered total sum of squares. The cross-product includes the residual sum, which a through-origin fit need not make zero:

$$ \begin{aligned} SST &=\sum_i(\hat{y}_i-\bar{y})^2+SSE +2\sum_i(\hat{y}_i-\bar{y})e_i\\ &=\sum_i(\hat{y}_i-\bar{y})^2+SSE -2\bar{y}\sum_i e_i. \end{aligned} $$

For the second equality, use \(\sum_i\hat{y}_i e_i=0\), so that \(\sum_i(\hat{y}_i-\bar{y})e_i=-\bar{y}\sum_i e_i\). If an intercept is included in an ordinary least-squares model, the fitted model includes a constant term and the least-squares equations imply \(\sum_i e_i=0\). The cross-product then vanishes, giving the familiar centered decomposition. Without an intercept, that condition generally does not hold, so the extra term can be nonzero.

This distinction does not mean that a centered R-squared cannot be calculated for a no-intercept fit. If \(SST>0\), the formula \(1-SSE/SST\) is still defined. But it is not generally a proportion of centered variation accounted for through the usual decomposition. Because \(SSE\) can exceed \(SST\), centered R-squared can be negative. A negative value says that the fitted model's squared residual error exceeds the total squared deviations from the sample mean; it is not an arithmetic mistake.

Worked Example: Two R-Squared Values for One Through-Origin Fit

Suppose hypothetical data have predictor values \(x=(1,2)\) and responses \(y=(1,3)\). Fit the no-intercept model \(\hat{y}_i=\hat{\beta}x_i\), then calculate both versions of R-squared.

The least-squares slope is

$$ \hat{\beta}=\frac{(1)(1)+(2)(3)}{1^2+2^2} =\frac{7}{5}=1.4. $$

Thus the fitted values are \(1.4\) and \(2.8\), and the residuals are \(1-1.4=-0.4\) and \(3-2.8=0.2\). Therefore \(SSE=(-0.4)^2+(0.2)^2=0.16+0.04=0.20\). The response mean is \(\bar{y}=2\), so \(SST=(1-2)^2+(3-2)^2=2\). The centered value is

$$ R^2_{\mathrm{centered}}=1-\frac{0.20}{2}=0.90. $$

For the uncentered value, \(\sum_i y_i^2=1^2+3^2=10\), giving

$$ R^2_{\mathrm{uncentered}}=1-\frac{0.20}{10}=0.98. $$

The values differ because they use different denominators. The centered fitted-value sum of squares is \((1.4-2)^2+(2.8-2)^2=1\), and \(1+0.20=1.20\), not \(SST=2\). Indeed, the residuals sum to \(-0.2\), so the extra term in the centered expansion is \(-2(2)(-0.2)=0.8\); adding it gives \(1.20+0.8=2\). By contrast, the uncentered fitted-value sum of squares is \(1.4^2+2.8^2=9.8\), and \(9.8+0.20=10\), as the uncentered identity requires.

Worked Example: A Negative Centered R-Squared

Now suppose a hypothetical through-origin fit uses \(x=(1,2)\) and responses \(y=(10,11)\). These responses are close to one another, but their levels are far from zero. Calculate the slope and the two R-squared values.

The fitted slope and values are

$$ \hat{\beta}=\frac{(1)(10)+(2)(11)}{1^2+2^2} =\frac{32}{5}=6.4,\qquad \hat{y}=(6.4,12.8). $$

The residuals are \(10-6.4=3.6\) and \(11-12.8=-1.8\), so \(SSE=3.6^2+(-1.8)^2=12.96+3.24=16.20\). The response mean is \(10.5\), and \(SST=(10-10.5)^2+(11-10.5)^2=0.50\). Consequently,

$$ R^2_{\mathrm{centered}}=1-\frac{16.20}{0.50}=-31.4. $$

The value is negative because the model's residual sum of squares is much larger than the responses' total squared deviations around their mean. For the uncentered calculation, \(\sum_i y_i^2=10^2+11^2=221\), so

$$ R^2_{\mathrm{uncentered}}=1-\frac{16.20}{221} =\frac{204.8}{221}\approx0.9267. $$

The uncentered value is high because the denominator measures squared distance from zero, and the responses are large relative to the residuals on that scale. It does not indicate that the model accounts for about 93% of variation around the response mean. The centered and uncentered values answer different mathematical questions.

Including an Intercept Does Not Make the Formulas Identical

When an intercept is included, the usual centered sum-of-squares decomposition holds, so the centered R-squared has its familiar interpretation. The uncentered formula still uses a different denominator and need not agree with the centered value. A small example makes the distinction clear.

Worked Example: Different Denominators Even With an Intercept

Suppose a hypothetical intercept-only model is fitted to responses \(y=(1,3)\). The fitted value for each observation is the response mean, \(\hat{y}_i=2\). The residuals are \(-1\) and \(1\), so \(SSE=1+1=2\). The centered total is \(SST=(1-2)^2+(3-2)^2=2\), giving

$$ R^2_{\mathrm{centered}}=1-\frac{2}{2}=0. $$

The uncentered denominator is \(1^2+3^2=10\), however, so \(R^2_{\mathrm{uncentered}}=1-2/10=0.80\). These calculations are consistent: the intercept model satisfies the centered decomposition, while the uncentered formula uses a different total sum of squares. Having an intercept does not make the denominators equal.

Reading and Reporting Software Output

Software packages do not all use the same convention when displaying a value labelled “R-squared,” especially for a model without an intercept. Some report the centered formula, some report an uncentered formula for no-intercept fits, and some provide options or label the convention explicitly. Do not infer the denominator from the label alone. Check the documentation or calculate the value from the reported residual sum of squares and the relevant response sum of squares.

A clear report identifies both the model and the definition used. For example: “The no-intercept least-squares model had an uncentered \(R^2\) of 0.980, calculated as one minus SSE divided by \(\sum_i y_i^2\).” If a centered value is reported instead, state that it uses \(SST=\sum_i(y_i-\bar{y})^2\). This lets readers understand the number and prevents comparisons between unlike definitions.

The choice to omit an intercept should also be justified by the modeling context, rather than made only to obtain a particular R-squared. A no-intercept model constrains the fitted response to be zero when all predictors are zero. If that restriction is not appropriate, the fit and its summaries may be misleading. Even when the restriction is appropriate, the R-squared convention still needs to be stated.

Common Mistake

A common error is to treat every R-squared as the same fraction of response variation explained, or to assume that the centered and uncentered formulas agree whenever a regression includes an intercept. Neither claim is correct. The centered decomposition supports the centered interpretation when the intercept is included; it does not convert the uncentered denominator \(\sum_i y_i^2\) into the centered denominator \(SST\). For a no-intercept fit, a centered value can be negative, while the uncentered value describes residual error relative to squared responses around zero.

For an ordinary least-squares fit, the uncentered identity ensures \(0\leq R^2_{\mathrm{uncentered}}\leq1\) when \(\sum_i y_i^2>0\), since \(SSE\geq0\) and \(\sum_i y_i^2=SSE+\sum_i\hat{y}_i^2\). This range does not make it a proportion of centered variance explained. Always name the convention and interpret the denominator actually used.

Check Your Understanding

Use the definitions and the worked calculations to answer these questions.

  1. For a no-intercept least-squares fit, what orthogonality condition leads to the uncentered sum-of-squares identity?
  2. Why does \(\sum_i x_i e_i=0\) not imply that the residuals sum to zero?
  3. In a through-origin fit with \(SSE=12\) and \(SST=5\), what is the centered R-squared, and what does its sign tell you?
  4. For responses \(y=(2,4)\), calculate the centered and uncentered denominators. Explain why they are not interchangeable.
  5. What information should accompany a reported R-squared for a model fitted without an intercept?