FH04 · REFERENCE SHEET

回归分析公式总表 Regression Formula Sheet

把最小二乘、R²、区间估计、多元回归、VIF 与逻辑回归放在同一张速查表中。自上而下重要度递减:先背 T1,再熟练 T2,最后按需查 T3。 One working sheet for least squares, R², interval estimates, multiple regression, VIF, and logistic regression. Importance drops as you move down: memorize T1, work fluently with T2, and pull T3 when the model calls for it.

覆盖范围 Coverage
T1 → T3
核心回归工具链 core regression stack
T1

必背 · 读懂回归输出的骨架 Memorize · The Skeleton of Every Regression Output

5 张核心卡 5 core cards
T1-1

一元模型 Simple Linear Model

F22 深潜 → F22 deep dive →
ŷ = b0 + b1x

读作:一条直线:截距,加斜率乘 x。Read it as: A straight line: intercept plus slope times x.

  • ŷ 给定 x 时的预测响应 predicted response at a given x
  • b0, b1 估计截距与估计斜率 estimated intercept and slope
何时用: Use it when: 用一条直线描述一个连续自变量与响应之间的平均关系。 A straight line is a defensible description of the mean response across one continuous predictor.
✗ 把 ŷ 当成每个单值都会命中 → ✓ 把它当成给定 x 时的条件均值预测,并保留残差波动。 ✗ Treat ŷ as a guaranteed individual outcome → ✓ Read it as the conditional mean at x and retain the residual variation.
T1-2

斜率(最小二乘) Least-Squares Slope

F22 深潜 → F22 deep dive →
b1 = Sxy/Sxx = Σ(xi−x̄)(yi−ȳ) / Σ(xi−x̄)2

读作:x 和 y 一起变的量,除以 x 自己变的量。Read it as: How x and y move together, divided by how x moves on its own.

  • Sxy x 与 y 的离均差乘积和 cross-product sum for x and y
  • Sxx x 的离均差平方和 sum of squared deviations in x
何时用: Use it when: 量化 x 每改变一个单位,平均响应 y 改变多少。 You need the expected change in y for a one-unit change in x.
✗ 把非零斜率直接解释为因果效应 → ✓ 先确认设计、混杂控制与时间顺序支持因果解释。 ✗ Call every nonzero slope causal → ✓ Require a design, confounding control, and time order that can support causality.
T1-3

截距 Intercept

F22 深潜 → F22 deep dive →
b0 = ȳ − b1
(x̄, ȳ) ∈ fitted line

读作:让直线必定穿过均值点 (x̄, ȳ)。Read it as: Set the intercept so the line must pass through the mean point (x̄, ȳ).

  • b0 x = 0 时的拟合响应 fitted response when x = 0
  • (x̄, ȳ) 回归线必过的样本均值点 sample-mean point that the fitted line must cross
何时用: Use it when: 补全最小二乘直线,并检查回归线是否经过 (x̄, ȳ)。 You need the complete least-squares line or a quick check that it passes through (x̄, ȳ).
✗ 当 x = 0 远离数据范围时仍赋予截距物理意义 → ✓ 仅在零点有业务意义且未外推时解释 b0 ✗ Give b0 a physical story when x = 0 lies far outside the data → ✓ Interpret it only when zero is meaningful and within scope.
T1-4

R² 决定系数 Coefficient of Determination

F22 深潜 → F22 deep dive →
R2 = SSR/SST = 1 − SSE/SST

读作:y 的总变化里,被这条线解释掉的比例。Read it as: The share of y's total variation explained by this line.

  • SSR / SST 回归解释平方和/总平方和 regression sum of squares over total sum of squares
  • SSE 残差平方和 error sum of squares
何时用: Use it when: 表达“y 的变异被 x 解释的比例”。 You need the share of observed variation in y accounted for by x.
✗ 用高 R² 证明模型正确或预测精准 → ✓ 同时检查残差、预测误差与数据适用范围。 ✗ Use a high R² as proof that the model is correct or predictive → ✓ Inspect residuals, prediction error, and the data domain as well.
T1-5

残差 Residual

F22 深潜 → F22 deep dive →
ei = yiŷi

读作:真实值减预测值——模型没吃掉的部分。Read it as: Observed minus predicted—the part the model did not absorb.

  • yi 第 i 个观测响应 observed response for case i
  • ŷi 第 i 个拟合响应 fitted response for case i
何时用: Use it when: 诊断模型未解释的部分;线性、等方差、独立性与异常点都靠它检查。 You need to diagnose what the model missed: linearity, constant variance, independence, and unusual observations all live here.
✗ 只看系数表,不画残差图 → ✓ 拟合后检查残差随拟合值、顺序与正态概率图。 ✗ Stop at the coefficient table and skip residual plots → ✓ Check residuals against fits, run order, and a normal probability scale.
T2

常用 · 推断、区间与模型比较 Working Set · Inference, Intervals, and Model Comparison

5 张常用卡 5 working cards
T2-6

回归标准误 Regression Standard Error

F56 深潜 → F56 deep dive →
s = √[SSE/(n−2)]
  • SSE 残差平方和 error sum of squares
  • n − 2 一元回归的残差自由度 residual degrees of freedom for simple regression
何时用: Use it when: 估计点围绕回归线的典型散布,并为系数与区间计算提供尺度。 You need the typical scatter around the fitted line and the scale for coefficient and interval calculations.
T2-7

斜率显著性 Slope Significance

F56 深潜 → F56 deep dive →
SE(b1) = s/√Sxx
t = b1/SE(b1),  df = n−2
  • SE(b1) 斜率估计的标准误 standard error of the estimated slope
  • t 检验 H₀:b1 = 0 的统计量 test statistic for H₀: b1 = 0
何时用: Use it when: 判断数据是否提供了总体斜率非零的统计证据。 You need to test whether the data support a nonzero population slope.
T2-8

调整 R² Adjusted R²

F23 深潜 → F23 deep dive →
2 = 1 − (1−R2)(n−1)/(n−p−1)
  • p 自变量个数 number of predictors
  • 2 对模型复杂度施加惩罚的 R² R² penalized for model size
何时用: Use it when: 比较自变量数量不同的模型,让加变量不再“白赚”拟合度。 You are comparing models with different predictor counts and do not want extra terms to earn free fit.
T2-9

置信区间 vs 预测区间 Confidence vs Prediction Interval

F56 深潜 → F56 deep dive →
mean CI: ŷ ± t·s·√[1/n + (x0−x̄)2/Sxx]
individual PI: ŷ ± t·s·√[1 + 1/n + (x0−x̄)2/Sxx]
1单值噪声 1Individual-observation noise: 1 1/n均值不确定 1/nMean-estimation uncertainty: 1/n (x0−x̄)2/Sxx离中心越远越宽(杠杆项)Farther from center means wider—the leverage term
  • mean CI x0 处平均响应的置信区间 confidence interval for the mean response at x0
  • individual PI x0 处单个新观测的预测区间;PI 恒宽于 CI prediction interval for one new observation at x0; PI is always wider than CI
何时用: Use it when: 区分“平均会落在哪”与“下一个单值会落在哪”。 You must distinguish where the average response lies from where the next individual result may land.
F = MSR/MSE = (SSR/p) / (SSE/(n−p−1))
  • MSR / MSE 回归均方/残差均方 regression mean square over error mean square
  • p 自变量个数 number of predictors
何时用: Use it when: 检验所有斜率同时为 0 的原假设,判断模型整体是否提供解释力。 You need to test the joint null that every slope is zero and whether the model contributes as a whole.
T3

进阶 · 多变量、共线性与二分类响应 Advanced · Multiple Predictors, Collinearity, and Binary Responses

4 张进阶卡 4 advanced cards
T3-11

多元回归矩阵解 Multiple Regression Matrix Solution

F23 深潜 → F23 deep dive →
β̂ = (XTX)−1XTy
  • X 含各自变量列的设计矩阵 design matrix containing the predictor columns
  • β̂ 最小二乘系数估计向量 vector of least-squares coefficient estimates
何时用: Use it when: 用矩阵形式同时估计多个自变量的偏回归系数。 You need all partial regression coefficients estimated simultaneously in matrix form.
T3-12

VIF 共线性 VIF for Collinearity

F23 深潜 → F23 deep dive →
VIFj = 1/(1−Rj2)  ;  >5 caution  ;  >10 severe
  • Rj2 用其余自变量回归第 j 个自变量所得的 R² R² from regressing predictor j on all other predictors
  • VIFj 第 j 个系数方差的膨胀倍数 variance inflation factor for coefficient j
何时用: Use it when: 筛查多元模型中的共线性;>5 警惕,>10 严重。 You are screening a multiple regression for collinearity; values above 5 warrant caution and above 10 are severe.
T3-13

逻辑回归 Logistic Regression

F24 深潜 → F24 deep dive →
ln[p/(1−p)] = β0 + β1x
OR = eβ₁
  • p 事件发生概率 probability of the event
  • OR x 每增加 1 单位对应的优势比 odds ratio for a one-unit increase in x
何时用: Use it when: 响应为二分类,并需要把自变量与事件概率联系起来。 The response is binary and predictors must be related to event probability.
T3-14

相关与回归 Correlation and Regression

F04 深潜 → F04 deep dive →
r = Sxy/√(Sxx·Syy)
simple regression: R2 = r2
  • r Pearson 线性相关系数 Pearson linear correlation coefficient
  • R2 = r2 仅在含截距的一元线性回归中成立 identity for simple linear regression with an intercept
何时用: Use it when: 在一元线性场景中连接相关强度与回归解释度。 You need to connect correlation strength with explained variation in a simple linear setting.
相关教学页 Related teaching pages
12 · 最小二乘 12 · Least squares 43 · 多元回归 43 · Multiple regression 44 · 逻辑回归 44 · Logistic regression 45 · 回归诊断 45 · Regression diagnostics
其他公式总表 Other formula sheets
FH01 流程能力 FH01 Capability FH02 假设检验 FH02 Hypothesis Testing FH03 方差分析 FH03 ANOVA FH04 回归 FH04 Regression FH05 DOE FH06 SPC FH07 MSA

回归分析公式总表