The Analyst's Path

Regression diagnostics

Regression diagnostics are the checks that show whether a fitted regression can be trusted beyond its R², by testing for four specific problems in the errors and the model. Each problem has its own test and fix, and none of them shows up in a clean-looking R². Analysts run them because wrong standard errors or biased coefficients can sit behind a regression that looks healthy.

7 min readPart of Hypothesis Testing, Correlation & RegressionOpen in course mode

A clean-looking R² and a wall of asterisks prove nothing about whether the machinery that produced them was healthy. Four specific diseases, each with a name, a test, a consequence, and a fix:

What is heteroskedasticity and how do you test for it?

1. Heteroskedasticity, the error variance is not constant. Consequence: OLS coefficients stay unbiased, but the standard errors are wrong (usually understated), so every t-test and F-test is unreliable even though the point estimates are fine. Test (Breusch & Pagan, 1979): regress the squared residuals on the original predictors (an "auxiliary regression"); the test statistic LM = n × R²(auxiliary) is distributed chi-square with degrees of freedom equal to the number of auxiliary predictors under H₀ of homoskedasticity. (White's 1980 test generalizes this by also including squares and cross-products of the predictors, same idea, a more flexible auxiliary regression.) Fix: heteroskedasticity-robust ("White") standard errors, which correct the inference without touching the coefficients; the diagnostic drill in Worked Example 6 computes the Breusch–Pagan statistic by hand.

Advertisement

What is serial correlation and how do you detect it?

2. Serial correlation, the errors are correlated with their own past values. Overwhelmingly a time-series concern (successive months, quarters, days). Same consequence as heteroskedasticity: coefficients stay unbiased, standard errors go wrong, usually too small under positive autocorrelation, manufacturing false statistical significance. Test (Durbin & Watson, 1950/1951):

DW = Σ(eₜ − eₜ₋₁)² / Σeₜ²

DW ranges from 0 to 4. DW ≈ 2 signals little autocorrelation; DW well below 2 signals positive autocorrelation (a residual that is high this period tends to stay high next period, common in trending financial series); DW well above 2 signals negative autocorrelation. The statistic and the residuals' own lag-1 autocorrelation ρ̂ are linked by the approximation DW ≈ 2(1 − ρ̂), worth holding as a mental shortcut, though it is an approximation, not an identity. The decision rule needs one thing this module does not carry: the tabulated critical bounds d_L and d_U for the sample size and predictor count, with the inconclusive region that sits between them. QM1.05 supplies both bounds and their source, so take a DW statistic there before turning it into a verdict rather than reading "below 2" as a rejection. Fix: Newey–West (HAC) standard errors, which correct the inference the same way White's correction does for heteroskedasticity. Worked Example 5 computes DW on a real time-series regression's residuals.

What is multicollinearity and how do you test for it?

3. Multicollinearity: predictors carry overlapping information. Two or more regressors are highly correlated with each other. Consequence: coefficients stay unbiased in expectation, but their standard errors inflate, sometimes drastically, so individually insignificant t-stats coexist with a strong, significant overall F and a high R². Test, the Variance Inflation Factor:

VIF_j = 1 / (1 − R²_j)

where R²_j comes from regressing predictor j on all the other predictors. A VIF around 1 means no overlap; VIF above roughly 5–10 is the conventional flag for a problem worth addressing. Fix: drop or combine the overlapping predictor, collect more data, or (if you only care about prediction rather than reading individual coefficients) simply tolerate it, since multicollinearity does not hurt the model's overall fitted values. Worked Example 8 computes VIF by hand via the auxiliary-regression definition above.

How do you catch misspecification and omitted-variable bias?

4. Misspecification, the functional form itself is wrong. The relationship may be curved where you fit a straight line, or a genuinely relevant variable may be missing (omitted-variable bias). Consequence, the only one of the four that is genuinely fatal: coefficients become biased and inconsistent, not just imprecisely estimated; no amount of additional data fixes a wrong functional form. Test for missing nonlinearity (Ramsey's RESET, 1969): add powers of the model's own fitted values (ŷ², ŷ³, …) as extra regressors and run an F-test on their joint significance; a significant result says the straight line is missing curvature the data actually has. Test for omitted-variable bias, the formula, not a black box: if the true model needs x₂ but you fit only x₁, the short regression's slope is biased by

E[b₁, short] = β₁ + β₂ · δ₁

where δ₁ is the slope from regressing the omitted variable x₂ on the included variable x₁. The bias is zero only if β₂ = 0 (the omitted variable truly does not matter) or δ₁ = 0 (the omitted variable is uncorrelated with what you did include), and you can compute the sign of the damage from the signs of β₂ and δ₁ alone, before you ever see the "corrected" regression. Worked Example 7 drills RESET; Worked Example 8 computes an omitted-variable bias end to end, formula and all.

Modern Data Analysis. Everything above is formula and table lookup by design, that is what the gate tests and what you must be able to reproduce with nothing but a calculator. A working analyst then runs the identical logic in code: a paired t-test is one line (scipy.stats.ttest_rel), a full multiple regression with every diagnostic in this section is a short, standard sequence (statsmodels.api.OLS(y, sm.add_constant(X)).fit(), then het_breuschpagan, variance_inflation_factor, and linear_reset from statsmodels.stats). None of that pipeline is taught here, on purpose (see the C-3 boundary above): DA1.05 "Statistics in Code" (quant-code region) builds it, validates it against hidden tests, and connects each function call back to the exact theory this module just gave you. Treat this paragraph as a map, not a lesson: know the destination exists, and refuse to trust a single line of output from it until you can explain, from this section, what test it just ran and what would make that test lie to you.

{
  "skill": "Auditing an AI-produced (or any pre-built) regression before using a single number from it",
  "use": "Have an AI copilot draft the regression setup and surface the standard diagnostics, then run this module's checklist yourself against its output — assumptions stated, each diagnostic named and its result interpreted, coefficients read as partial effects — before any figure leaves your notebook for a memo.",
  "tools": ["Chat/code assistants for drafting a regression script or interpreting a printout", "DA1.05's own validated notebook stack, once you reach it"],
  "prompt": "Here is a regression printout: <paste coefficients, SEs, R2, adjusted R2, F-stat, and any diagnostic output>. Walk through: (1) is each coefficient's sign and rough size economically sensible; (2) does the overall F agree with the individual t-stats, or does the mismatch suggest multicollinearity; (3) name any diagnostic test that was NOT run and should have been for this data (time series -> serial correlation; several correlated predictors -> VIF; any -> heteroskedasticity, misspecification).",
  "verify": "An assistant will happily declare a regression 'good' from R2 alone, which this whole section exists to refute. Independently name which of the four diagnostics apply to your data's structure (cross-sectional vs time series) and confirm the AI actually ran or checked for each one — a clean R2 with an unrun Breusch-Pagan test is not a clean model, it is an unchecked one (Guardrail 1-5, especially #3 Recompute).",
  "diy": "You must already be able to name all four diagnostics, their tests, and their consequences from this section unaided — that is the gated skill an AI copilot accelerates but cannot substitute for.",
  "market": "US"
}

Advertisement

Part of the course

This page is part of Hypothesis Testing, Correlation & Regression (QM1.02), in Phase 12: Finance Plus, AI and the quant-code track. The module's flashcards and its quiz are in the app.