起源故事 · 高斯的"剩下没解释的部分" Origin Story · Gauss and "the part the model couldn't explain"
"残差"这个概念,可以追溯到 高斯勒让德在 19 世纪初为预测天体轨道发明的最小二乘法 —— 它做的事就是让"预测没解释掉的那部分(残差)"平方和最小。后来统计学家发现:残差不只是个被压小的副产品, 它本身藏着模型的全部秘密。Anscombe 四重奏更是用四组 R² 完全相同、散点却天差地别的数据, 惊醒所有人 —— 光看 R² 会被骗,必须把残差画出来看。这就是回归诊断的由来。 The idea of a "residual" traces back to least squares, invented by Gauss and Legendre in the early 1800s to predict the orbits of celestial bodies. The method does one thing: it minimises the sum of squared residuals — the part the prediction couldn't explain. Statisticians later realised the residuals are not a leftover by-product; they hold every secret the model is hiding. Anscombe's quartet drove the point home with four datasets that share an identical R² but look completely different — R² alone will fool you; you have to plot the residuals. That insight is the entire reason regression diagnostics exists.

1 拟合图:这条线看起来还行? Fitted Plot: does the line look OK?

健康

散点 + 最小二乘回归线。竖线是每个点的残差。直接拖动任意一点,看下方残差图如何瞬间反应。 Scatter plus the least-squares line. Each vertical stub is one residual. Drag any point and watch the residual plot react instantly.

2 残差图:真相在这里暴露 Residual Plot: where the truth shows up

3 现实里的回归诊断 Regression Diagnostics in the Real World

模型验证:交付任何回归结论前,残差图是必过的体检项,比 R² 更能说明问题。 Model validation: before shipping any regression conclusion, the residual plot is a mandatory health check — far more revealing than R².
异方差检测:残差呈漏斗形(误差随 x 变大)→ 系数置信区间失真,需变换或加权。 Heteroscedasticity check: a funnel-shaped residual plot (error grows with x) distorts coefficient confidence intervals — transform y or switch to weighted least squares.
异常点识别:远离主体的高杠杆点可能单枪匹马把回归线带偏,要核实是真值还是错数据。 Influential-point detection: a high-leverage point far from the cloud can drag the whole line on its own. Verify whether it's a real extreme or a data error before acting.
模型选择:残差呈弓形说明该用二次项 / 非线性模型,直线根本不够。 Model selection: a bow-shaped residual pattern says the true relationship is curved — add a quadratic term or switch to a non-linear model; a straight line just isn't enough.
一句话In One Line
回归线只告诉你"趋势大概是这样",但它解释不了的部分 —— 残差 —— 才是裁判。 如果模型抓住了数据的全部结构,剩下的就该是纯随机噪声,残差图里看不出任何花样。 一旦残差里还残留着规律(漏斗、曲线、孤点),就说明模型还有没榨干的信息,结论不能信。 所以记住这句口诀:R² 看热闹,残差图看门道;先看残差,再信回归 The regression line only tells you "roughly, the trend goes this way". The part it couldn't explain — the residuals — is the real referee. When the model has captured every structure in the data, what's left should be pure random noise with no visible pattern. Any leftover signal (funnel, curve, lone outlier) means the model has unfinished business and the conclusions cannot be trusted. Remember the mantra: R² is the show; the residual plot is the truth — read the residuals before you believe the regression.
常见误用Common Mistakes
只看 R² 就下结论R² 高也可能残差有规律(异方差 / 弯曲),必看残差图。 Drawing conclusions from R² alone. A high R² can still mask a patterned residual (heteroscedasticity or curvature) — always plot the residuals.
看见离群点就随手删先查它是错误数据还是真实极端值,删点要有依据。 Deleting outliers on sight. Investigate first — is it a measurement error or a genuine extreme? Never drop points without a documented reason.
无视漏斗形硬解读系数异方差让标准误失真,应做变换或用稳健 / 加权回归。 Ignoring a funnel and reading the coefficients anyway. Heteroscedasticity breaks the standard errors — transform y, or use robust / weighted regression instead.

回归诊断