Variance Decomposition in Regression Models: What Lies Behind R² and the F-test?
Variance Decomposition in Regression Models: What Lies Behind R² and the F-test?
1. Introduction: Three Seemingly Independent Concepts, One Logical Chain
After completing introductory econometrics, you likely have at least three independent memories about regression models:
- Variance decomposition: SST = SSE + SSR. Total sum of squares = explained sum of squares + residual sum of squares. You memorized it, but don't know what else it's for besides computing R².
- R² (goodness of fit): "The percentage of Y's variation explained by the model." 0.8 is better than 0.3 — but what exactly is R² divided by what? Why does adding variables always increase R²?
- F-test: The F-statistic at the bottom of the Stata output table. "Tests whether all coefficients are jointly zero." But why is the F-statistic related to R²?
If you also feel these three things are "known but not connected," this article is for you. Variance decomposition is the root, R² is the fruit, and the F-test is a specific use of that fruit. They share the same numerator and denominator, just using different components.
Core message: Variance decomposition splits Y's total variation into two parts — explained by the model (SSE) and unexplained (SSR). R² = SSE/SST, which is "the proportion explained." The F-statistic = (SSE/k) / (SSR/(n-k-1)), which is the ratio of "average variation explained per variable" to "average noise remaining per degree of freedom." The three share the same raw materials (SSE and SSR), just prepared as different "dishes."
2. Variance Decomposition — Y's Total Variation Split in Two
2.1 Definitions of the Three Sums of Squares
For the standard linear regression model , after OLS estimation, Y's total variation is decomposed into three parts:
SST (Total Sum of Squares): Y's total variation — the sum of squared deviations of each observation from the mean of Y. If there were no independent variables, this is all the "stuff that needs to be explained" you face.
SSE (Explained Sum of Squares, also called regression sum of squares ESS or Model SS): The sum of squared deviations between the model's fitted values and the mean of Y. This is "the variation the model helps you remove" — what your independent variables can explain.
SSR (Residual Sum of Squares, also called RSS): The sum of squared deviations between actual observations and fitted values . This is "what the model failed to explain, what's left over" — the sum of squared residuals.
Notation reminder: Different textbooks and software use opposite naming conventions for SSE and SSR. This article uses SSE = explained sum of squares and SSR = residual sum of squares. When reading other sources, please verify which naming system the author uses.
2.2 Geometric Intuition of Variance Decomposition
Imagine a vector in n-dimensional space. The actual observations of Y minus the mean form a vector . Your independent variables span a subspace (the column space). What OLS does is orthogonally project onto the subspace spanned by the independent variables — the squared length of the projection is SSE, and the squared perpendicular distance remaining after projection is SSR.
SST = SSE + SSR holds — and there is no cross-term between SSE and SSR — precisely because OLS's orthogonal projection guarantees that fitted values and residuals are orthogonal. This is not a "coincidence" but rather the geometric essence of the OLS method that determines residuals and fitted vectors must be perpendicular.
2.3 ANOVA Table — The "Standard Output" of Variance Decomposition
Most regression software reports variance decomposition in the form of an ANOVA (analysis of variance) table:
| Source | Sum of Squares (SS) | Degrees of Freedom (df) | Mean Square (MS = SS/df) |
|---|---|---|---|
| Model (Explained) | SSE | k | SSE / k |
| Residual | SSR | n - k - 1 | SSR / (n - k - 1) |
| Total | SST | n - 1 | SST / (n - 1) |
The meaning of the degrees of freedom column:
- SST has n-1 degrees of freedom because one degree of freedom is used to estimate Ȳ.
- SSE has k degrees of freedom because the model uses k coefficients (excluding the intercept) to "absorb" variation.
- SSR has n-k-1 degrees of freedom, which is the amount of independent information in the residuals — a continuation of the "residual degrees of freedom" discussed in the previous article.
3. R² — The First Use of Variance Decomposition
3.1 Two Ways to Write R²
Both formulations say the same thing: R² = "variation explained by the model" divided by "total variation."
If R² = 0.35, it means "35% of Y's total variation can be explained by the linear combination of independent variables, and 65% is residual variation not explained by the model."
In simple regression, R² = r² (the square of the correlation coefficient) — as derived in the previous article. In multiple regression, R² is the square of the multiple correlation coefficient between Y and the linear combination of all independent variables.
3.2 Three Common Misconceptions About R² and Their Corrections
Misconception 1: "The larger the R², the better the model."
Correction: R² measures in-sample fit and has nothing to do with the model's causal explanatory power. A time series regression with R² = 0.98 could be entirely spurious (two trending variables regressed together); a causal identification study with R² = 0.05, if the identification strategy is solid, is far more credible than the former.
Moreover, the definition of R² itself determines that — adding variables means R² never decreases. Because even if a new variable is completely unrelated to Y, OLS can find a direction that is "coincidentally" slightly correlated in this particular sample to scrape a bit more SSE. This means R² is biased toward "adding more variables" — it is an "optimistic estimate" of model complexity.
Misconception 2: "A low R² means the model is useless."
Correction: This depends on your research goal. If your goal is prediction — a low R² does mean your predictions are imprecise. But if your goal is causal identification — a low R² does not mean "the estimates are unreliable." The core of causal identification is the unbiasedness and consistency of , which is a matter of omitted variable bias, not R². A causal identification paper with R² = 0.05 can be an excellent piece of research.
Misconception 3: "You can compare models with different Y variables using R²."
Correction: You cannot. The magnitude of R² is heavily influenced by the degree of variation in Y. If you study "determinants of wages" and "determinants of height" on two different datasets, even with identical independent variables, the R² values could differ dramatically — because individual variation in wages is far greater than individual variation in height. R² is not comparable across different Y variables.
3.3 Adjusted R² — A Remedy for "Adding Variables Always Increases R²"
The core idea of adjusted R²: use mean squares (MS) instead of sums of squares (SS). Each time a variable is added, SSR may decrease slightly, but you also lose one degree of freedom. Adjusted R² accounts for the cost of "model complexity" in both the numerator and denominator. When the reduction in SSR from a newly added variable is insufficient to compensate for the cost of losing that one degree of freedom, adjusted R² will decrease.
In practice, adjusted R² is a more reasonable model comparison metric than R² (for the same Y variable).
4. The F-test — The Second Use of Variance Decomposition
4.1 The F-statistic in Terms of Variance Decomposition
The F-test reported in regression output tests the null hypothesis:
That is, all k slope coefficients are simultaneously zero — the entire model has "not a single useful variable."
The construction of the F-statistic comes directly from the "mean square" column of the ANOVA table:
Numerator: The average explained variation contributed by each independent variable (SSE divided by k degrees of freedom). If the independent variables indeed have explanatory power, this value should be large.
Denominator: The average noise remaining per degree of freedom (SSR divided by n-k-1 degrees of freedom). This is "the mean square variation you would expect at pure noise level without any information from the independent variables" — that is, the unbiased estimator of the error variance .
So the F-statistic asks: "How many times larger is the average variation explained per variable in the model, compared to the level of pure noise?"
If F ≈ 1, the model's ability to explain variation is similar to the noise level — the independent variables as a whole have little explanatory power. If F >> 1, the explained variation far exceeds the noise level — unlikely to be caused by random fluctuation.
4.2 The F-statistic in Terms of R²
Starting from the definition of R², the F-statistic can be expressed entirely in terms of R²:
This expression reveals the precise relationship between R² and F:
- Given n and k, the higher the R² → the larger the F → the more likely to reject the null hypothesis that "all coefficients are zero."
- Given R², the larger the n → the larger the F. In other words, with large samples, even a very low R² (e.g., 0.02) can yield a significant F-test — because the sample size gives you confidence that "that 2% explanatory power is not random fluctuation."
- Given R² and n, the larger the k → the smaller the F. Because k in the denominator "penalizes" using more variables to achieve the same R².
A practical example: Suppose you have a sample of n=1000, the regression R²=0.02, and k=5. Plugging into the formula — F ≈ 4.06. With 5 and 994 degrees of freedom, the p-value is likely less than 0.01. This means that although the model explains only 2% of Y's variation, that 2% is statistically significantly different from zero — because the large sample gives you sufficient resolution.
This reveals an important asymmetry: A significant F-test does not imply a high R², and a low R² does not mean the model "found nothing." The F-test answers "is the explanatory power zero," while R² answers "how large is the explanatory power" — these are two different questions.
5. Implications of Variance Decomposition for Empirical Research
5.1 R² Is Not Your Friend — in Causal Identification Studies
When doing causal inference, some researchers subconsciously hope for a high R² — "it means the model has strong explanatory power." But a high R² in causal identification is actually an ambiguous signal.
If your regression has R² = 0.95, there are two possibilities:
- You genuinely found all the important determinants (good explanation).
- You included many endogenous control variables — including variables that are themselves affected by Y, or mediators that share the same omitted cause as X. These variables "absorb" a large amount of variation but turn your core coefficient estimate into some kind of causal hodgepodge.
In classic causal inference papers, R² typically ranges between 0.05 and 0.30. This is not because the model is "bad" — rather, researchers deliberately control only for the confounders that "need to be controlled," without stacking variables for the sake of explanatory power.
5.2 "Model Comparison" from the Perspective of Variance Decomposition
If you need to compare two nested models (Model A is a subset of Model B — i.e., the variables in Model A are a subset of those in Model B), you can use the partial F-test:
The numerator measures "how much the residual sum of squares decreased by adding those (k_B - k_A) variables" (averaged per added variable), and the denominator is still the noise level. This test is equivalent to a joint test that "the coefficients of the newly added variables are simultaneously zero."
This is more stringent than checking "whether each variable's t-test is significant" — sometimes individual variables are insignificant, but a group of variables is jointly significant, and the partial F-test can capture this.
5.3 "Heteroskedasticity" from the Perspective of Variance Decomposition
If the errors are heteroskedastic — i.e., is not constant but varies with X — then OLS remains unbiased, but the validity of variance decomposition is affected. Most critically, the F-statistic constructed based on the mean square equivalence "MS_Residual = σ²" no longer follows an exact F distribution — the p-values from the standard F-test you use under heteroskedasticity are wrong. In this case, you need heteroskedasticity-robust standard errors and the corresponding Wald test.
6. Summary: One Formula Connecting Three Concepts
Starting from the same formula —
Three different "uses" yield three different pieces of information:
| Use | Formula | Question Answered |
|---|---|---|
| R² | SSE / SST | "What proportion of variation does the model explain?" |
| Adjusted R² | 1 - (SSR/(n-k-1)) / (SST/(n-1)) | "How much does the model explain after penalizing for complexity?" |
| F-test | (SSE/k) / (SSR/(n-k-1)) | "Is the model's overall explanatory power significantly greater than zero?" |
One set of sums of squares, three statistics, answering three different but interrelated questions. Understanding variance decomposition means simultaneously understanding R² and the F-test.
One-sentence conclusion:
"Variance decomposition is the geometric essence of OLS — projecting Y onto the space of independent variables and seeing how large the 'projected' part and the 'unprojected' part each are. R² tells you the proportion, and the F-test tells you whether that proportion is significantly different from zero. Both are saying the same thing — to what extent your model is not just talking to noise."
7. Presentation Suggestions for Bilibili/WeChat Official Account
- Bilibili video: The core visual should use a "projection" animation — the Y vector (after subtracting the mean) projected onto the plane spanned by X, with SSE as the squared length of the projection, SSR as the squared length of the perpendicular residual, and SST as the squared length of the original vector. Adding a variable → plane dimension +1 → projection necessarily lengthens (or stays the same), visually demonstrating "adding variables never decreases R²." The intuition of the F-test can use a "signal tower" analogy — SSE is the signal, SSR is the noise, and F is the signal-to-noise ratio.
- WeChat Official Account: The ANOVA table should be formatted to match Stata/R output so readers feel familiar. The comparison table of the three uses is suitable for an infographic. The three R² misconceptions are best presented as "common pitfalls" cards.
- Recommended titles:
- Main title: 《R² and the F-test Are Actually the Same Thing — Both Come from Variance Decomposition》
- Alternative title: 《SST = SSE + SSR: This One Formula Is the Common Ancestor of R² and the F-test》
- Key quotes:
"The F-test answers 'is the explanatory power zero,' while R² answers 'how large is the explanatory power' — these are two different questions. With large samples, an R² of 2% can also be significant."