# 计量经济学

**计量经济学**是通常用普通最小二乘法（OLS）估计线性回归模型的领域，OLS是其核心工具<sup>[1](https://www.zeileis.org/teaching/AER/Ch-LinearRegression.pdf)</sup>。线性模型 \( y_i = x_i'\beta + \varepsilon_i \) 将结果变量与一组回归元及一个误差项联系起来，其估计理论建立在两个横截面假设之上：外生性，\( E(\varepsilon \mid X) = 0 \)，以及条件同方差且无相关性，\( \mathrm{Var}(\varepsilon \mid X) = \sigma^2 I \)<sup>[1](https://www.zeileis.org/teaching/AER/Ch-LinearRegression.pdf)</sup>。大样本性质来自标准工具：OLS的一致性来自将大数定律应用于样本矩，渐近正态性来自将中心极限定理应用于 \( x_i u_i \) 的平均值，而最小二乘估计量是一个矩估计量，其矩条件即正交条件 \( E[xu] = 0 \)<sup>[2](https://cameron.econ.ucdavis.edu/e240a/asymptotic.pdf)</sup>。

| 关键事实 | 详情 |
|---|---|
| OLS估计量 | \( \mathbf{b} = (\mathbf{X}'\mathbf{X})^{-1}\mathbf{X}'\mathbf{Y} \)；在经典假设下 \( E(\mathbf{b} \mid \mathbf{X}) = \beta \) 且 \( \mathrm{Var}(\mathbf{b} \mid \mathbf{X}) = \sigma^2 (\mathbf{X}'\mathbf{X})^{-1} \)<sup>[3](https://bookdown.org/joachimfreyberger/lecture_notes_es/_book/ordinary-least-squares-the-classical-linear-regression-model.html)</sup> |
| 关键假设 | 条件均值为零（外生性，SLR.4）；若成立则OLS无偏，若不成立则OLS可能有偏<sup>[4](https://dev.economicsnetwork.bristol.ac.uk/sites/default/files/Ashley/Woodridge%205ed%20unbiaseness.pdf)</sup> |
| 最佳无偏 | Hansen（2022）在不附加额外条件的情况下取消了对线性估计量的限制，因此OLS和GLS可被称为最佳无偏估计量（BUE），而不仅仅是BLUE<sup>[5](https://users.ssc.wisc.edu/~behansen/papers/ecnmt_2022.pdf)</sup> |
| 遗漏变量偏误 | \( E[b \mid X, z] = \beta + p_{X.z}\,\gamma \)，其中 \( p_{X.z} = (X'X)^{-1}X'z \)<sup>[6](https://pages.stern.nyu.edu/~wgreene/Text/Edition8/PDF/M04_GREE1366_08_SE_C04.pdf)</sup> |
| 稳健标准误实践 | 在4,420个复现包中的40,571个异方差稳健回归里，98.1%使用Stata默认的HC1<sup>[7](https://www.econstor.eu/bitstream/10419/325363/1/vfs-2025-pid-126935.pdf)</sup> |
| 典型拟合优度 | 在横截面应用研究中，R方值在0.10到0.30之间是常见且可接受的<sup>[8](https://methodatlas.vercel.app/methods/ols-regression)</sup> |
| 发表偏误 | 超过21,000项已发表检验显示出双峰“骆驼”分布，在 \( z = 1.65 \) 之前缺少检验、之后则过剩；IV受影响最大，DID次之<sup>[9](https://www.aeaweb.org/content/file?id=12747)</sup> |

## 线性回归模型与OLS

OLS通过最小化误差平方和准则来选择系数，拟合直线是最佳拟合，其含义是 \( x \) 的任何其他线性函数都会产生更大的误差平方和<sup>[10](https://homepage.ntu.edu.tw/~ckuan/pdf/et01/et_Ch3.pdf)</sup>。最小化残差平方是合理的，因为它给出了一个具有已知代数和统计性质的估计量：闭式解 \( \mathbf{b} = (\mathbf{X}'\mathbf{X})^{-1}\mathbf{X}'\mathbf{Y} \)、无偏性，以及经典假设下的方差公式 \( \sigma^2 (\mathbf{X}'\mathbf{X})^{-1} \)<sup>[3](https://bookdown.org/joachimfreyberger/lecture_notes_es/_book/ordinary-least-squares-the-classical-linear-regression-model.html)</sup>。

**解释取决于函数形式。** 双对数设定中结果变量和回归元都取对数，给出弹性：系数0.10意味着 \( X \) 增加1%与 \( Y \) 增加0.10%相关联<sup>[11](https://www.luischanci.com/documents/Econometrics/OLS.pdf)</sup><sup> • </sup><sup>[8](https://methodatlas.vercel.app/methods/ols-regression)</sup>。对数-水平设定中只有结果变量取对数，给出半弹性：系数0.10意味着 \( X \) 增加一个单位与 \( Y \) 增加约10%相关联<sup>[8](https://methodatlas.vercel.app/methods/ols-regression)</sup>。

## 假设与性质

高斯-马尔可夫定理指出，在给定回归元矩阵 \( X \) 的线性回归模型中，最小二乘估计量是 \( \beta \) 的最小方差线性无偏估计量，而 \( w'b \) 是 \( w'\beta \) 的最小方差线性无偏估计量<sup>[6](https://pages.stern.nyu.edu/~wgreene/Text/Edition8/PDF/M04_GREE1366_08_SE_C04.pdf)</sup>。形式上，在高斯-马尔可夫假设1至4下，对于任何其他线性无偏估计量 \( \tilde{\beta} = Cy \)，差值 \( \mathrm{Var}(\tilde{\beta} \mid X) - \mathrm{Var}(\hat{\beta} \mid X) = \sigma^2 DD' \) 是半正定的<sup>[11](https://www.luischanci.com/documents/Econometrics/OLS.pdf)</sup>。

“线性”这一限定词已被移除。[Bruce E. Hansen](https://www.edgepedia.org/zh/bruce-e-hansen)在2022年《Econometrica》的一篇论文中证明，经典高斯-马尔可夫定理可以在不附加任何额外条件的情况下重新表述，省略对线性估计量的限制，利用无偏估计量方差的下界；OLS和GLS可以正当地被称为BUE，即最佳无偏估计量，而非BLUE<sup>[5](https://users.ssc.wisc.edu/~behansen/papers/ecnmt_2022.pdf)</sup>。最优性仍有局限：如果比较类允许[岭回归](https://www.edgepedia.org/zh/ridge-regression)等有偏估计量或非线性程序，OLS未必最优<sup>[11](https://www.luischanci.com/documents/Econometrics/OLS.pdf)</sup>。

**哪个假设最常失效？** 外生性，即条件均值为零 \( E(u \mid x) = 0 \)，是无偏性的关键条件：若成立则OLS估计量无偏，若不成立则可能有偏<sup>[4](https://dev.economicsnetwork.bristol.ac.uk/sites/default/files/Ashley/Woodridge%205ed%20unbiaseness.pdf)</sup>。它也是应用论文花最多时间辩护的假设；工具变量策略、随机对照试验、断点回归以及双重差分都是旨在解决这一问题的设计，当普通观测数据使其不可信时便采用这些设计<sup>[12](https://econometricstutor.com/econometrics/simple-linear-regression-ols/ols-setup-and-assumptions/classical-ols-assumptions-gauss-markov/)</sup>。相比之下，同方差性是一个效率条件：在同方差误差下，常数权重函数在零偏误约束下最小化方差，这正是OLS在该定理下成为有效选择的原因<sup>[13](https://tbarmstr.github.io/files/2025/07/misspecification_review_eswc_2025.pdf)</sup>。

## 偏误：遗漏变量与内生性

从 \( y = X\beta + z\gamma + \varepsilon \) 中遗漏一个相关变量 \( z \) 会使OLS估计量通常有偏，使高斯-马尔可夫定理失效，并使通常的检验和置信区间无效<sup>[6](https://pages.stern.nyu.edu/~wgreene/Text/Edition8/PDF/M04_GREE1366_08_SE_C04.pdf)</sup><sup> • </sup><sup>[14](https://jeanmariedufour.research.mcgill.ca/ResE/ECON257_2024W/Dufour_1979_SpecificationErrorsLinearRegression_W.pdf)</sup>。其机制由遗漏变量公式 \( E[b \mid X, z] = \beta + p_{X.z}\,\gamma \) 刻画，其中 \( p_{X.z} = (X'X)^{-1}X'z \) 是将遗漏变量对已包含变量回归所得的斜率向量<sup>[6](https://pages.stern.nyu.edu/~wgreene/Text/Edition8/PDF/M04_GREE1366_08_SE_C04.pdf)</sup>。用概率极限记号，\( \mathrm{plim}(\hat{\beta}_{\text{short}}) = \beta_{\text{long}} + \beta_{\text{omitted}} \times \delta \)，其中 \( \delta \) 是将遗漏变量对已包含变量回归所得的系数<sup>[8](https://methodatlas.vercel.app/methods/ols-regression)</sup>。因此偏误有两个成分：遗漏变量本身的重要性（\( \gamma \)）以及它与已包含回归元的相关程度（\( p_{X.z} \)）。

**稳健标准误无法修正错误的点估计。** 它们是方差侧的补丁，只修正异方差或相关误差；对于外生性失效无能为力，因为问题不是方差公式错误，而是点估计没有以真实 \( \beta \) 为中心，可能的修正包括设计侧方法，如工具变量、自然实验、代理变量或随机分配<sup>[12](https://econometricstutor.com/econometrics/simple-linear-regression-ols/ols-setup-and-assumptions/classical-ols-assumptions-gauss-markov/)</sup>。Gary King和Margaret Roberts进一步表明，那些不会在残差中引起异方差但仍然重要的遗漏变量，可以以任何稳健估计量都无法捕捉的方式使估计有偏<sup>[15](https://gking.harvard.edu/files/robust_0.pdf)</sup>。当正交性因遗漏变量、联立性或测量误差而失效时，OLS通常不一致，而IV或GMM方法使用更广泛的矩限制来恢复识别<sup>[11](https://www.luischanci.com/documents/Econometrics/OLS.pdf)</sup>。

## 推断：标准误与检验

在实践中误差很少是独立同分布的，因此尽管当 \( \mathrm{Var}[u \mid X] = \sigma^2 I \) 时OLS是有效的，实践者通常获得稳健方差估计：异方差稳健、聚类稳健或HAC<sup>[16](https://cameron.econ.ucdavis.edu/bgpe2013/bgpev2_olsgls.pdf)</sup>。当 \( \Omega \neq I_n \) 时报告同方差公式会污染随后的每一个标准误、t统计量和置信区间<sup>[17](https://www.luischanci.com/documents/Econometrics/EXT.pdf)</sup>。稳健方法让研究者保持最小二乘估计，同时适应同方差和无自相关假设的违反，而无需重新设计估计策略，且现实世界数据很可能以无法精确量化的方式存在异方差<sup>[6](https://pages.stern.nyu.edu/~wgreene/Text/Edition8/PDF/M04_GREE1366_08_SE_C04.pdf)</sup>。

**稳健标准误能修正什么、不能修正什么。** 在异方差下，OLS系数估计量可以保持无偏，而经典标准误不一致，但同一模型的其他关注量，如 \( \Pr(Y > 0.5 \mid X = x) \)，可能严重有偏<sup>[15](https://gking.harvard.edu/files/robust_0.pdf)</sup>。稳健标准误估计与经典标准误估计不同的模型，直接证实了超出该程序修正范围的模型设定错误，这意味着从中得出的一些估计将有偏；King和Roberts提出了一种广义信息矩阵（GIM）检验，基于稳健方差估计与经典方差估计之间的差异，来正式评估模型设定错误<sup>[15](https://gking.harvard.edu/files/robust_0.pdf)</sup>。

**聚类。** 当误差在聚类内相关时，OLS推断应基于聚类稳健标准误；实际复杂性包括聚类特定固定效应、少量聚类、多维聚类以及OLS以外的估计量<sup>[18](https://cameron.econ.ucdavis.edu/research/Cameron_Miller_JHR_2015.pdf)</sup>。Stata的regress实现了用于异方差的vce(robust)、用于组内相关的vce(cluster)以及hc2/hc3偏误修正，其中hc2使用 \( 1/(1-h) \) 作为观测的方差估计，\( h \) 为帽子矩阵对角线元素；vce(robust)按 \( N/(N-K) \) 缩放以改善小样本性质<sup>[19](https://www.stata.com/manuals/rregress.pdf)</sup>。

默认修正在小样本中过度拒绝。一项2025年的大规模研究发现，基于HC1或HC2且使用默认自由度的t检验表现出严重的过度拒绝，而使用定制自由度的方法，包括Bell-McCaffrey（2002）、Hansen（2024）以及部分杠杆修正，表现最佳<sup>[7](https://www.econstor.eu/bitstream/10419/325363/1/vfs-2025-pid-126935.pdf)</sup>。

## 与其他方法的比较

**最大似然。** 在正态性下，对 \( \beta \) 最大化高斯似然等价于最小化残差平方和，因此 \( \beta \) 的MLE与OLS估计量完全一致；在非正态误差下，OLS是高斯准MLE<sup>[11](https://www.luischanci.com/documents/Econometrics/OLS.pdf)</sup>。

**GLS与FGLS。** GLS回答 \( \Omega \) 已知时的效率问题，[FGLS](https://www.edgepedia.org/zh/feasible-generalized-least-squares)回答 \( \Omega \) 必须估计时的效率问题，而稳健标准误回答无需对 \( \Omega \) 设定模型的有效推断问题<sup>[17](https://www.luischanci.com/documents/Econometrics/EXT.pdf)</sup>。可行GLS假定 \( \mathrm{Var}[u \mid X] \) 的模型，可以产生更精确的估计、更小的标准误和更大的t统计量，但应辅以允许模型设定错误的稳健方差估计<sup>[16](https://cameron.econ.ucdavis.edu/bgpe2013/bgpev2_olsgls.pdf)</sup>。

**设定错误下的加权最小二乘。** 一旦允许设定错误，WLS并不比OLS更有效：两个估计量收敛到不同的极限，只是估计不同的东西<sup>[20](https://arxiv.org/pdf/2508.13076)</sup>。

## 数据一览

- **典型拟合优度。** 在横截面回归中，R方值在0.10到0.30之间是常见的，在应用研究中完全可以接受<sup>[8](https://methodatlas.vercel.app/methods/ols-regression)</sup>。原始 \( R^2 \) 随任何新增回归元弱递增，因此不能用作模型选择标准；调整 \( R^2 = 1 - (1 - R^2)\frac{N-1}{N-k} \) 通过损失自由度对新增回归元进行惩罚，因此添加一个对拟合贡献很小的变量可能使其下降<sup>[3](https://bookdown.org/joachimfreyberger/lecture_notes_es/_book/ordinary-least-squares-the-classical-linear-regression-model.html)</sup><sup> • </sup><sup>[11](https://www.luischanci.com/documents/Econometrics/OLS.pdf)</sup>。
- **软件主导地位。** Stata出现在经济学期刊80%或更多的复现包中，没有使用下降的证据<sup>[21](https://ar5iv.labs.arxiv.org/html/2504.06507)</sup>。
- **默认稳健标准误。** 在来自主要经济学期刊4,420个复现包的40,571个指定异方差稳健标准误的回归中，98.1%遵循Stata默认的HC1设定<sup>[7](https://www.econstor.eu/bitstream/10419/325363/1/vfs-2025-pid-126935.pdf)</sup>。
- **发表偏误规模。** 骆驼形发现涵盖25种主要经济学期刊中超过21,000项假设检验<sup>[9](https://www.aeaweb.org/content/file?id=12747)</sup>。
- **再分析中的缩水。** 原始发表的t统计量平均为1.797，而再分析的t统计量平均为1.544<sup>[22](https://emiguel.econ.berkeley.edu/wordpress/wp-content/uploads/2026/07/s41586-026-10251-x.pdf)</sup>。

## 近期发展

**机器学习与回归的交汇。** 双重/去偏机器学习（DML）为缓解正则化偏误和过拟合偏误提供了蓝图，使用Neyman正交得分缓解正则化偏误，使用交叉拟合缓解过拟合偏误，使得在存在可能很复杂的干扰参数的情况下对低维目标参数进行估计和推断成为可能<sup>[23](https://arxiv.org/pdf/2504.08324)</sup>。另外，研究者越来越多地使用AI和机器学习生成回归分析中使用的变量；忽略这些变量中的测量误差会产生有偏估计量和无效推断，而不需要大量验证数据的偏误修正方法已在Python包ValidMLInference中实现<sup>[24](https://www.aeaweb.org/articles?id=10.1257%2Fpandp.20261020)</sup>。

**复现规范已变得更严格。** 2010年不到10%的复现包包含两种统计软件类型；到2024年，哈佛Dataverse和AEA/ICPSR数据集中均有超过40%包含至少两种，2023年和2024年MATLAB和R均出现在超过20%的包中，而Python在2016年前几乎缺席，现在出现在超过10%的包中<sup>[21](https://ar5iv.labs.arxiv.org/html/2504.06507)</sup>。一项对经济学和政治学研究的大规模再分析发现，可复现性成功率相差10.4个百分点（McNemar的 \( \chi^2 = 264.11 \)，\( P < 0.001 \)，\( n = 4{,}750 \)）<sup>[22](https://emiguel.econ.berkeley.edu/wordpress/wp-content/uploads/2026/07/s41586-026-10251-x.pdf)</sup>。在方法前沿，新程序现在附带大样本保证和用于可信评估的模拟模板；一个例子是PLRD，其置信区间既有效又短<sup>[25](https://www.nber.org/system/files/working_papers/w35699/w35699.pdf)</sup>。

## 使用者与应用工作流程

一项对27种顶级经济学期刊的调查发现，对于微观数据，前五种实证方法是2SLS、GMM、面板模型、Logit/[Probit](https://www.edgepedia.org/zh/probit)和MLE，而对于宏观数据则是面板模型、VAR、贝叶斯方法、2SLS和AR模型<sup>[26](https://personal.ntu.edu.sg/qfeng/Top%2027_20260313_FengWangZhou.pdf)</sup>。典型的应用工作流程以OLS配合稳健或聚类标准误为中心：应用指南建议在估计模型前检查假设，包括同方差性和正态性，使用Stata的regress命令通常配合稳健或聚类标准误，或使用R的lm函数<sup>[27](https://www.hbs.edu/ris/Publication%20Files/25-010_1b83b5ca-9263-47a9-81af-a02855e49842.pdf)</sup>。

## References

1. [Applied Econometrics with R, Linear Regression chapter (Zeileis)](https://www.zeileis.org/teaching/AER/Ch-LinearRegression.pdf)
2. [Colin Cameron: Asymptotic Theory for OLS](https://cameron.econ.ucdavis.edu/e240a/asymptotic.pdf)
3. [Ordinary Least Squares: The Classical Linear Regression Model (Freyberger)](https://bookdown.org/joachimfreyberger/lecture_notes_es/_book/ordinary-least-squares-the-classical-linear-regression-model.html)
4. [Wooldridge, Introductory Econometrics (5th ed.), unbiasedness excerpt](https://dev.economicsnetwork.bristol.ac.uk/sites/default/files/Ashley/Woodridge%205ed%20unbiaseness.pdf)
5. [Bruce E. Hansen (2022). A Modern Gauss-Markov Theorem. Econometrica.](https://users.ssc.wisc.edu/~behansen/papers/ecnmt_2022.pdf)
6. [Greene, Econometric Analysis (8th ed.), Chapter 4](https://pages.stern.nyu.edu/~wgreene/Text/Edition8/PDF/M04_GREE1366_08_SE_C04.pdf)
7. [From Replications to Revelations: Heteroskedasticity-Robust Inference (2025)](https://www.econstor.eu/bitstream/10419/325363/1/vfs-2025-pid-126935.pdf)
8. [OLS (Robust SEs, Clustering), Method Atlas](https://methodatlas.vercel.app/methods/ols-regression)
9. [Methods Matter: P-Hacking and Publication Bias in Causal Analysis in Economics (AER)](https://www.aeaweb.org/content/file?id=12747)
10. [Classical Least Squares Theory, NTU lecture notes, Chapter 3](https://homepage.ntu.edu.tw/~ckuan/pdf/et01/et_Ch3.pdf)
11. [Econometrics lecture notes: OLS (Chanci)](https://www.luischanci.com/documents/Econometrics/OLS.pdf)
12. [The Classical OLS Assumptions: SLR.1 to SLR.5, Econometrics Tutor](https://econometricstutor.com/econometrics/simple-linear-regression-ols/ols-setup-and-assumptions/classical-ols-assumptions-gauss-markov/)
13. [Misspecification in Econometrics: A Selective Review (Armstrong, 2025)](https://tbarmstr.github.io/files/2025/07/misspecification_review_eswc_2025.pdf)
14. [Specification Errors in Linear Regression Models (Dufour, 1979)](https://jeanmariedufour.research.mcgill.ca/ResE/ECON257_2024W/Dufour_1979_SpecificationErrorsLinearRegression_W.pdf)
15. [Gary King and Margaret Roberts. How Robust Standard Errors Expose Missing Problems, Failing Problems, and What to Do About It](https://gking.harvard.edu/files/robust_0.pdf)
16. [Ordinary Least Squares and GLS (Cameron, UC Davis)](https://cameron.econ.ucdavis.edu/bgpe2013/bgpev2_olsgls.pdf)
17. [Extensions of the Linear Model, lecture notes (Chanci)](https://www.luischanci.com/documents/Econometrics/EXT.pdf)
18. [A Practitioner's Guide to Cluster-Robust Inference (Cameron & Miller, JHR 2015)](https://cameron.econ.ucdavis.edu/research/Cameron_Miller_JHR_2015.pdf)
19. [Stata Manual: regress](https://www.stata.com/manuals/rregress.pdf)
20. [The purpose of an estimator is what it does: Misspecification, estimands, and over-identification](https://arxiv.org/pdf/2508.13076)
21. [The Software Behind the Stats: Software Trends Across Disciplines](https://ar5iv.labs.arxiv.org/html/2504.06507)
22. [Reproducibility and robustness of economics and political science research (Nature)](https://emiguel.econ.berkeley.edu/wordpress/wp-content/uploads/2026/07/s41586-026-10251-x.pdf)
23. [Double Machine Learning: survey of the framework](https://arxiv.org/pdf/2504.08324)
24. [Performing Valid Inference with AI/ML-Generated Covariates (AEA Papers & Proceedings)](https://www.aeaweb.org/articles?id=10.1257%2Fpandp.20261020)
25. [NBER Working Paper 35699 (PLRD)](https://www.nber.org/system/files/working_papers/w35699/w35699.pdf)
26. [Data Types and Empirical Methods in 27 Top Economics Journals](https://personal.ntu.edu.sg/qfeng/Top%2027_20260313_FengWangZhou.pdf)
27. [Empirical Guidance: Data Processing and Analysis with Applications in Stata, R, and Python (HBS Working Paper 25-010)](https://www.hbs.edu/ris/Publication%20Files/25-010_1b83b5ca-9263-47a9-81af-a02855e49842.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 10, 2026 · Edited: Sep 30, 2026; Oct 10, 2026; Oct 11, 2026; Oct 15, 2026 · Last review: Oct 10, 2026*

Topic: 社会与历史 › 经济与商业 › 经济学 › Economic theory and methods › Econometrics and quantitative methods › Linear regression and OLS in econometrics

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/econometrics

English original: https://www.edgepedia.org/econometrics
