Statistical properties of OLSOLS 估計量的統計性質

A regression run on one sample gives one set of estimates. Another sample from the same population would give different ones. This week asks how OLS behaves across all the samples we could have drawn: is it right on average, how far does it stray, is any other method more precise, and what shape does its distribution take? The answers are the reason the standard errors and t tests of Week 4 work.

用一個樣本做回歸,會得到一組估計值。從同一總體抽出另一個樣本,結果又會不同。本週探討 OLS 在所有可能抽到的樣本中表現如何:平均來說是否準確?會偏離多遠?有沒有更精確的方法?它的分佈是甚麼形狀?這些答案正是第 4 週的標準誤和 t 檢定能夠成立的原因。

Builds on 先修內容
Week 3, Week 4
Reading time 閱讀時間
About 50 minutes
Data 數據
wage2
Code 程式碼
R, Python

The estimator is a random vector估計量是一個隨機向量

With nn observations and kk regressors, Week 3 wrote the model and the OLS estimator as

設有 nn 個觀測值和 kk 個解釋變數,第 3 週把模型和 OLS 估計量寫成

yn×1=Xn×(k+1)  β(k+1)×1+un×1,\underset{n \times 1}{\mathbf{y}} = \underset{n \times (k+1)}{\mathbf{X}}\;\underset{(k+1) \times 1}{\boldsymbol{\beta}} + \underset{n \times 1}{\mathbf{u}},
β^=(X′X)−1X′y.\bhv = (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{y}.

The errors u\mathbf{u} are random, so y\mathbf{y} is random, and so is β^\bhv: it is a vector of k+1k + 1 random variables, one estimate per coefficient. Its value in our data is one draw. The properties of an estimator describe the whole distribution of draws, not the single number we computed.

誤差 u\mathbf{u} 是隨機的,所以 y\mathbf{y} 是隨機的,β^\bhv 也是:它是由 k+1k + 1 個隨機變數組成的向量,每個係數一個估計值。我們數據中的數值只是其中一次抽樣。估計量的性質描述的是所有抽樣結果的分佈,而不是我們算出的那一個數字。

Throughout, we reason conditional on X\mathbf{X}: we treat the regressors as fixed and ask what happens when only the errors are redrawn. Results that hold for every X\mathbf{X} then hold on average over X\mathbf{X} as well.

本週一直都是在給定 X\mathbf{X} 的條件下推理:把解釋變數視為固定,只考慮重新抽取誤差時會發生甚麼。對每一個 X\mathbf{X} 都成立的結果,對 X\mathbf{X} 取平均後也同樣成立。

Unbiasedness無偏性

An estimator θ^\hat\theta of an unknown parameter θ\theta is unbiased if its expected value is the parameter:

如果估計量 θ^\hat\theta 的期望值等於未知參數 θ\theta,它就是 θ\theta 的無偏估計量:

E⁡(θ^)=θ.\operatorname{E}(\hat\theta) = \theta.

Unbiased does not mean correct in our sample. It means that across many samples the errors cancel: the estimator does not systematically overshoot or undershoot. The simplest example is the sample mean. If E⁡(yi)=μ\operatorname{E}(y_i) = \mu for every ii, then yˉ=1n∑iyi\bar y = \tfrac{1}{n}\sum_{i} y_i is unbiased for μ\mu.

無偏並不代表在我們的樣本中答案正確,而是指在許多樣本中誤差互相抵銷:估計量不會系統性地高估或低估。最簡單的例子是樣本均值。如果對每個 ii 都有 E⁡(yi)=μ\operatorname{E}(y_i) = \mu,那麼 yˉ=1n∑iyi\bar y = \tfrac{1}{n}\sum_{i} y_i 就是 μ\mu 的無偏估計量。

Show every step: the sample mean 顯示完整推導:樣本均值

Expectation is linear, so it passes through the sum and the constant 1/n:

期望是線性的,所以可以穿過求和符號和常數 1/n:

E⁡(yˉ)=E⁡ ⁣(1n∑i=1nyi)=1n∑i=1nE⁡(yi)=1n nμ=μ.\begin{aligned} \operatorname{E}(\bar y) &= \operatorname{E}\!\left(\frac{1}{n}\sum_{i=1}^{n} y_i\right) \\ &= \frac{1}{n}\sum_{i=1}^{n} \operatorname{E}(y_i) = \frac{1}{n}\, n\mu = \mu. \end{aligned}

Nothing about independence or variance was used. Unbiasedness only needs the means to be right.

推導中沒有用到獨立性或方差。無偏性只要求均值正確。

OLS is unbiased under three assumptions:

在以下三個假設下,OLS 是無偏的:

  1. A1

    Linear in parameters. y=Xβ+u\mathbf{y} = \mathbf{X}\boldsymbol{\beta} + \mathbf{u}.

    參數線性。y=Xβ+u\mathbf{y} = \mathbf{X}\boldsymbol{\beta} + \mathbf{u}。

  2. A2

    No perfect collinearity. The columns of X\mathbf{X} are linearly independent, so X′X\mathbf{X}\T\mathbf{X} can be inverted.

    沒有完全共線性。X\mathbf{X} 的各列線性獨立,所以 X′X\mathbf{X}\T\mathbf{X} 可逆。

  3. A3

    Zero conditional mean. E⁡(u∣X)=0\operatorname{E}(\mathbf{u} \mid \mathbf{X}) = \mathbf{0}.

    零條件均值。E⁡(u∣X)=0\operatorname{E}(\mathbf{u} \mid \mathbf{X}) = \mathbf{0}。

E⁡(β^)=β.\operatorname{E}(\bhv) = \boldsymbol{\beta}.

The proof has two moves. First substitute the model into the formula, which splits β^\bhv into the truth plus a weighted sum of the errors:

證明分兩步。第一步,把模型代入公式,把 β^\bhv 分拆成真值加上誤差的加權和:

β^=β+(X′X)−1X′u.\bhv = \boldsymbol{\beta} + (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{u}.

Then take expectations. Given X\mathbf{X}, the weights (X′X)−1X′(\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T are fixed numbers and the errors average to zero by A3, so the second term vanishes.

第二步,取期望。給定 X\mathbf{X},權重 (X′X)−1X′(\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T 是固定的數字,而根據 A3 誤差的平均為零,所以第二項消失。

Show every step 顯示完整推導

Step 1: substitute. A2 guarantees the inverse exists. Use A1 to replace y\mathbf{y}:

第一步:代入。A2 保證逆矩陣存在。用 A1 替換 y\mathbf{y}:

β^=(X′X)−1X′y=(X′X)−1X′(Xβ+u)=(X′X)−1X′X β+(X′X)−1X′u=Ik+1 β+(X′X)−1X′u=β+(X′X)−1X′u.\begin{aligned} \bhv &= (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{y} \\ &= (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T(\mathbf{X}\boldsymbol{\beta} + \mathbf{u}) \\ &= (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{X}\,\boldsymbol{\beta} + (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{u} \\ &= \mathbf{I}_{k+1}\,\boldsymbol{\beta} + (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{u} \\ &= \boldsymbol{\beta} + (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{u}. \end{aligned}

Step 2: expectation given X. β\boldsymbol{\beta} is a constant, and (X′X)−1X′(\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T is a function of X\mathbf{X} only, so it comes outside the conditional expectation:

第二步:給定 X 的期望。β\boldsymbol{\beta} 是常數,而 (X′X)−1X′(\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T 只是 X\mathbf{X} 的函數,所以可以拿到條件期望之外:

E⁡(β^∣X)=β+(X′X)−1X′E⁡(u∣X)=β+(X′X)−1X′ 0=β.\begin{aligned} \operatorname{E}(\bhv \mid \mathbf{X}) &= \boldsymbol{\beta} + (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T \operatorname{E}(\mathbf{u} \mid \mathbf{X}) \\ &= \boldsymbol{\beta} + (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\,\mathbf{0} \\ &= \boldsymbol{\beta}. \end{aligned}

Step 3: average over X. The law of iterated expectations says E⁡(Y)=E⁡X[E⁡(Y∣X)]\operatorname{E}(Y) = \operatorname{E}_X[\operatorname{E}(Y \mid X)]. The inner expectation is β\boldsymbol{\beta} for every X\mathbf{X}, so its average is β\boldsymbol{\beta} too:

第三步:對 X 取平均。迭代期望定律指出 E⁡(Y)=E⁡X[E⁡(Y∣X)]\operatorname{E}(Y) = \operatorname{E}_X[\operatorname{E}(Y \mid X)]。內層期望對每個 X\mathbf{X} 都等於 β\boldsymbol{\beta},所以它的平均也是 β\boldsymbol{\beta}:

E⁡(β^)=E⁡X ⁣[E⁡(β^∣X)]=E⁡X[β]=β.\operatorname{E}(\bhv) = \operatorname{E}_X\!\left[\operatorname{E}(\bhv \mid \mathbf{X})\right] = \operatorname{E}_X[\boldsymbol{\beta}] = \boldsymbol{\beta}.

What zero conditional mean rules out零條件均值排除了甚麼

A1 and A2 are easy to check. A3 carries the weight. In the simple model yi=β0+β1xi+uiy_i = \beta_0 + \beta_1 x_i + u_i it says E⁡(ui∣x1,…,xn)=0\operatorname{E}(u_i \mid x_1, \dots, x_n) = 0 for every ii: whatever the values of the regressor, the error averages zero. That rules out three things.

A1 和 A2 很容易檢查,關鍵在於 A3。在簡單模型 yi=β0+β1xi+uiy_i = \beta_0 + \beta_1 x_i + u_i 中,它表示對每個 ii 都有 E⁡(ui∣x1,…,xn)=0\operatorname{E}(u_i \mid x_1, \dots, x_n) = 0:無論解釋變數取甚麼值,誤差的平均都是零。這排除了三種情況。

  • A wrong functional form. If the true relation curves and we fit a straight line, the error picks up the curvature and its mean changes with x.

    錯誤的函數形式。如果真實關係是彎曲的而我們擬合直線,誤差便會包含彎曲的部分,其均值會隨 x 改變。

  • An omitted variable that is correlated with a regressor. The omitted variable sits in the error, and the error then moves with the regressor.

    遺漏了與解釋變數相關的變數。被遺漏的變數會留在誤差之中,誤差便會隨解釋變數變動。

  • In time series, feedback between periods. The error in any period must be unrelated to the regressor in every period: past, present and future.

    在時間序列中,不同時期之間的反饋。任何一期的誤差都必須與所有時期的解釋變數無關:過去、現在和將來。

Example. Suppose the regression with IQ is the true model, and we drop IQ. Men with more schooling tend to have higher IQ scores (the correlation is 0.52), so IQ, now part of the error, rises with educ. The short regression is

例子。假設包含智商的回歸是真實模型,而我們剔除了智商。受教育較多的人智商分數往往較高(相關係數為 0.52),所以變成誤差一部分的智商會隨 educ 上升。短回歸為

wage^=146.95+60.21 educ,\widehat{\text{wage}} = 146.95 + 60.21\,\text{educ},

so the education coefficient jumps from 42.06 to 60.21. The gap is exact: regress IQ on education to get δ~1=3.534\tilde\delta_1 = 3.534 IQ points per year, and

教育的係數由 42.06 跳升至 60.21。兩者的差距可以準確計算:把智商對教育做回歸,得到每年 δ~1=3.534\tilde\delta_1 = 3.534 個智商分,於是

β~1=β^1+β^2δ~1=42.06+5.138×3.534=60.21.\begin{aligned} \tilde\beta_1 &= \hat\beta_1 + \hat\beta_2\tilde\delta_1 \\ &= 42.06 + 5.138 \times 3.534 = 60.21. \end{aligned}

Across samples, the short regression centres on β1+β2δ1\beta_1 + \beta_2\delta_1, not β1\beta_1. Part of what it credits to schooling is the effect of the IQ that comes with it. The bias disappears only if β2=0\beta_2 = 0 (IQ does not matter) or δ1=0\delta_1 = 0 (IQ is unrelated to education).

在不同樣本中,短回歸的估計以 β1+β2δ1\beta_1 + \beta_2\delta_1 為中心,而不是 β1\beta_1。它歸功於教育的部分效應,其實來自伴隨教育而來的較高智商。只有在 β2=0\beta_2 = 0(智商無影響)或 δ1=0\delta_1 = 0(智商與教育無關)時,偏誤才會消失。

Show every step: the omitted-variable bias 顯示完整推導:遺漏變數偏誤

Write the true model as yi=β0+β1xi1+β2xi2+uiy_i = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + u_i, with x1x_1 = education and x2x_2 = IQ. The short-regression slope is β~1=∑i(xi1−xˉ1)yi/SST1\tilde\beta_1 = \sum_i (x_{i1} - \bar x_1) y_i / \text{SST}_1, where SST1=∑i(xi1−xˉ1)2\text{SST}_1 = \sum_i (x_{i1} - \bar x_1)^2. Substitute the true model for yiy_i:

把真實模型寫成 yi=β0+β1xi1+β2xi2+uiy_i = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + u_i,其中 x1x_1 是教育,x2x_2 是智商。短回歸的斜率是 β~1=∑i(xi1−xˉ1)yi/SST1\tilde\beta_1 = \sum_i (x_{i1} - \bar x_1) y_i / \text{SST}_1,其中 SST1=∑i(xi1−xˉ1)2\text{SST}_1 = \sum_i (x_{i1} - \bar x_1)^2。把真實模型代入 yiy_i:

β~1=1SST1∑i(xi1−xˉ1)×(β0+β1xi1+β2xi2+ui)=β1+β2∑i(xi1−xˉ1)xi2SST1+∑i(xi1−xˉ1)uiSST1.\begin{aligned} \tilde\beta_1 &= \frac{1}{\text{SST}_1}\sum_i (x_{i1} - \bar x_1) \\ &\qquad \times (\beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + u_i) \\ &= \beta_1 + \beta_2 \frac{\sum_i (x_{i1} - \bar x_1) x_{i2}}{\text{SST}_1} \\ &\quad + \frac{\sum_i (x_{i1} - \bar x_1) u_i}{\text{SST}_1}. \end{aligned}

The β0\beta_0 term drops because ∑i(xi1−xˉ1)=0\sum_i (x_{i1} - \bar x_1) = 0, and ∑i(xi1−xˉ1)xi1=SST1\sum_i (x_{i1} - \bar x_1) x_{i1} = \text{SST}_1. The middle fraction is the slope from regressing x2x_2 on x1x_1, which is δ~1\tilde\delta_1. Given both regressors, the last term has expectation zero by A3, so

β0\beta_0 項消失,因為 ∑i(xi1−xˉ1)=0\sum_i (x_{i1} - \bar x_1) = 0;而 ∑i(xi1−xˉ1)xi1=SST1\sum_i (x_{i1} - \bar x_1) x_{i1} = \text{SST}_1。中間的分數正是把 x2x_2 對 x1x_1 回歸所得的斜率 δ~1\tilde\delta_1。給定兩個解釋變數,根據 A3,最後一項的期望為零,所以

E⁡(β~1∣X)=β1+β2δ~1.\operatorname{E}(\tilde\beta_1 \mid \mathbf{X}) = \beta_1 + \beta_2\tilde\delta_1.

The same algebra with the estimates in place of the true coefficients gives the exact sample identity β~1=β^1+β^2δ~1\tilde\beta_1 = \hat\beta_1 + \hat\beta_2\tilde\delta_1 used above.

把真實係數換成估計值,同樣的代數就得出上文所用的樣本恆等式 β~1=β^1+β^2δ~1\tilde\beta_1 = \hat\beta_1 + \hat\beta_2\tilde\delta_1。

Covariance matrices協方差矩陣

Unbiasedness says where the estimates centre. To describe how they spread, and how the spread of one coefficient relates to another, we need the covariance matrix of a random vector z=(z1,…,zn)′\mathbf{z} = (z_1, \dots, z_n)\T: variances on the diagonal, covariances off it.

無偏性說明估計值的中心在哪裏。要描述它們的離散程度,以及不同係數之間的關係,就需要隨機向量 z=(z1,…,zn)′\mathbf{z} = (z_1, \dots, z_n)\T 的協方差矩陣:對角線上是方差,其餘位置是協方差。

Var⁡(z)=E⁡ ⁣[(z−E⁡z)(z−E⁡z)′]=[σ12σ12⋯σ1nσ21σ22⋯σ2n⋮⋮⋱⋮σn1σn2⋯σn2]\begin{aligned} \operatorname{Var}(\mathbf{z}) &= \operatorname{E}\!\left[(\mathbf{z} - \operatorname{E}\mathbf{z})(\mathbf{z} - \operatorname{E}\mathbf{z})\T\right] \\ &= \begin{bmatrix} \sigma_1^2 & \sigma_{12} & \cdots & \sigma_{1n} \\ \sigma_{21} & \sigma_2^2 & \cdots & \sigma_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ \sigma_{n1} & \sigma_{n2} & \cdots & \sigma_n^2 \end{bmatrix} \end{aligned}

Here σj2=Var⁡(zj)\sigma_j^2 = \operatorname{Var}(z_j) and σij=Cov⁡(zi,zj)\sigma_{ij} = \operatorname{Cov}(z_i, z_j). Since Cov⁡(zi,zj)=Cov⁡(zj,zi)\operatorname{Cov}(z_i, z_j) = \operatorname{Cov}(z_j, z_i), the matrix is symmetric. Two special cases come up constantly:

其中 σj2=Var⁡(zj)\sigma_j^2 = \operatorname{Var}(z_j),σij=Cov⁡(zi,zj)\sigma_{ij} = \operatorname{Cov}(z_i, z_j)。由於 Cov⁡(zi,zj)=Cov⁡(zj,zi)\operatorname{Cov}(z_i, z_j) = \operatorname{Cov}(z_j, z_i),矩陣是對稱的。以下兩種特殊情況經常出現:

  • Uncorrelated. Every σij=0\sigma_{ij} = 0 for i≠ji \neq j, so the matrix is diagonal: diag⁡(σ12,…,σn2)\operatorname{diag}(\sigma_1^2, \dots, \sigma_n^2).

    互不相關。對所有 i≠ji \neq j 都有 σij=0\sigma_{ij} = 0,矩陣是對角矩陣:diag⁡(σ12,…,σn2)\operatorname{diag}(\sigma_1^2, \dots, \sigma_n^2)。

  • Uncorrelated with a common variance. Also σj2=σ2\sigma_j^2 = \sigma^2 for every jj, so the matrix is σ2In\sigma^2 \mathbf{I}_n.

    互不相關且方差相同。此外對每個 jj 都有 σj2=σ2\sigma_j^2 = \sigma^2,矩陣便是 σ2In\sigma^2 \mathbf{I}_n。

One rule does most of the work this week. If A\mathbf{A} is a matrix of constants and c\mathbf{c} a vector of constants,

本週大部分推導都靠一條規則。如果 A\mathbf{A} 是常數矩陣,c\mathbf{c} 是常數向量,

Var⁡(Az+c)=A Var⁡(z) A′.\operatorname{Var}(\mathbf{A}\mathbf{z} + \mathbf{c}) = \mathbf{A}\,\operatorname{Var}(\mathbf{z})\,\mathbf{A}\T.
Show every step 顯示完整推導

Let w=Az+c\mathbf{w} = \mathbf{A}\mathbf{z} + \mathbf{c}. Its mean is E⁡w=AE⁡z+c\operatorname{E}\mathbf{w} = \mathbf{A}\operatorname{E}\mathbf{z} + \mathbf{c}, so w−E⁡w=A(z−E⁡z)\mathbf{w} - \operatorname{E}\mathbf{w} = \mathbf{A}(\mathbf{z} - \operatorname{E}\mathbf{z}): the constant shift drops out. Using (Av)′=v′A′(\mathbf{A}\mathbf{v})\T = \mathbf{v}\T\mathbf{A}\T,

設 w=Az+c\mathbf{w} = \mathbf{A}\mathbf{z} + \mathbf{c}。它的均值是 E⁡w=AE⁡z+c\operatorname{E}\mathbf{w} = \mathbf{A}\operatorname{E}\mathbf{z} + \mathbf{c},所以 w−E⁡w=A(z−E⁡z)\mathbf{w} - \operatorname{E}\mathbf{w} = \mathbf{A}(\mathbf{z} - \operatorname{E}\mathbf{z}):常數平移消失了。利用 (Av)′=v′A′(\mathbf{A}\mathbf{v})\T = \mathbf{v}\T\mathbf{A}\T,

Write e=z−E⁡z\mathbf{e} = \mathbf{z} - \operatorname{E}\mathbf{z} for short. Then

簡寫 e=z−E⁡z\mathbf{e} = \mathbf{z} - \operatorname{E}\mathbf{z},於是

Var⁡(w)=E⁡ ⁣[Ae (Ae)′]=E⁡ ⁣[Aee′A′]=A E⁡(ee′) A′=A Var⁡(z) A′.\begin{aligned} \operatorname{Var}(\mathbf{w}) &= \operatorname{E}\!\left[\mathbf{A}\mathbf{e}\,(\mathbf{A}\mathbf{e})\T\right] \\ &= \operatorname{E}\!\left[\mathbf{A}\mathbf{e}\mathbf{e}\T\mathbf{A}\T\right] \\ &= \mathbf{A}\,\operatorname{E}(\mathbf{e}\mathbf{e}\T)\,\mathbf{A}\T \\ &= \mathbf{A}\,\operatorname{Var}(\mathbf{z})\,\mathbf{A}\T. \end{aligned}

The constants A\mathbf{A} and A′\mathbf{A}\T come outside the expectation because expectation is linear. With a single row A=a′\mathbf{A} = \mathbf{a}\T this is the familiar Var⁡(a′z)=∑i∑jaiajσij\operatorname{Var}(\mathbf{a}\T\mathbf{z}) = \sum_i\sum_j a_i a_j \sigma_{ij}.

由於期望是線性的,常數 A\mathbf{A} 和 A′\mathbf{A}\T 可以拿到期望之外。當 A=a′\mathbf{A} = \mathbf{a}\T 只有一行時,這就是熟悉的 Var⁡(a′z)=∑i∑jaiajσij\operatorname{Var}(\mathbf{a}\T\mathbf{z}) = \sum_i\sum_j a_i a_j \sigma_{ij}。

The variance of the OLS estimatorOLS 估計量的方差

Many estimators are unbiased under A1–A3. To choose among them we need their variances, and for that a fourth assumption about the errors:

在 A1–A3 下,無偏估計量有很多。要在它們之間作出選擇,就要知道各自的方差,為此需要第四個關於誤差的假設:

  1. A4

    Homoskedasticity and no serial correlation. Var⁡(u∣X)=σ2In\operatorname{Var}(\mathbf{u} \mid \mathbf{X}) = \sigma^2 \mathbf{I}_n.

    同方差且沒有序列相關。Var⁡(u∣X)=σ2In\operatorname{Var}(\mathbf{u} \mid \mathbf{X}) = \sigma^2 \mathbf{I}_n。

Written out, A4 says Var⁡(ui∣X)=σ2\operatorname{Var}(u_i \mid \mathbf{X}) = \sigma^2 for every ii (homoskedasticity: the errors are equally spread whatever the regressors) and Cov⁡(ui,uj∣X)=0\operatorname{Cov}(u_i, u_j \mid \mathbf{X}) = 0 for i≠ji \neq j (no serial correlation). Under A1–A4,

展開來說,A4 表示對每個 ii 都有 Var⁡(ui∣X)=σ2\operatorname{Var}(u_i \mid \mathbf{X}) = \sigma^2(同方差:無論解釋變數取甚麼值,誤差的離散程度都一樣),並且對 i≠ji \neq j 有 Cov⁡(ui,uj∣X)=0\operatorname{Cov}(u_i, u_j \mid \mathbf{X}) = 0(沒有序列相關)。在 A1–A4 下,

Var⁡(β^∣X)=σ2(X′X)−1.\operatorname{Var}(\bhv \mid \mathbf{X}) = \sigma^2 (\mathbf{X}\T\mathbf{X})^{-1}.
Show every step 顯示完整推導

From Section 2, β^=β+Au\bhv = \boldsymbol{\beta} + \mathbf{A}\mathbf{u} with A=(X′X)−1X′\mathbf{A} = (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T, a matrix of constants once we condition on X\mathbf{X}. The constant β\boldsymbol{\beta} does not affect the variance. Apply the rule from Section 4 with Var⁡(u∣X)=σ2In\operatorname{Var}(\mathbf{u} \mid \mathbf{X}) = \sigma^2\mathbf{I}_n:

由第 2 節,β^=β+Au\bhv = \boldsymbol{\beta} + \mathbf{A}\mathbf{u},其中 A=(X′X)−1X′\mathbf{A} = (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T;給定 X\mathbf{X} 後它是常數矩陣。常數 β\boldsymbol{\beta} 不影響方差。用第 4 節的規則,並代入 Var⁡(u∣X)=σ2In\operatorname{Var}(\mathbf{u} \mid \mathbf{X}) = \sigma^2\mathbf{I}_n:

Var⁡(β^∣X)=A (σ2In) A′=σ2 (X′X)−1X′×X(X′X)−1=σ2 (X′X)−1.\begin{aligned} \operatorname{Var}(\bhv \mid \mathbf{X}) &= \mathbf{A}\,(\sigma^2 \mathbf{I}_n)\,\mathbf{A}\T \\ &= \sigma^2\, (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T \\ &\qquad \times \mathbf{X}(\mathbf{X}\T\mathbf{X})^{-1} \\ &= \sigma^2\, (\mathbf{X}\T\mathbf{X})^{-1}. \end{aligned}

The transpose of A\mathbf{A} is X(X′X)−1\mathbf{X}(\mathbf{X}\T\mathbf{X})^{-1} because X′X\mathbf{X}\T\mathbf{X} is symmetric, so its inverse is too. In the last step (X′X)−1X′X=I(\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{X} = \mathbf{I}.

A\mathbf{A} 的轉置是 X(X′X)−1\mathbf{X}(\mathbf{X}\T\mathbf{X})^{-1},因為 X′X\mathbf{X}\T\mathbf{X} 是對稱矩陣,它的逆矩陣也是。最後一步用了 (X′X)−1X′X=I(\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{X} = \mathbf{I}。

Write ajja_{jj} for the diagonal element of (X′X)−1(\mathbf{X}\T\mathbf{X})^{-1} that belongs to β^j\bh_j (row and column j+1j + 1, since the intercept comes first). Then Var⁡(β^j∣X)=σ2ajj\operatorname{Var}(\bh_j \mid \mathbf{X}) = \sigma^2 a_{jj}, and the off-diagonal elements give the covariances between coefficients. For the slope on xjx_j there is a revealing formula for ajja_{jj}:

記 ajja_{jj} 為 (X′X)−1(\mathbf{X}\T\mathbf{X})^{-1} 中對應 β^j\bh_j 的對角元素(因為截距排第一,所以是第 j+1j + 1 行第 j+1j + 1 列)。於是 Var⁡(β^j∣X)=σ2ajj\operatorname{Var}(\bh_j \mid \mathbf{X}) = \sigma^2 a_{jj},而非對角元素就是係數之間的協方差。對於 xjx_j 的斜率,ajja_{jj} 有一條很有啟發性的公式:

Var⁡(β^j∣X)=σ2SSTj (1−Rj2),\operatorname{Var}(\bh_j \mid \mathbf{X}) = \frac{\sigma^2}{\text{SST}_j\,(1 - R_j^2)},

where SSTj=∑i(xij−xˉj)2\text{SST}_j = \sum_i (x_{ij} - \bar x_j)^2 is the total variation in xjx_j and Rj2R_j^2 is the R2R^2 from regressing xjx_j on all the other regressors. The variance is smaller when

其中 SSTj=∑i(xij−xˉj)2\text{SST}_j = \sum_i (x_{ij} - \bar x_j)^2 是 xjx_j 的總變異,Rj2R_j^2 是把 xjx_j 對所有其他解釋變數回歸所得的 R2R^2。以下情況方差較小:

  • σ2\sigma^2 is small: less noise in the outcome.

    σ2\sigma^2 較小:結果中的雜訊較少。

  • SSTj\text{SST}_j is large: the regressor varies a lot. Every added observation adds a non-negative term to SSTj\text{SST}_j, so it grows roughly in proportion to nn, and the standard error shrinks roughly like 1/n1/\sqrt{n}.

    SSTj\text{SST}_j 較大:解釋變數變化較大。每增加一個觀測值,SSTj\text{SST}_j 便多一個非負項,所以它大致與 nn 成正比增長,標準誤大致按 1/n1/\sqrt{n} 縮小。

  • Rj2R_j^2 is small: the regressor is not well explained by the others. When regressors move together (multicollinearity), there is little independent variation left to pin down each effect.

    Rj2R_j^2 較小:其他解釋變數解釋不了這個變數多少。當解釋變數一起變動時(多重共線性),可用來確定各自效應的獨立變化就很少。

In wage2, SSTeduc=4506.8\text{SST}_{\text{educ}} = 4506.8 and regressing education on IQ gives R2=0.266R^2 = 0.266, so a11=1/(4506.8×0.734)=0.000302a_{11} = 1/(4506.8 \times 0.734) = 0.000302, exactly the diagonal element of (X′X)−1(\mathbf{X}\T\mathbf{X})^{-1}. The factor 1/(1−0.266)=1.361/(1 - 0.266) = 1.36 says the correlation with IQ inflates the variance of the education coefficient by 36%.

在 wage2 中,SSTeduc=4506.8\text{SST}_{\text{educ}} = 4506.8,把教育對智商回歸得到 R2=0.266R^2 = 0.266,所以 a11=1/(4506.8×0.734)=0.000302a_{11} = 1/(4506.8 \times 0.734) = 0.000302,正好等於 (X′X)−1(\mathbf{X}\T\mathbf{X})^{-1} 的對角元素。因子 1/(1−0.266)=1.361/(1 - 0.266) = 1.36 表示與智商的相關令教育係數的方差擴大了 36%。

Show every step: why aⱼⱼ = 1/(SSTⱼ(1 − Rⱼ²)) 顯示完整推導:為甚麼 aⱼⱼ = 1/(SSTⱼ(1 − Rⱼ²))

Reorder the columns so xj\mathbf{x}_j comes first and the rest, including the column of ones, form X−j\mathbf{X}_{-j}. Then

重新排列各列,把 xj\mathbf{x}_j 放在第一列,其餘各列(包括全為 1 的一列)組成 X−j\mathbf{X}_{-j}。於是

X′X=[xj′xjxj′X−jX−j′xjX−j′X−j].\mathbf{X}\T\mathbf{X} = \begin{bmatrix} \mathbf{x}_j\T\mathbf{x}_j & \mathbf{x}_j\T\mathbf{X}_{-j} \\ \mathbf{X}_{-j}\T\mathbf{x}_j & \mathbf{X}_{-j}\T\mathbf{X}_{-j} \end{bmatrix}.

For a partitioned symmetric matrix [ab′bC]\left[\begin{smallmatrix} a & \mathbf{b}\T \\ \mathbf{b} & \mathbf{C} \end{smallmatrix}\right], the top-left element of the inverse is 1/(a−b′C−1b)1/(a - \mathbf{b}\T\mathbf{C}^{-1}\mathbf{b}). Here that denominator is

對於分塊對稱矩陣 [ab′bC]\left[\begin{smallmatrix} a & \mathbf{b}\T \\ \mathbf{b} & \mathbf{C} \end{smallmatrix}\right],其逆矩陣左上角的元素是 1/(a−b′C−1b)1/(a - \mathbf{b}\T\mathbf{C}^{-1}\mathbf{b})。這裏分母等於

xj′xj−xj′X−j(X−j′X−j)−1X−j′xj=xj′M−jxj=r^j′r^j,\begin{aligned} &\mathbf{x}_j\T\mathbf{x}_j - \mathbf{x}_j\T\mathbf{X}_{-j}(\mathbf{X}_{-j}\T\mathbf{X}_{-j})^{-1}\mathbf{X}_{-j}\T\mathbf{x}_j \\ &\quad = \mathbf{x}_j\T\mathbf{M}_{-j}\mathbf{x}_j = \hat{\mathbf{r}}_j\T\hat{\mathbf{r}}_j, \end{aligned}

where M−j=I−X−j(X−j′X−j)−1X−j′\mathbf{M}_{-j} = \mathbf{I} - \mathbf{X}_{-j}(\mathbf{X}_{-j}\T\mathbf{X}_{-j})^{-1}\mathbf{X}_{-j}\T turns any vector into its residuals from a regression on X−j\mathbf{X}_{-j}. It is symmetric and M−jM−j=M−j\mathbf{M}_{-j}\mathbf{M}_{-j} = \mathbf{M}_{-j}, so xj′M−jxj\mathbf{x}_j\T\mathbf{M}_{-j}\mathbf{x}_j is the sum of squared residuals r^j\hat{\mathbf{r}}_j from regressing xjx_j on the other regressors. By the definition of R2R^2, that sum is SSTj(1−Rj2)\text{SST}_j(1 - R_j^2). Hence

其中 M−j=I−X−j(X−j′X−j)−1X−j′\mathbf{M}_{-j} = \mathbf{I} - \mathbf{X}_{-j}(\mathbf{X}_{-j}\T\mathbf{X}_{-j})^{-1}\mathbf{X}_{-j}\T 把任何向量變成它對 X−j\mathbf{X}_{-j} 回歸的殘差。它是對稱的,而且 M−jM−j=M−j\mathbf{M}_{-j}\mathbf{M}_{-j} = \mathbf{M}_{-j},所以 xj′M−jxj\mathbf{x}_j\T\mathbf{M}_{-j}\mathbf{x}_j 就是把 xjx_j 對其他解釋變數回歸的殘差 r^j\hat{\mathbf{r}}_j 的平方和。根據 R2R^2 的定義,這個平方和等於 SSTj(1−Rj2)\text{SST}_j(1 - R_j^2)。因此

ajj=1SSTj (1−Rj2).a_{jj} = \frac{1}{\text{SST}_j\,(1 - R_j^2)}.

Reordering the columns of X only reorders the rows and columns of the inverse, so the same element is found in its original position.

重新排列 X 的各列,只會同樣地重新排列逆矩陣的行和列,所以同一元素仍在原來的位置。

Estimating σ²: standard errors估計 σ²:標準誤

We can compute (X′X)−1(\mathbf{X}\T\mathbf{X})^{-1} from the data, but σ2\sigma^2, the variance of the unobserved errors, is unknown. Estimate it from the residuals u^=y−Xβ^\hat{\mathbf{u}} = \mathbf{y} - \mathbf{X}\bhv:

(X′X)−1(\mathbf{X}\T\mathbf{X})^{-1} 可以從數據計算,但 σ2\sigma^2,即無法觀測的誤差的方差,是未知的。用殘差 u^=y−Xβ^\hat{\mathbf{u}} = \mathbf{y} - \mathbf{X}\bhv 來估計它:

σ^2=∑i=1nu^i2n−k−1=u^′u^n−k−1.\hat\sigma^2 = \frac{\sum_{i=1}^{n} \uh_i^2}{n - k - 1} = \frac{\hat{\mathbf{u}}\T\hat{\mathbf{u}}}{n - k - 1}.

Dividing by n−k−1n - k - 1 rather than nn makes σ^2\hat\sigma^2 unbiased under A1–A4. The residuals are on average smaller than the errors, because OLS chooses β^\bhv to make them small; fitting k+1k + 1 coefficients uses up k+1k + 1 degrees of freedom.

除以 n−k−1n - k - 1 而不是 nn,可以令 σ^2\hat\sigma^2 在 A1–A4 下無偏。殘差平均來說比誤差小,因為 OLS 選擇 β^\bhv 正是為了令殘差盡量小;擬合 k+1k + 1 個係數用去了 k+1k + 1 個自由度。

Show every step: why divide by n − k − 1 顯示完整推導:為甚麼除以 n − k − 1

Residuals in terms of errors. Let M=In−X(X′X)−1X′\mathbf{M} = \mathbf{I}_n - \mathbf{X}(\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T. Then u^=My\hat{\mathbf{u}} = \mathbf{M}\mathbf{y}, and since MX=X−X=0\mathbf{M}\mathbf{X} = \mathbf{X} - \mathbf{X} = \mathbf{0},

以誤差表示殘差。設 M=In−X(X′X)−1X′\mathbf{M} = \mathbf{I}_n - \mathbf{X}(\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T。那麼 u^=My\hat{\mathbf{u}} = \mathbf{M}\mathbf{y},而由於 MX=X−X=0\mathbf{M}\mathbf{X} = \mathbf{X} - \mathbf{X} = \mathbf{0},

u^=M(Xβ+u)=Mu.\hat{\mathbf{u}} = \mathbf{M}(\mathbf{X}\boldsymbol{\beta} + \mathbf{u}) = \mathbf{M}\mathbf{u}.

M\mathbf{M} is symmetric and idempotent (MM=M\mathbf{M}\mathbf{M} = \mathbf{M}), so u^′u^=u′M′Mu=u′Mu\hat{\mathbf{u}}\T\hat{\mathbf{u}} = \mathbf{u}\T\mathbf{M}\T\mathbf{M}\mathbf{u} = \mathbf{u}\T\mathbf{M}\mathbf{u}.

M\mathbf{M} 是對稱冪等矩陣(MM=M\mathbf{M}\mathbf{M} = \mathbf{M}),所以 u^′u^=u′M′Mu=u′Mu\hat{\mathbf{u}}\T\hat{\mathbf{u}} = \mathbf{u}\T\mathbf{M}\T\mathbf{M}\mathbf{u} = \mathbf{u}\T\mathbf{M}\mathbf{u}。

Use the trace. A scalar equals its own trace, and tr⁡(PQ)=tr⁡(QP)\operatorname{tr}(\mathbf{PQ}) = \operatorname{tr}(\mathbf{QP}). Given X\mathbf{X}, M\mathbf{M} is constant, and A3–A4 give E⁡(uu′∣X)=σ2In\operatorname{E}(\mathbf{u}\mathbf{u}\T \mid \mathbf{X}) = \sigma^2 \mathbf{I}_n:

利用跡。純量等於它自己的跡,而且 tr⁡(PQ)=tr⁡(QP)\operatorname{tr}(\mathbf{PQ}) = \operatorname{tr}(\mathbf{QP})。給定 X\mathbf{X} 時 M\mathbf{M} 是常數,而 A3–A4 給出 E⁡(uu′∣X)=σ2In\operatorname{E}(\mathbf{u}\mathbf{u}\T \mid \mathbf{X}) = \sigma^2 \mathbf{I}_n:

E⁡(u^′u^∣X)=E⁡ ⁣[tr⁡(u′Mu)∣X]=E⁡ ⁣[tr⁡(Muu′)∣X]=tr⁡ ⁣(M E⁡(uu′∣X))=σ2tr⁡(M).\begin{aligned} \operatorname{E}(\hat{\mathbf{u}}\T\hat{\mathbf{u}} \mid \mathbf{X}) &= \operatorname{E}\!\left[\operatorname{tr}(\mathbf{u}\T\mathbf{M}\mathbf{u}) \mid \mathbf{X}\right] \\ &= \operatorname{E}\!\left[\operatorname{tr}(\mathbf{M}\mathbf{u}\mathbf{u}\T) \mid \mathbf{X}\right] \\ &= \operatorname{tr}\!\left(\mathbf{M}\, \operatorname{E}(\mathbf{u}\mathbf{u}\T \mid \mathbf{X})\right) \\ &= \sigma^2 \operatorname{tr}(\mathbf{M}). \end{aligned}

Count the trace. Using the cyclic rule once more,

計算跡。再用一次循環規則,

tr⁡(M)=tr⁡(In)−tr⁡ ⁣((X′X)−1X′X)=n−tr⁡(Ik+1)=n−k−1.\begin{aligned} \operatorname{tr}(\mathbf{M}) &= \operatorname{tr}(\mathbf{I}_n) - \operatorname{tr}\!\left((\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{X}\right) \\ &= n - \operatorname{tr}(\mathbf{I}_{k+1}) = n - k - 1. \end{aligned}

So E⁡(u^′u^∣X)=(n−k−1)σ2\operatorname{E}(\hat{\mathbf{u}}\T\hat{\mathbf{u}} \mid \mathbf{X}) = (n - k - 1)\sigma^2, and dividing by n−k−1n - k - 1 gives E⁡(σ^2∣X)=σ2\operatorname{E}(\hat\sigma^2 \mid \mathbf{X}) = \sigma^2.

所以 E⁡(u^′u^∣X)=(n−k−1)σ2\operatorname{E}(\hat{\mathbf{u}}\T\hat{\mathbf{u}} \mid \mathbf{X}) = (n - k - 1)\sigma^2,除以 n−k−1n - k - 1 便得到 E⁡(σ^2∣X)=σ2\operatorname{E}(\hat\sigma^2 \mid \mathbf{X}) = \sigma^2。

Plugging σ^2\hat\sigma^2 into the variance formula gives the estimated covariance matrix, and the square roots of its diagonal are the standard errors:

把 σ^2\hat\sigma^2 代入方差公式,便得到估計的協方差矩陣,其對角元素的平方根就是標準誤:

Var⁡^(β^∣X)=σ^2(X′X)−1,\widehat{\operatorname{Var}}(\bhv \mid \mathbf{X}) = \hat\sigma^2 (\mathbf{X}\T\mathbf{X})^{-1},
se⁡(β^j)=σ^ajj.\operatorname{se}(\bh_j) = \hat\sigma\sqrt{a_{jj}}.

σ^\hat\sigma is what R calls the residual standard error; it is in the units of yy. For the wage regression, σ^=376.73\hat\sigma = 376.73 dollars a month, so σ^2=141,926\hat\sigma^2 = 141{,}926, and

σ^\hat\sigma 在 R 中稱為殘差標準誤(residual standard error),單位與 yy 相同。在工資回歸中,σ^=376.73\hat\sigma = 376.73 美元一個月,所以 σ^2=141,926\hat\sigma^2 = 141{,}926,而

Dependent variable: monthly earnings (US$), wage2, n = 935 被解釋變數:月收入(美元)
Estimateajja_{jj}Std. error
Intercept 截距−128.895.987×10−25.987 \times 10^{-2}92.18
educ 教育年數42.063.023×10−43.023 \times 10^{-4}6.550
IQ 智商5.1386.437×10−66.437 \times 10^{-6}0.956

Each standard error is σ^ajj\hat\sigma\sqrt{a_{jj}}, with σ^=376.73\hat\sigma = 376.73 on 932932 degrees of freedom. They match the “Std. Error” column of the regression output.

每個標準誤都等於 σ^ajj\hat\sigma\sqrt{a_{jj}},其中 σ^=376.73\hat\sigma = 376.73,自由度為 932932。結果與回歸輸出中的「Std. Error」一欄相同。

For education, 376.73×0.000302=6.550376.73 \times \sqrt{0.000302} = 6.550. The full estimated covariance matrix, in the order intercept, educ, IQ, is

以教育為例,376.73×0.000302=6.550376.73 \times \sqrt{0.000302} = 6.550。完整的估計協方差矩陣(次序為截距、educ、IQ)是

σ^2(X′X)−1=[8497.6−250.81−49.05−250.8142.90−3.229−49.05−3.2290.914].\begin{aligned} &\hat\sigma^2 (\mathbf{X}\T\mathbf{X})^{-1} \\ &\quad = \begin{bmatrix} 8497.6 & -250.81 & -49.05 \\ -250.81 & 42.90 & -3.229 \\ -49.05 & -3.229 & 0.914 \end{bmatrix}. \end{aligned}

The diagonal holds the squared standard errors (6.5502=42.906.550^2 = 42.90). The negative covariance between the education and IQ coefficients means that in samples where education’s effect comes out high, IQ’s tends to come out low: the two regressors are positively correlated, so the data struggle to say which deserves the credit. Their correlation is −3.229/(6.550×0.9558)=−0.52-3.229/(6.550 \times 0.9558) = -0.52.

對角線上是標準誤的平方(6.5502=42.906.550^2 = 42.90)。教育係數與智商係數之間的協方差為負,表示在教育效應估得偏高的樣本中,智商效應往往估得偏低:兩個解釋變數正相關,數據難以分辨功勞該歸誰。兩者的相關係數是 −3.229/(6.550×0.9558)=−0.52-3.229/(6.550 \times 0.9558) = -0.52。

Efficiency and the Gauss–Markov theorem有效性與高斯-馬可夫定理

Unbiasedness alone is a low bar. An unbiased estimator can still be so spread out that any one estimate is likely to be far from the truth. Between two unbiased estimators of θ\theta, θ~\tilde\theta is more efficient than θ^\hat\theta if Var⁡(θ~)<Var⁡(θ^)\operatorname{Var}(\tilde\theta) < \operatorname{Var}(\hat\theta).

單是無偏並不足夠。一個無偏估計量的離散程度可能很大,以致任何一次估計都很可能遠離真值。在兩個 θ\theta 的無偏估計量之中,如果 Var⁡(θ~)<Var⁡(θ^)\operatorname{Var}(\tilde\theta) < \operatorname{Var}(\hat\theta),θ~\tilde\theta 就比 θ^\hat\theta 更有效。

The Gauss–Markov theorem. Under A1–A4, OLS is the best linear unbiased estimator (BLUE) of β\boldsymbol{\beta}. “Linear” means the estimator is a weighted sum of the yiy_i, β~=Cy\tilde{\boldsymbol{\beta}} = \mathbf{C}\mathbf{y}, with weights C\mathbf{C} that may depend on X\mathbf{X}. “Best” means smallest variance: for any such estimator that is unbiased, and every coefficient j=0,1,…,kj = 0, 1, \dots, k,

高斯-馬可夫定理。在 A1–A4 下,OLS 是 β\boldsymbol{\beta} 的最佳線性無偏估計量(BLUE)。「線性」指估計量是各 yiy_i 的加權和,β~=Cy\tilde{\boldsymbol{\beta}} = \mathbf{C}\mathbf{y},權重 C\mathbf{C} 可以取決於 X\mathbf{X}。「最佳」指方差最小:對任何這樣的無偏估計量及每個係數 j=0,1,…,kj = 0, 1, \dots, k,

Var⁡(β~j∣X)≥Var⁡(β^j∣X).\operatorname{Var}(\tilde\beta_j \mid \mathbf{X}) \geq \operatorname{Var}(\bh_j \mid \mathbf{X}).

In fact the stronger statement holds: Var⁡(β~∣X)−Var⁡(β^∣X)\operatorname{Var}(\tilde{\boldsymbol{\beta}} \mid \mathbf{X}) - \operatorname{Var}(\bhv \mid \mathbf{X}) is positive semi-definite, so OLS also wins for any linear combination of the coefficients, such as β1−β2\beta_1 - \beta_2.

事實上更強的結論也成立:Var⁡(β~∣X)−Var⁡(β^∣X)\operatorname{Var}(\tilde{\boldsymbol{\beta}} \mid \mathbf{X}) - \operatorname{Var}(\bhv \mid \mathbf{X}) 是半正定矩陣,所以對係數的任何線性組合(例如 β1−β2\beta_1 - \beta_2),OLS 也勝出。

Show every step: proof of the Gauss–Markov theorem 顯示完整推導:高斯-馬可夫定理的證明

Step 1: write any linear estimator relative to OLS. Let β~=Cy\tilde{\boldsymbol{\beta}} = \mathbf{C}\mathbf{y} and define D=C−(X′X)−1X′\mathbf{D} = \mathbf{C} - (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T, so C=(X′X)−1X′+D\mathbf{C} = (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T + \mathbf{D}. Substitute y=Xβ+u\mathbf{y} = \mathbf{X}\boldsymbol{\beta} + \mathbf{u}:

第一步:以 OLS 為參照寫出任何線性估計量。設 β~=Cy\tilde{\boldsymbol{\beta}} = \mathbf{C}\mathbf{y},並定義 D=C−(X′X)−1X′\mathbf{D} = \mathbf{C} - (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T,於是 C=(X′X)−1X′+D\mathbf{C} = (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T + \mathbf{D}。代入 y=Xβ+u\mathbf{y} = \mathbf{X}\boldsymbol{\beta} + \mathbf{u}:

β~=CXβ+Cu=β+DXβ+Cu.\begin{aligned} \tilde{\boldsymbol{\beta}} &= \mathbf{C}\mathbf{X}\boldsymbol{\beta} + \mathbf{C}\mathbf{u} \\ &= \boldsymbol{\beta} + \mathbf{D}\mathbf{X}\boldsymbol{\beta} + \mathbf{C}\mathbf{u}. \end{aligned}

Step 2: unbiasedness forces DX = 0. Given X\mathbf{X}, E⁡(Cu∣X)=0\operatorname{E}(\mathbf{C}\mathbf{u} \mid \mathbf{X}) = \mathbf{0} by A3, so E⁡(β~∣X)=β+DXβ\operatorname{E}(\tilde{\boldsymbol{\beta}} \mid \mathbf{X}) = \boldsymbol{\beta} + \mathbf{D}\mathbf{X}\boldsymbol{\beta}. For this to equal β\boldsymbol{\beta} whatever the true β\boldsymbol{\beta} is, we need DX=0\mathbf{D}\mathbf{X} = \mathbf{0}. Then β~−β=Cu\tilde{\boldsymbol{\beta}} - \boldsymbol{\beta} = \mathbf{C}\mathbf{u}.

第二步:無偏性要求 DX = 0。給定 X\mathbf{X},根據 A3 有 E⁡(Cu∣X)=0\operatorname{E}(\mathbf{C}\mathbf{u} \mid \mathbf{X}) = \mathbf{0},所以 E⁡(β~∣X)=β+DXβ\operatorname{E}(\tilde{\boldsymbol{\beta}} \mid \mathbf{X}) = \boldsymbol{\beta} + \mathbf{D}\mathbf{X}\boldsymbol{\beta}。要令它對任何真值 β\boldsymbol{\beta} 都等於 β\boldsymbol{\beta},就必須有 DX=0\mathbf{D}\mathbf{X} = \mathbf{0}。於是 β~−β=Cu\tilde{\boldsymbol{\beta}} - \boldsymbol{\beta} = \mathbf{C}\mathbf{u}。

Step 3: the variance. By the rule of Section 4 and A4,

第三步:方差。根據第 4 節的規則和 A4,

Var⁡(β~∣X)=σ2CC′ =σ2((X′X)−1X′+D)×(X(X′X)−1+D′) =σ2[(X′X)−1+(X′X)−1(DX)′+DX(X′X)−1+DD′] =σ2(X′X)−1+σ2DD′.\begin{aligned} &\operatorname{Var}(\tilde{\boldsymbol{\beta}} \mid \mathbf{X}) = \sigma^2 \mathbf{C}\mathbf{C}\T \\ &\ = \sigma^2 \big((\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T + \mathbf{D}\big) \\ &\qquad \times \big(\mathbf{X}(\mathbf{X}\T\mathbf{X})^{-1} + \mathbf{D}\T\big) \\ &\ = \sigma^2 \big[(\mathbf{X}\T\mathbf{X})^{-1} \\ &\qquad + (\mathbf{X}\T\mathbf{X})^{-1}(\mathbf{D}\mathbf{X})\T \\ &\qquad + \mathbf{D}\mathbf{X}(\mathbf{X}\T\mathbf{X})^{-1} + \mathbf{D}\mathbf{D}\T\big] \\ &\ = \sigma^2 (\mathbf{X}\T\mathbf{X})^{-1} + \sigma^2 \mathbf{D}\mathbf{D}\T. \end{aligned}

The two middle terms vanish because DX=0\mathbf{D}\mathbf{X} = \mathbf{0}. The first remaining term is Var⁡(β^∣X)\operatorname{Var}(\bhv \mid \mathbf{X}).

中間兩項因為 DX=0\mathbf{D}\mathbf{X} = \mathbf{0} 而消失。剩下的第一項就是 Var⁡(β^∣X)\operatorname{Var}(\bhv \mid \mathbf{X})。

Step 4: compare. The jjth diagonal element of DD′\mathbf{D}\mathbf{D}\T is ∑idji2≥0\sum_i d_{ji}^2 \geq 0, the sum of squares of row jj of D\mathbf{D}. So every β~j\tilde\beta_j has at least the variance of β^j\bh_j, with equality for all jj only when D=0\mathbf{D} = \mathbf{0}, that is, when β~\tilde{\boldsymbol{\beta}} is OLS. For a combination c′β\mathbf{c}\T\boldsymbol{\beta}, the extra variance is σ2c′DD′c=σ2∥D′c∥2≥0\sigma^2 \mathbf{c}\T\mathbf{D}\mathbf{D}\T\mathbf{c} = \sigma^2 \lVert \mathbf{D}\T\mathbf{c} \rVert^2 \geq 0.

第四步:比較。DD′\mathbf{D}\mathbf{D}\T 的第 jj 個對角元素是 ∑idji2≥0\sum_i d_{ji}^2 \geq 0,即 D\mathbf{D} 第 jj 行的平方和。所以每個 β~j\tilde\beta_j 的方差都至少等於 β^j\bh_j 的方差;只有當 D=0\mathbf{D} = \mathbf{0},即 β~\tilde{\boldsymbol{\beta}} 就是 OLS 時,所有 jj 才同時相等。對於線性組合 c′β\mathbf{c}\T\boldsymbol{\beta},額外的方差是 σ2c′DD′c=σ2∥D′c∥2≥0\sigma^2 \mathbf{c}\T\mathbf{D}\mathbf{D}\T\mathbf{c} = \sigma^2 \lVert \mathbf{D}\T\mathbf{c} \rVert^2 \geq 0。

Example. Take the simple regression of wages on education. A natural rival slope compares two groups: men with more than 12 years of schooling (454 of them) against the rest (481):

例子。考慮工資對教育的簡單回歸。一個自然的替代斜率是比較兩組人:受教育超過 12 年的男士(454 人)與其餘的人(481 人):

βˇ1=yˉhigh−yˉlowxˉhigh−xˉlow.\check\beta_1 = \frac{\bar y_{\text{high}} - \bar y_{\text{low}}}{\bar x_{\text{high}} - \bar x_{\text{low}}}.

It is linear in yy, and its weights sum to zero and give ∑iwixi=1\sum_i w_i x_i = 1, which makes it unbiased under A1–A3. In wage2 it gives 63.12, against 60.21 for OLS. Both are fine on average; the difference is precision. Its variance is σ2∑iwi2\sigma^2 \sum_i w_i^2, against σ2/SSTx\sigma^2/\text{SST}_x for OLS, and here the ratio is

它是 yy 的線性函數,其權重之和為零,並且 ∑iwixi=1\sum_i w_i x_i = 1,所以在 A1–A3 下無偏。在 wage2 中它得出 63.12,而 OLS 是 60.21。兩者平均來說都正確,分別在於精確度。它的方差是 σ2∑iwi2\sigma^2 \sum_i w_i^2,OLS 的則是 σ2/SSTx\sigma^2/\text{SST}_x,兩者之比為

Var⁡(βˇ1)Var⁡(β^1)=SSTx∑iwi2=1.46.\frac{\operatorname{Var}(\check\beta_1)}{\operatorname{Var}(\bh_1)} = \text{SST}_x \sum_{i} w_i^2 = 1.46.

The grouping estimator has 46% more variance: its standard error would be 6.88 against 5.69 for OLS. It throws away the information in how far each man is from the cut-off. Gauss–Markov guarantees that no clever weighting can beat OLS while staying linear and unbiased.

分組估計量的方差多出 46%:它的標準誤會是 6.88,而 OLS 是 5.69。它丟棄了每個人距離分界點多遠的資訊。高斯-馬可夫定理保證,在保持線性和無偏的前提下,任何巧妙的加權方法都無法勝過 OLS。

The sampling distribution抽樣分佈

The mean and variance do not pin down the whole distribution. For exact tests we add a fifth assumption:

均值和方差並不能完全確定整個分佈。為了得到準確的檢定,再加上第五個假設:

  1. A5

    Normal errors. u∣X∼N(0,σ2In)\mathbf{u} \mid \mathbf{X} \sim N(\mathbf{0}, \sigma^2 \mathbf{I}_n).

    誤差服從正態分佈。u∣X∼N(0,σ2In)\mathbf{u} \mid \mathbf{X} \sim N(\mathbf{0}, \sigma^2 \mathbf{I}_n)。

A5 contains A3 and A4 and adds the normal shape. It implies y∣X∼N(Xβ,σ2In)\mathbf{y} \mid \mathbf{X} \sim N(\mathbf{X}\boldsymbol{\beta}, \sigma^2 \mathbf{I}_n): each yiy_i is normal around its regression line β0+β1xi1+⋯+βkxik\beta_0 + \beta_1 x_{i1} + \dots + \beta_k x_{ik}, with variance σ2\sigma^2. Under A1–A5,

A5 包含了 A3 和 A4,並加上正態的形狀。它意味著 y∣X∼N(Xβ,σ2In)\mathbf{y} \mid \mathbf{X} \sim N(\mathbf{X}\boldsymbol{\beta}, \sigma^2 \mathbf{I}_n):每個 yiy_i 都圍繞其回歸線 β0+β1xi1+⋯+βkxik\beta_0 + \beta_1 x_{i1} + \dots + \beta_k x_{ik} 呈正態分佈,方差為 σ2\sigma^2。在 A1–A5 下,

β^∣X∼N ⁣(β,  σ2(X′X)−1).\bhv \mid \mathbf{X} \sim N\!\left(\boldsymbol{\beta},\; \sigma^2 (\mathbf{X}\T\mathbf{X})^{-1}\right).

The mean comes from Section 2 and the variance from Section 5. The shape is normal because β^=β+(X′X)−1X′u\bhv = \boldsymbol{\beta} + (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{u} is a fixed linear combination of the errors, and any linear combination of jointly normal variables is normal. One coefficient at a time,

均值來自第 2 節,方差來自第 5 節。形狀是正態的,因為 β^=β+(X′X)−1X′u\bhv = \boldsymbol{\beta} + (\mathbf{X}\T\mathbf{X})^{-1}\mathbf{X}\T\mathbf{u} 是誤差的固定線性組合,而聯合正態變數的任何線性組合都是正態的。逐個係數來看,

β^j∼N(βj, σ2ajj),\bh_j \sim N(\beta_j,\, \sigma^2 a_{jj}),
β^j−βjsd⁡(β^j)=β^j−βjσajj∼N(0,1).\frac{\bh_j - \beta_j}{\operatorname{sd}(\bh_j)} = \frac{\bh_j - \beta_j}{\sigma\sqrt{a_{jj}}} \sim N(0, 1).

Replace the unknown σ\sigma with σ^\hat\sigma, so the denominator becomes the standard error, and the ratio follows a tt distribution with n−k−1n - k - 1 degrees of freedom. That is the t statistic of Week 4. For education, the 97.5th percentile of t932t_{932} is 1.963, and the 95% confidence interval is 42.06±1.963×6.550=[29.20, 54.91]42.06 \pm 1.963 \times 6.550 = [29.20,\ 54.91].

把未知的 σ\sigma 換成 σ^\hat\sigma,分母就變成標準誤,比率便服從自由度為 n−k−1n - k - 1 的 tt 分佈。這正是第 4 週的 t 統計量。以教育為例,t932t_{932} 的第 97.5 百分位數是 1.963,95% 置信區間是 42.06±1.963×6.550=[29.20, 54.91]42.06 \pm 1.963 \times 6.550 = [29.20,\ 54.91]。

Try it. The demo takes the wage regression as the truth and draws new samples. Watch three things: the histogram centres on 42.06 (unbiasedness), its spread matches the theoretical standard deviation (the variance formula), and it follows the normal curve. Then change one thing at a time.

動手試試。這個示範把工資回歸當作真實模型,然後抽取新樣本。留意三點:直方圖以 42.06 為中心(無偏性);它的離散程度與理論標準差吻合(方差公式);它貼合正態曲線。然後每次只改變一樣設定。

Simulated estimates 模擬估計值Theory 理論分佈Latest sample 最新樣本

Samples 樣本數
0
Latest 最新
–
Mean 平均
–
Theory 理論
–
Sd 標準差
–
Theory 理論
–

Each sample keeps the education and IQ of the first nn men in wage2, draws fresh errors, and re-estimates the regression. The true model is the fitted one, so β1=42.06\beta_1 = 42.06. With IQ left out, the estimates centre on 60.21 instead: that is the omitted-variable bias of Section 3. The skewed errors have the same σ; the histogram is still centred on the truth with the same spread.

每個樣本保留 wage2 中首 nn 名男士的教育年數和智商,重新抽取誤差,再估計一次回歸。真實模型就是擬合出來的模型,所以 β1=42.06\beta_1 = 42.06。如果不放入智商,估計值便以 60.21 為中心:這就是第 3 節的遺漏變數偏誤。偏態誤差的 σ 相同;直方圖仍然以真值為中心,離散程度也一樣。

  • Smaller n or larger σ widens the histogram; it stays centred on the truth.

    較小的 n 或較大的 σ 令直方圖變闊,但中心仍在真值。

  • Skewed errors break A5 but not A1–A4. The centre and spread are unchanged, and with 935 observations the histogram still looks normal: the estimate averages many errors, so the central limit theorem takes over. With n = 100 the t test is then only approximately right.

    偏態誤差違反 A5,但沒有違反 A1–A4。中心和離散程度不變;有 935 個觀測值時,直方圖看起來仍然是正態的:估計值是許多誤差的平均,中央極限定理會發揮作用。當 n = 100 時,t 檢定便只是近似正確。

  • Leaving IQ out breaks A3. The histogram jumps away from 42.06 (to 60.21 with all 935 men) and stays there however many samples you draw. Note that its spread is smaller: biased can still be precise.

    不放入智商違反 A3。直方圖離開 42.06(用全部 935 人時移到 60.21),無論抽多少個樣本都停留在那裏。留意它的離散程度反而較小:有偏誤的估計也可以很精確。

Which assumption buys what每個假設的作用

Each result needs a little more than the one before:

每個結果所需的假設都比前一個多一點:

Result 結果Needs 所需假設
OLS is unbiased OLS 無偏A1–A3
Variance is σ²(X′X)⁻¹ 方差等於 σ²(X′X)⁻¹A1–A4
σ̂² is unbiased; standard errors are valid σ̂² 無偏;標準誤有效A1–A4
OLS is BLUE (Gauss–Markov) OLS 是最佳線性無偏估計量A1–A4
β̂ is exactly normal; t and F tests are exact β̂ 準確服從正態;t 和 F 檢定準確A1–A5

Reproduce the results自己重現結果

The data come with the free wooldridge package for R and Python. Both snippets reproduce every figure on this page, including a 10,000-sample version of the demo.

數據收錄在免費的 wooldridge 套件中,R 和 Python 都可使用。兩段程式碼都會重現本頁的所有數字,包括一個抽取 10,000 個樣本的示範版本。

R
library(wooldridge)

m <- lm(wage ~ educ + IQ, data = wage2)
summary(m)                                  # se 92.18, 6.550, 0.956; sigma-hat 376.7

# The same numbers from the matrix formulas
X <- model.matrix(m)
n <- nrow(X); k <- ncol(X) - 1
s2 <- sum(resid(m)^2) / (n - k - 1)         # sigma-hat squared: 141,926
V <- s2 * solve(t(X) %*% X)                 # equals vcov(m)
sqrt(diag(V))                               # the standard errors
cov2cor(V)["educ", "IQ"]                    # -0.52

# a_jj for educ from an auxiliary regression
sst <- sum((wage2$educ - mean(wage2$educ))^2)
r2 <- summary(lm(educ ~ IQ, data = wage2))$r.squared
c(1 / (sst * (1 - r2)), solve(t(X) %*% X)[2, 2])   # both 0.000302

# Leave IQ out: the slope moves by b_IQ times delta
short <- lm(wage ~ educ, data = wage2)
delta <- coef(lm(IQ ~ educ, data = wage2))["educ"]
c(coef(short)["educ"], coef(m)["educ"] + coef(m)["IQ"] * delta)   # 60.21 twice

# A rival linear unbiased slope: compare more than 12 years with the rest
x <- wage2$educ; hi <- x > 12
w <- ifelse(hi, 1 / sum(hi), -1 / sum(!hi)) / (mean(x[hi]) - mean(x[!hi]))
c(sum(w * wage2$wage), sum(w^2) * sst)      # 63.12; variance 1.46 times OLS

# Repeated samples: keep X, draw new errors, re-estimate
set.seed(2410)
b <- coef(m); sigma <- sqrt(s2)
sims <- replicate(10000, {
  y <- X %*% b + rnorm(n, 0, sigma)
  qr.coef(qr(X), y)[2]
})
c(mean(sims), sd(sims))                     # close to 42.06 and 6.55
Python
# pip install wooldridge statsmodels
import numpy as np
import statsmodels.formula.api as smf
import wooldridge as wd

wage2 = wd.data("wage2")
m = smf.ols("wage ~ educ + IQ", data=wage2).fit()
print(m.bse, np.sqrt(m.scale))                 # se 92.18, 6.550, 0.956; sigma-hat 376.7

# The same numbers from the matrix formulas
X = np.column_stack([np.ones(len(wage2)), wage2.educ, wage2.IQ])
n, k = X.shape[0], X.shape[1] - 1
s2 = m.ssr / (n - k - 1)                       # sigma-hat squared: 141,926
XtX_inv = np.linalg.inv(X.T @ X)
V = s2 * XtX_inv                               # equals m.cov_params()
print(np.sqrt(np.diag(V)))                     # the standard errors
print(V[1, 2] / np.sqrt(V[1, 1] * V[2, 2]))    # -0.52

# a_jj for educ from an auxiliary regression
x = wage2.educ.to_numpy(dtype=float)
sst = ((x - x.mean()) ** 2).sum()
r2 = smf.ols("educ ~ IQ", data=wage2).fit().rsquared
print(1 / (sst * (1 - r2)), XtX_inv[1, 1])     # both 0.000302

# Leave IQ out: the slope moves by b_IQ times delta
short = smf.ols("wage ~ educ", data=wage2).fit()
delta = smf.ols("IQ ~ educ", data=wage2).fit().params["educ"]
print(short.params["educ"], m.params["educ"] + m.params["IQ"] * delta)   # 60.21 twice

# A rival linear unbiased slope: compare more than 12 years with the rest
hi = x > 12
w = np.where(hi, 1 / hi.sum(), -1 / (~hi).sum()) / (x[hi].mean() - x[~hi].mean())
print(w @ wage2.wage, (w ** 2).sum() * sst)    # 63.12; variance 1.46 times OLS

# Repeated samples: keep X, draw new errors, re-estimate
rng = np.random.default_rng(2410)
b, sigma = m.params.to_numpy(), np.sqrt(s2)
Y = X @ b + rng.normal(0, sigma, size=(10_000, n))
sims = Y @ (XtX_inv @ X.T)[1]
print(sims.mean(), sims.std(ddof=1))           # close to 42.06 and 6.55

The simulations draw random numbers, so the last line gives slightly different values in R and Python. Both are within 0.1 of 42.06 and 6.55.

模擬會抽取隨機數,所以最後一行在 R 和 Python 中的結果略有不同,但兩者與 42.06 和 6.55 的差距都在 0.1 以內。

Check your understanding自我測驗

  1. From a random sample with E⁡(yi)=μ\operatorname{E}(y_i) = \mu and Var⁡(yi)=σ2\operatorname{Var}(y_i) = \sigma^2, a classmate estimates μ\mu with the first observation, y1y_1. Is it unbiased? Is it a good estimator?

    從一個 E⁡(yi)=μ\operatorname{E}(y_i) = \mu、Var⁡(yi)=σ2\operatorname{Var}(y_i) = \sigma^2 的隨機樣本中,一位同學只用第一個觀測值 y1y_1 來估計 μ\mu。它是否無偏?它是不是好的估計量?

    Answer 答案

    It is unbiased, since E⁡(y1)=μ\operatorname{E}(y_1) = \mu. But its variance is σ2\sigma^2, against σ2/n\sigma^2/n for yˉ\bar y, which is also linear and unbiased. With n=100n = 100 it is 100 times less efficient. Unbiasedness alone is not enough.

    它是無偏的,因為 E⁡(y1)=μ\operatorname{E}(y_1) = \mu。但它的方差是 σ2\sigma^2,而同樣線性且無偏的 yˉ\bar y 的方差是 σ2/n\sigma^2/n。當 n=100n = 100 時,它的效率低 100 倍。單是無偏並不足夠。

  2. The errors in a wage regression are more spread out for highly educated workers. Which of these still hold: (a) OLS is unbiased; (b) the usual standard errors are right; (c) OLS is BLUE?

    在一個工資回歸中,教育程度高的人誤差較分散。以下哪些仍然成立:(a) OLS 無偏;(b) 一般的標準誤正確;(c) OLS 是 BLUE?

    Answer 答案

    Only (a). Heteroskedasticity breaks A4, which unbiasedness does not need. The variance formula σ²(X′X)⁻¹, and with it the usual standard errors and the Gauss–Markov theorem, all rely on A4.

    只有 (a)。異方差違反 A4,而無偏性並不需要 A4。方差公式 σ²(X′X)⁻¹,以及隨之而來的一般標準誤和高斯-馬可夫定理,全都依賴 A4。

  3. In the wage regression, σ^=376.73\hat\sigma = 376.73 and the diagonal element of (X′X)−1(\mathbf{X}\T\mathbf{X})^{-1} for IQ is 6.437×10−66.437 \times 10^{-6}. Compute the standard error of the IQ coefficient.

    在工資回歸中,σ^=376.73\hat\sigma = 376.73,(X′X)−1(\mathbf{X}\T\mathbf{X})^{-1} 中對應智商的對角元素是 6.437×10−66.437 \times 10^{-6}。計算智商係數的標準誤。

    Answer 答案

    376.73×6.437×10−6=376.73×0.002537=0.956376.73 \times \sqrt{6.437 \times 10^{-6}} = 376.73 \times 0.002537 = 0.956, as in the regression output.

    376.73×6.437×10−6=376.73×0.002537=0.956376.73 \times \sqrt{6.437 \times 10^{-6}} = 376.73 \times 0.002537 = 0.956,與回歸結果一致。

  4. Education’s Rj2R_j^2 on the other regressors is 0.266. If another dataset had the same σ\sigma and SSTj\text{SST}_j but Rj2=0.9R_j^2 = 0.9, by what factor would the standard error of the education coefficient change?

    教育對其他解釋變數的 Rj2R_j^2 是 0.266。如果另一組數據的 σ\sigma 和 SSTj\text{SST}_j 相同,但 Rj2=0.9R_j^2 = 0.9,教育係數的標準誤會變成原來的多少倍?

    Answer 答案

    Standard errors are proportional to 1/1−Rj21/\sqrt{1 - R_j^2}, so the factor is (1−0.266)/(1−0.9)=7.34=2.71\sqrt{(1 - 0.266)/(1 - 0.9)} = \sqrt{7.34} = 2.71. The standard error would almost triple.

    標準誤與 1/1−Rj21/\sqrt{1 - R_j^2} 成正比,所以倍數是 (1−0.266)/(1−0.9)=7.34=2.71\sqrt{(1 - 0.266)/(1 - 0.9)} = \sqrt{7.34} = 2.71。標準誤幾乎會變成原來的三倍。

  5. A colleague says that doubling the sample size halves the standard errors. Is that right?

    一位同事說,樣本量加倍會令標準誤減半。這對嗎?

    Answer 答案

    No. SSTj\text{SST}_j grows roughly in proportion to nn, so the variance falls like 1/n1/n and the standard error like 1/n1/\sqrt{n}. Doubling nn divides it by about 2=1.41\sqrt{2} = 1.41; halving it takes four times the data. In the demo, going from 250 to 500 observations moves the theoretical sd from 12.32 to 8.77, a factor of 1.40.

    不對。SSTj\text{SST}_j 大致與 nn 成正比增長,所以方差按 1/n1/n 下降,標準誤則按 1/n1/\sqrt{n} 下降。nn 加倍只會令標準誤除以約 2=1.41\sqrt{2} = 1.41;要減半需要四倍的數據。在示範中,由 250 個增至 500 個觀測值,理論標準差由 12.32 降至 8.77,相差 1.40 倍。

Sources and acknowledgement 資料來源與鳴謝

  • Lecture materials for Introductory Econometrics (ETC2410) by Associate Professor Didier Nibbering, Department of Econometrics and Business Statistics, Monash Business School.
  • Jeffrey M. Wooldridge, Introductory Econometrics: A Modern Approach, Chapters 3.3–3.5 and 4.1, and Appendix E.2.
  • Data: wage2, distributed with the textbook and in the wooldridge R package. All estimates on this page were computed from it.

Any errors are our own.