OLS Explorer — 最小二乘是怎么把直线"算"出来的 / How least squares finds the line

项目 / Item 你的直线 / Your line OLS 最优 / OLS best
截距 b0 / Intercept b0
斜率 b1 / Slope b1
残差之和 Σeᵢ / Sum of residuals Σeᵢ
绝对残差和 Σ|eᵢ| / Sum of absolute residuals Σ|eᵢ|
残差平方和 SSE = Σeᵢ² / Sum of squared residuals SSE
比最优多 / Excess over the minimum 最小 / minimum
总平方和 SST = Σ(yᵢ−ȳ)² / Total sum of squares SST
判定系数 R² = 1 − SSE/SST / R-squared
相关系数 r(彩蛋:R² = r²) / Correlation r (bonus: R² = r²)
标准误 SE(b1) / Std. err. SE(b1) b0:
t 值 t = b1 / SE(b1) / t-statistic b0:
p 值 P>|t| / p-value b0:
95% 置信区间 / 95% confidence interval b0:
F 统计量 F(1, n−2)(一元回归里 F = t²) / F-statistic (F = t² here)
Prob > F / Prob > F
调整 R² / Adjusted R²
残差标准差 s(Root MSE) / Root MSE s
样本量 n / Number of obs n
自由度 df = n − 2 / Degrees of freedom df

公式 / Formulas 悬停符号 → 图上高亮 / hover → highlight

  1. ŷᵢ = b0 + b1·xᵢ
  2. eᵢ = yᵢŷᵢ
  3. SSE = Σeᵢ²
  4. SST = Σ(yᵢ − ȳ)²
  5. R² = 1 − SSE/SST
  6. b1 = Σ(xᵢ−)(yᵢ−ȳ) / Σ(xᵢ−x̄)²
  7. b0 = ȳb1·
  8. SE(b1) = √( [SSE/(n−2)] / Σ(xᵢ−x̄)² )
  9. t = b1 / SE(b1),  df = n − 2
  10. H₀: β₁ = 0

残差分布 / Residual distribution

SSE 碗形曲线 / The SSE bowl 横轴 b1,纵轴 Σeᵢ² / b1 across, Σeᵢ² up

残差均值 / Mean of residuals
残差标准差 / SD of residuals
偏度 / Skewness
超额峰度 / Excess kurtosis
Jarque–Bera 统计量 / Jarque–Bera statistic
JB p 值 / JB p-value
解读 / Verdict

粘贴 CSV / Paste CSV

每行两个数:x, y(逗号、制表符或空格分隔;第一行可以是表头)。 / Two numbers per line: x, y (comma, tab or space separated; the first line may be a header).