R² (R-squared)
For a nonconstant outcome on a specified evaluation sample, the centered score is \(R^2=1-\mathrm{SSE}/\mathrm{SST}\), where SSE sums squared prediction errors and SST sums squared deviations from that sample’s observed mean. It is 1 for perfect predictions, 0 for the mean benchmark, and can be negative when predictions are worse. With actual values 1, 2, 3 and predictions 3, 2, 1, it is -3. Constant outcomes need separate handling. Some no-intercept regression summaries use an uncentered definition, so state the convention.
On the training sample of simple ordinary least squares with an intercept and nonconstant predictor and outcome, \(R^2\) equals the squared predictor–outcome correlation. Under those conditions, correlation 0.5 gives \(R^2=0.25\). The equality is not a general definition for other models or evaluation samples.
Three things it is not
- Training fit is not evidence of predictive accuracy. \(R^2\) is usually computed on the data the model was fitted to, and fit on training data is a different claim from performance on new data. The distinction is the same one that separates residuals from forecast errors: “residuals are calculated on the training set while forecast errors are calculated on the test set.” To know whether a model predicts, measure error on data it has not seen — see forecast error.
- Not evidence of causation. A model can account for most of the variance through a variable that causes nothing. “The best explanation for an association between treatment and outcome in an observational study is not necessarily a causal effect,” and no goodness-of-fit statistic changes that. Getting to a causal claim needs “data and identifiability conditions” — see causal effect.
- Training fit can reward irrelevant predictors. Adding predictors to nested, unpenalized OLS fits with an intercept on the same sample cannot decrease centered training \(R^2\). Test \(R^2\) can decrease, and the training monotonicity does not generally apply to regularized fits or changed samples. So comparing models by \(R^2\) alone rewards complexity, and “our \(R^2\) went from 0.71 to 0.74” is not by itself a finding.
The third point is why the number should never be the basis of a model-selection decision on its own, and why held-out performance is the comparison that matters. See regression models.
What a low value does and does not mean
A low \(R^2\) is not automatically a bad model, and this is worth saying because it drives unnecessary work. Some outcomes are intrinsically noisy — individual human behavior, short-horizon price movements — and in those settings accounting for 5% of the variance can be both the best achievable and commercially valuable. The forecasting literature’s framing of error is the right attitude: an error “does not mean a mistake, it means the unpredictable part of an observation.”
Conversely a very high \(R^2\) deserves suspicion rather than celebration. The usual causes are a predictor that encodes the outcome, a leak from the future, or a trend that both series share — and all three produce an excellent fit and a useless model.
Two habits keep it useful. Report it with an error measure in the units of the outcome, since \(R^2\) is dimensionless and a stakeholder cannot act on a proportion of variance — see RMSE and MAE. And look at the residuals rather than the summary: the same \(R^2\) is consistent with a well-behaved fit and with a systematic pattern the model is missing entirely, and only the plot distinguishes them.
Further reading
- Hyndman & Athanasopoulos, Forecasting: Principles and Practice (3rd ed.), §2.8 “Autocorrelation”
- §5.8 “Evaluating point forecast accuracy”
- Hernán & Robins, Causal Inference: What If
- scikit-learn, R2 score
Discover more from Insightful Data Lab
Subscribe to get the latest posts sent to your email.
