Why Adjusted R-Squared Needs a Definition
In ordinary least squares regression, ordinary R-squared summarizes the fraction of the observed variation in a response that is accounted for by the fitted values. Its familiar formula compares the residual sum of squares with the total sum of squares. However, the two sums of squares do not have the same degrees of freedom: estimating regression coefficients uses information from the sample. Adjusted R-squared accounts for this difference by comparing the corresponding sums of squares per degree of freedom.
The definition depends on a clear coefficient count. In this tutorial, the model includes an intercept, and \(k\) denotes the total number of estimated regression coefficients, including the intercept. If there are \(q\) predictors, then \(k=q+1\). This convention matters because the residual degrees of freedom are \(n-k\), not \(n-q\).
The denominator \(n-k\) is the residual degrees of freedom, and \(n-1\) is the total degrees of freedom about the sample mean. Since the model has an intercept, the fitted residuals sum to zero, and the centered total sum of squares decomposes as \(TSS=SSR+RSS\), where \(SSR\) is the regression sum of squares. In the usual least squares setting, this also gives \(R^2=SSR/TSS\). Adjusted R-squared is built from the ratio of mean squares, not simply from the unadjusted fraction \(SSR/TSS\).
From Ordinary to Adjusted R-Squared
Ordinary R-squared uses the raw ratio \(RSS/TSS\). Adjusted R-squared instead divides each sum of squares by its degrees of freedom before taking the ratio. Substituting the ordinary R-squared definition into the adjusted formula gives a second useful expression:
This expression makes the role of the coefficient count visible. When \(n>k\), the multiplier \((n-1)/(n-k)\) is greater than one if \(k>1\). Thus, for an ordinary least squares model with an intercept, adjusted R-squared is generally no greater than ordinary R-squared. It is a penalized fit summary, not a literal estimate of the fraction of sample variation explained. In particular, adjusted R-squared can be negative even though ordinary R-squared for an intercept model is between zero and one.
Why the Degrees-of-Freedom Formula Holds
The formula follows from comparing two sums of squares after accounting for how many independent pieces of information remain. There are \(n\) observed responses. Estimating \(k\) coefficients leaves \(n-k\) residual degrees of freedom. The total sum of squares is measured around the estimated sample mean, which uses one degree of freedom and leaves \(n-1\).
The residual mean square is \(RSS/(n-k)\). It scales the remaining squared errors by the number of degrees of freedom available after fitting the coefficients.
The sample variance of the response is \(TSS/(n-1)\), because \(TSS\) is calculated around the sample mean.
Subtract the residual mean square divided by the total mean square from one. This produces \(1-\{RSS/(n-k)\}/\{TSS/(n-1)\}\), the definition of adjusted R-squared.
The justification is the degrees-of-freedom adjustment: the raw residual sum of squares is not divided by the same kind of sample size as the total sum of squares. Adjusted R-squared puts both quantities on a per-degree-of-freedom scale before forming a unitless measure. This construction does not require normally distributed errors merely to calculate the statistic. Normality, independence, and constant variance are assumptions used for some regression inference, not algebraic requirements of the definition.
Worked Examples
Worked Example: Calculating Adjusted R-Squared From Sums of Squares
A hypothetical portfolio study fits an ordinary least squares model with an intercept and two predictors to \(n=12\) observations. The model has \(RSS=90\) and the response has \(TSS=180\). For a stochastic model specification, suppose the errors are independent and normally distributed as \(N(0,16)\); the observed sums of squares are the values supplied. No interest rate or mortality assumption applies. Find ordinary and adjusted R-squared.
Method. Count all coefficients, including the intercept. There are \(q=2\) predictors, so \(k=q+1=3\). The residual degrees of freedom are \(n-k=12-3=9\), and the total degrees of freedom are \(n-1=11\).
First calculate ordinary R-squared:
Now use the degrees-of-freedom definition:
Check. The adjusted value, about \(0.3889\), is below the ordinary value \(0.5\), as expected here because the residual sum of squares is scaled using fewer residual degrees of freedom. The common mistake to avoid is using \(n-q=10\) as the residual degrees of freedom; the intercept is estimated too, so the correct count is \(n-k=9\).
Worked Example: Using the Predictor Count Carefully
A hypothetical maintenance-cost analysis uses \(n=20\) observations and a regression with an intercept and four predictors. Its residual sum of squares is \(120\), and its total sum of squares is \(300\). Suppose the model errors are independent with distribution \(N(0,25)\); no interest rate or mortality assumption applies. Calculate both fit summaries.
There are \(q=4\) predictors, so the total number of coefficients is \(k=4+1=5\). Therefore, \(n-k=20-5=15\) and \(n-1=19\).
Ordinary R-squared is
For adjusted R-squared, the residual mean square is \(120/15=8\), and the total mean square is \(300/19\). Thus,
Check. The adjusted value is approximately \(0.4933\), less than the ordinary value \(0.6\). The key count is five estimated coefficients, not four: the intercept consumes one coefficient as well as the four slopes. The specified error distribution is part of the illustrative model, but neither it nor its variance is needed in these calculations.
Worked Example: Calculating From Ordinary R-Squared
A hypothetical study of service times uses \(n=10\) observations and an intercept plus two predictors. The reported ordinary R-squared is \(0.5\). Suppose the errors are independent with distribution \(N(0,9)\); no interest rate or mortality assumption applies. Find adjusted R-squared without first recovering the individual residuals.
There are \(k=2+1=3\) coefficients. The residual degrees of freedom are \(10-3=7\), while the total degrees of freedom are \(10-1=9\). Use the equivalent formula in terms of ordinary R-squared:
Check. The result is approximately \(0.3571\), below \(0.5\). The calculation needs only the ordinary R-squared, sample size, and coefficient count; the Gaussian error specification is not an input to the formula. A common mistake is to use the number of predictors, two, in place of \(k=3\), which would give the wrong residual degrees of freedom.
Conditions and Common Exam Traps
The displayed definition is for an ordinary least squares regression with an intercept, with sums of squares calculated from the same \(n\) response observations. It requires \(n>k\), so at least one residual degree of freedom remains, and \(TSS>0\), so the response is not constant in the sample. If \(n=k\), the residual degrees of freedom are zero and the adjusted formula is undefined. If \(TSS=0\), ordinary R-squared itself has a zero denominator.
The intercept condition is important. With an intercept, \(TSS\) is centered around \(\bar y\), and the usual decomposition and interpretation apply. In a regression forced through the origin, software may report an uncentered R-squared based on a different total sum of squares. Do not insert such an output into this centered definition without checking how the software defines its sums of squares.
A frequent exam error is treating “number of coefficients” and “number of predictors” as interchangeable. Under the convention here, if there are \(q\) predictors and an intercept, \(k=q+1\). For example, a model with three predictors has four estimated coefficients. The residual degrees of freedom are therefore \(n-4\), not \(n-3\). When a problem directly provides \(k\), use that count as stated; do not add another intercept.
Another trap is interpreting adjusted R-squared as the actual percentage of variation explained. Ordinary R-squared has that sample decomposition interpretation for an intercept model. Adjusted R-squared modifies the residual-to-total ratio for degrees of freedom, so it is a complexity-adjusted summary instead. It may be negative: that indicates that the degrees-of-freedom-adjusted residual mean square exceeds the total mean square, not that the model explains a negative physical amount of variation.
Check Your Understanding
For each problem, use the intercept-included definition and count the intercept in \(k\). Round numerical answers to four decimal places when needed.
- A regression uses \(n=16\) observations, an intercept, and one predictor. It has \(RSS=70\) and \(TSS=140\). Find ordinary and adjusted R-squared. (Answer: \(R^2=0.5000\), \(R^2_{\mathrm{adj}}=0.4643\))
- A model has \(n=25\), an intercept, and three predictors, with \(RSS=168\) and \(TSS=280\). Calculate adjusted R-squared. (Answer: \(0.3143\))
- A regression has \(n=18\), an intercept, and three predictors. Its ordinary R-squared is \(0.64\). Calculate adjusted R-squared. (Answer: \(0.5629\))
- A model fitted to \(n=30\) observations has an intercept and five predictors, with \(RSS=240\) and \(TSS=600\). Find ordinary and adjusted R-squared, showing the coefficient count. (Answer: \(k=6\), \(R^2=0.6000\), \(R^2_{\mathrm{adj}}=0.5167\))
- A proposed calculation has \(n=9\), an intercept, and eight predictors, with a positive TSS. Is adjusted R-squared defined by the usual formula? Explain using the residual degrees of freedom. (Answer: No; \(k=9\), so \(n-k=0\) and the denominator \(RSS/(n-k)\) is undefined.)