Tutorials › Introduction to Statistics › Why a High R-Squared Does Not Guarantee a Good Model

Residuals and Transformations · Tutorial 285 of 996

Why a High R-Squared Does Not Guarantee a Good Model

Learn to use residual patterns, data context, and the limits of observed ranges to judge whether a high R-squared supports a useful linear model.

Intermediate 12 min read

What You'll Learn

  • Explain what R-squared summarizes—and what it does not.
  • Identify curvature that a high R-squared can mask.
  • Recognize why changing residual spread can undermine model-based uncertainty.
  • Explain how one observation can dominate an apparently strong relationship.
  • Distinguish interpolation from extrapolation beyond the observed predictor range.
  • Separate a strong association from evidence of a causal effect.

Why a Large R-Squared Is Not a Model Check

A fitted line can account for a large fraction of the observed variation in a response while still being a poor description of how that response changes with a predictor. The issue is that \(R^2\) compresses the fit into one overall number. It does not show whether the residuals follow a pattern, whether the spread of those residuals stays roughly constant, or whether one observation has an outsized role in determining the line.

The coefficient of determination, \(R^2\), is a summary of how much the fitted values vary around the response mean, relative to the total variation in the observed responses. For a least-squares regression line with an intercept, it can also be calculated from the residual sum of squares and total sum of squares. A large value indicates that the line reduces the total squared deviations from the response mean. It does not establish that a linear model is appropriate, that predictions are accurate in every part of the data, or that a relationship is causal.

Definition: For observed responses \(y_i\), fitted values \(\hat{y}_i\), and response mean \(\bar{y}\), the coefficient of determination is \(R^2=1-\frac{SSE}{SST}\), where \(SSE=\sum (y_i-\hat{y}_i)^2\) and \(SST=\sum (y_i-\bar{y})^2\). In a least-squares regression with an intercept and \(SST>0\), \(R^2\) is the fraction of the observed response variation accounted for by the fitted line, relative to using \(\bar{y}\) as a prediction for every observation.

This interpretation is about the observed data and the fitted line. It is not a claim that the model explains the underlying process, that its predictions will be accurate for new observations, or that changes in the predictor cause changes in the response. To judge whether a linear model is useful, consider \(R^2\) alongside the residual plots, the range and context of the data, and the purpose of the analysis.

How a High R-Squared Can Hide Curvature

A linear model assumes that the mean response changes linearly with the predictor over the range being modeled. Residuals—the observed responses minus their fitted values—can reveal when that assumption is at odds with the data. If residuals tend to be positive at low and high predictor values but negative in the middle, or show the reverse pattern, the line is missing a curved feature.

A strong overall linear trend can make \(R^2\) very large even when that curved pattern remains. The trend accounts for most of the variation in the response; \(R^2\) does not separately tell us whether the remaining variation is random or structured. A residual plot is useful precisely because it shows the pattern that the single summary leaves out.

Worked Example: A Very High R-Squared With Curved Residuals

Consider six hypothetical observations, with predictor values \(x=1,2,3,4,5,6\) and responses \(y=101,204,309,416,525,636\). The values follow the rule \(y=100x+x^2\), so the response has both a strong increasing trend and a quadratic component. We will calculate the least-squares line and \(R^2\), then inspect the residuals.

The means are \(\bar{x}=3.5\) and \(\bar{y}=365.1667\). The centered predictor sum of squares is \(S_{xx}=\sum(x_i-\bar{x})^2=17.5\). The centered cross-product sum is \(S_{xy}=\sum(x_i-\bar{x})(y_i-\bar{y})=1872.5\), so the slope is \(b_1=S_{xy}/S_{xx}=1872.5/17.5=107\). The intercept is \(b_0=\bar{y}-b_1\bar{x}=365.1667-107(3.5)=-9.3333\). Thus the fitted line is \(\hat{y}=-9.3333+107x\).

The residuals, in order of increasing \(x\), are \(3.3333,-0.6667,-2.6667,-2.6667,-0.6667,3.3333\). Therefore,

$$ SSE=(3.3333)^2+(-0.6667)^2+(-2.6667)^2+(-2.6667)^2+(-0.6667)^2+(3.3333)^2\approx37.3333. $$

The total response variation is \(SST=\sum(y_i-\bar{y})^2\approx200394.8333\). It follows that

$$ R^2=1-\frac{37.3333}{200394.8333}\approx0.9998. $$

This extremely high \(R^2\) does not make the residuals patternless. They are positive at both ends of the predictor range and negative in the middle, a clear curved pattern. In this hypothetical example, the large overall linear trend dominates the total response variation, while the residual pattern still signals that a straight line misses a feature of the relationship.

The usual regression model describes a response as a mean relationship plus random errors. Assessing a linear fit involves checking whether a straight-line mean pattern is plausible and whether the residuals are consistent with the intended error assumptions. For many regression procedures, those assumptions include independent errors with mean zero and constant variance; normal errors are also used when particular small-sample inference procedures require them. A high \(R^2\) does not check these conditions.

Changing Residual Spread Matters Too

Even if the residuals are centered around zero without an obvious curve, their vertical spread may change across predictor or fitted values. A fan-shaped residual pattern—narrow at one end and wider at the other—is evidence that the residual variance is not constant. The fitted line may still summarize the average trend, but a single typical error size can obscure the greater uncertainty in some parts of the range. Procedures for uncertainty that rely on constant variance may then be unreliable.

Worked Example: High R-Squared With a Fan-Shaped Residual Plot

Suppose a hypothetical set of \(n=30\) observations records a measured outcome in units as a predictor increases. A least-squares line has \(SST=10{,}000\) outcome-units-squared and \(SSE=300\) outcome-units-squared. A residual plot shows residuals scattered around zero, with a noticeably narrower spread at low predictor values and a wider spread at high values.

The calculation gives \(R^2=1-SSE/SST=1-300/10{,}000=0.9700\). Thus the fitted line accounts for 97.00% of the observed response variation relative to predicting the response mean. Yet the fan shape is a separate warning: the amount of residual variation changes across the predictor range.

For a rough measure of the overall residual size, the residual standard error is \(s=\sqrt{SSE/(n-2)}\) for simple linear regression. Here \(s=\sqrt{300/(30-2)}=\sqrt{10.7143}\approx3.273\) outcome units. That one overall value does not describe the larger residual spread at high predictor values. The high \(R^2\) summarizes overall fit, but it cannot make the changing spread disappear or establish that constant-variance assumptions are appropriate.

These checks answer different questions. \(R^2\) summarizes total squared fit relative to total response variation. A residual plot displays whether errors appear systematically patterned and whether their spread changes. Neither should be substituted for the other.

One Observation Can Dominate the Relationship

A fitted line is calculated from all the observations, and some observations can affect its slope and intercept much more than others. If one observation largely determines the apparent trend, the resulting \(R^2\) may give an overly reassuring impression of a stable relationship. This is a reason to examine the data and fitted relationship rather than treating a single summary as decisive. More specialized tools for assessing unusual predictor values and influence provide additional diagnostics.

Worked Example: A High R-Squared Driven by One Observation

Consider six hypothetical pairs: \((1,1),(2,1),(3,1),(4,1),(5,1),(20,20)\). The first five responses are all 1, while the last observation has both a much larger predictor and a much larger response. The means are \(\bar{x}=35/6\) and \(\bar{y}=25/6\). The centered sums are \(S_{xx}=1505/6\), \(S_{yy}=1805/6\), and \(S_{xy}=1615/6\).

The least-squares slope is \(b_1=S_{xy}/S_{xx}=1615/1505\approx1.0731\), and the intercept is \(b_0=\bar{y}-b_1\bar{x}\approx-2.0930\). For a least-squares line with an intercept, \(R^2=S_{xy}^2/(S_{xx}S_{yy})\). Substituting the centered sums gives

$$ R^2=\frac{1615^2}{1505(1805)}=\frac{2608225}{2716525}\approx0.9601. $$

The fitted line has a high \(R^2\), but it is not a description of a steady trend across the first five observations: those five responses do not change at all. The last observation creates nearly all the observed response variation and strongly shapes the apparent association. If it were removed, the remaining responses would be constant, so \(SST=0\) and \(R^2\) would be undefined—not evidence of a well-fitting relationship. The right conclusion is that the high \(R^2\) in the full data set is highly dependent on one observation, not that the predictor has a dependable linear relationship with the response.

This example also illustrates why an observation should not be removed simply because it changes a result. First verify the recorded data and study context. Then report the analysis transparently and use appropriate diagnostics to assess how sensitive the fitted relationship is to individual observations.

High R-Squared Does Not Justify Extrapolation or Causation

A line may fit observations well within the range of predictor values while giving poor predictions outside that range. Predicting beyond the observed predictor values is extrapolation. The observed data provide less direct support there: the relationship may bend, level off, or change for reasons not visible within the measured range. A high \(R^2\) calculated from the observed data does not validate an extrapolated prediction.

Worked Example: A Perfect Fit Does Not Validate Extrapolation

Suppose five hypothetical calibration measurements have predictor values \(x=2,4,6,8,10\) and responses \(y=11,17,23,29,35\). They lie exactly on \(\hat{y}=5+3x\), so \(SSE=0\), \(SST>0\), and \(R^2=1-SSE/SST=1\). The fitted line predicts \(5+3(18)=59\) response units at \(x=18\).

That arithmetic is correct, but \(x=18\) lies beyond the observed range of 2 to 10. The perfect fit among the five measurements cannot show whether the same straight-line pattern continues to 18. The prediction of 59 response units is therefore an extrapolation, and its credibility requires information beyond the high \(R^2\) for the observed data.

A strong association also does not establish that changing the predictor would cause the response to change. In observational data, other factors may help explain why the variables move together. For example, a high \(R^2\) between daily ice-cream sales and a measure of sunburn would not show that buying ice cream causes sunburn; hot, sunny weather could affect both. Causal conclusions require an appropriate study design and justification, not a large \(R^2\) alone.

A Practical Review of a High R-Squared

Before describing a high \(R^2\) as evidence of a useful linear model, consider what else the data and question require. The model should match the purpose: explaining an average pattern, making predictions within an observed range, or supporting inference. A single fit summary cannot answer all of these questions.

1
Check the residual pattern.
Look for curvature, clusters, or other systematic structure that a straight line has not captured.
2
Compare residual spread across the range.
A changing spread can conflict with constant-variance assumptions even when residuals are centered around zero overall.
3
Consider individual observations and the data context.
Ask whether the apparent relationship depends heavily on one observation and whether the recorded values are credible.
4
Keep predictions within a defensible scope.
Distinguish predictions within the observed predictor range from extrapolations beyond it.
5
Match the conclusion to the study design.
Describe an association when the evidence is observational; do not infer causation from \(R^2\).

Common Mistake

Wrong reasoning: “The \(R^2\) is 0.97, so the linear model is excellent and its predictions are reliable.” This treats the fraction of variation summarized by \(R^2\) as if it checked residual assumptions, individual observations, prediction range, and study design.

Correction: State what \(R^2\) actually summarizes, then examine the residual plots and the context of the data. A high value can accompany curvature, changing spread, an observation that dominates the fit, or a prediction outside the observed range. It also does not turn an association into a causal effect.

Key takeaway: \(R^2\) is a useful summary of overall variation accounted for by a fitted line, not a certificate of model quality. Judge a linear model using the residual patterns, the observations and predictor range, the model assumptions relevant to the analysis, and the study design.

Check Your Understanding

Answer each question using the distinction between overall fit and model adequacy.

  1. A regression has \(R^2=0.99\), but its residuals form a U-shape. What does the high \(R^2\) summarize, and what does the residual pattern suggest?
  2. A residual plot fans outward as the predictor increases. Which feature of the residuals is changing, and why might that matter for uncertainty calculations?
  3. In a data set, most responses are nearly constant and one observation has both an extreme predictor and response. Why might a high \(R^2\) be misleading about the general relationship?
  4. A line has \(R^2=1\) for observed predictor values between 2 and 10. Does that establish accurate predictions at \(x=18\)? Explain.
  5. Why does a high \(R^2\) in observational data not, by itself, show that the predictor causes the response?