这是用户在 2025-6-5 23:33 为 https://app.immersivetranslate.com/pdf-pro/d9253553-c577-4ea3-98a2-69ba65769bf0/ 保存的双语快照页面,由 沉浸式翻译 提供双语支持。了解如何保存?

Econometrics Hypothesis test without MLR 5 and MLR 6
计量经济学假设检验(不满足 MLR 5 和 MLR 6)

JUNE 3, 2024  2024 年 6 月 3 日
The t statistic needs to be computed based on the robust standard error. The usual F statistic based on S S R S S R SSRS S R or R 2 R 2 R^(2)R^{2} would no longer have a F distribution and thus the statistic cannot be used. Instead, we will compute the Wald statistic for the joint hypothesis test. The modified F test can be computed from the Wald statistic as well.
t 统计量需要基于稳健标准误进行计算。基于 S S R S S R SSRS S R R 2 R 2 R^(2)R^{2} 的常规 F 统计量将不再服从 F 分布,因此该统计量不能使用。相反,我们将计算 Wald 统计量来进行联合假设检验。修改后的 F 检验也可以由 Wald 统计量计算得出。

OPTIONAL  可选

We can derive the asymptotic distribution of β ^ β ^ hat(beta)\hat{\beta} :
我们可以推导出 β ^ β ^ hat(beta)\hat{\beta} 的渐近分布:
β ^ β a N ( 0 k + 1 , 1 n E [ x i x i ] 1 E [ u i 2 x i x i ] E [ x i x i ] 1 ) β ^ β a N 0 k + 1 , 1 n E x i x i 1 E u i 2 x i x i E x i x i 1 hat(beta)-beta∼^(a)N(0_(k+1),(1)/(n)E[x_(i)^(')x_(i)]^(-1)E[u_(i)^(2)x_(i)^(')x_(i)]E[x_(i)^(')x_(i)]^(-1))\hat{\beta}-\beta \stackrel{a}{\sim} N\left(0_{k+1}, \frac{1}{n} E\left[x_{i}^{\prime} x_{i}\right]^{-1} E\left[u_{i}^{2} x_{i}^{\prime} x_{i}\right] E\left[x_{i}^{\prime} x_{i}\right]^{-1}\right)
Here x i x i x_(i)x_{i} is the 1 × ( k + 1 ) 1 × ( k + 1 ) 1xx(k+1)1 \times(k+1) vector that we defined in class. Once changing the expectation to sample average, the variance estimator without adjusting for the degrees of freedom would be
这里 x i x i x_(i)x_{i} 是我们在课堂上定义的 1 × ( k + 1 ) 1 × ( k + 1 ) 1xx(k+1)1 \times(k+1) 向量。一旦将期望替换为样本平均,未调整自由度的方差估计量为
var ( β ^ ) ^ = ( i = 1 n x i x i ) 1 i = 1 n u ^ i 2 x i x i ( i = 1 n x i x i ) 1 = ( X X ) 1 ( M ^ x u M ^ x u ) ( X X ) 1 var ( β ^ ) ^ = i = 1 n x i x i 1 i = 1 n u ^ i 2 x i x i i = 1 n x i x i 1 = X X 1 M ^ x u M ^ x u X X 1 {:[ widehat(var(( hat(beta))))=(sum_(i=1)^(n)x_(i)^(')x_(i))^(-1)sum_(i=1)^(n) hat(u)_(i)^(2)x_(i)^(')x_(i)(sum_(i=1)^(n)x_(i)^(')x_(i))^(-1)],[=(X^(')X)^(-1)( widehat(M)_(xu)^(') widehat(M)_(xu))(X^(')X)^(-1)]:}\begin{aligned} \widehat{\operatorname{var}(\hat{\beta})} & =\left(\sum_{i=1}^{n} x_{i}^{\prime} x_{i}\right)^{-1} \sum_{i=1}^{n} \hat{u}_{i}^{2} x_{i}^{\prime} x_{i}\left(\sum_{i=1}^{n} x_{i}^{\prime} x_{i}\right)^{-1} \\ & =\left(X^{\prime} X\right)^{-1}\left(\widehat{M}_{x u}^{\prime} \widehat{M}_{x u}\right)\left(X^{\prime} X\right)^{-1} \end{aligned}
Here X X XX is the n × ( k + 1 ) n × ( k + 1 ) n xx(k+1)n \times(k+1) data matrix of regressors including the constant and M x u M x u M_(xu)M_{x u} is obtained by multiplying matrix X X XX with u u uu observation by observation. In other words multiply x i x i x_(i)x_{i} by u i u i u_(i)u_{i} and stack for n observations to make n × ( k + 1 ) n × ( k + 1 ) n xx(k+1)n \times(k+1) matrix. M ^ x u M ^ x u widehat(M)_(xu)\widehat{M}_{x u} is obtained by replacing u u uu with u ^ u ^ hat(u)\hat{u} in M x u M x u M_(xu)M_{x u}. The variance estimator that adjusts for the degrees of freedom would be
这里 X X XX 是包含常数项的 n × ( k + 1 ) n × ( k + 1 ) n xx(k+1)n \times(k+1) 回归变量数据矩阵, M x u M x u M_(xu)M_{x u} 是通过逐观测点将矩阵 X X XX u u uu 相乘得到的。换句话说,将 x i x i x_(i)x_{i} 乘以 u i u i u_(i)u_{i} ,并对 n 个观测值进行堆叠,形成 n × ( k + 1 ) n × ( k + 1 ) n xx(k+1)n \times(k+1) 矩阵。 M ^ x u M ^ x u widehat(M)_(xu)\widehat{M}_{x u} 是通过将 M x u M x u M_(xu)M_{x u} 中的 u u uu 替换为 u ^ u ^ hat(u)\hat{u} 得到的。调整自由度后的方差估计量为
var ( β ^ ) ^ = n n k 1 ( i = 1 n x i x i ) 1 i = 1 n u ^ i 2 x i x i ( i = 1 n x i x i ) 1 = n n k 1 ( X X ) 1 ( M ^ x u M ^ x u ) ( X X ) 1 var ( β ^ ) ^ = n n k 1 i = 1 n x i x i 1 i = 1 n u ^ i 2 x i x i i = 1 n x i x i 1 = n n k 1 X X 1 M ^ x u M ^ x u X X 1 {:[ widehat(var(( hat(beta))))=(n)/(n-k-1)(sum_(i=1)^(n)x_(i)^(')x_(i))^(-1)sum_(i=1)^(n) hat(u)_(i)^(2)x_(i)^(')x_(i)(sum_(i=1)^(n)x_(i)^(')x_(i))^(-1)],[=(n)/(n-k-1)(X^(')X)^(-1)( widehat(M)_(xu)^(') widehat(M)_(xu))(X^(')X)^(-1)]:}\begin{aligned} \widehat{\operatorname{var}(\hat{\beta})} & =\frac{n}{n-k-1}\left(\sum_{i=1}^{n} x_{i}^{\prime} x_{i}\right)^{-1} \sum_{i=1}^{n} \hat{u}_{i}^{2} x_{i}^{\prime} x_{i}\left(\sum_{i=1}^{n} x_{i}^{\prime} x_{i}\right)^{-1} \\ & =\frac{n}{n-k-1}\left(X^{\prime} X\right)^{-1}\left(\widehat{M}_{x u}^{\prime} \widehat{M}_{x u}\right)\left(X^{\prime} X\right)^{-1} \end{aligned}
By construction, both of the above variance estimators would be consistent. Based on the above asymptotic distribution, the remaining part would be defining the matrix that picks out the relevant expression of interest which is reflected in the null and alternative hypothesis.
根据构造,上述两种方差估计量都是一致的。基于上述渐近分布,剩下的部分是定义用于提取感兴趣表达式的矩阵,这一点在原假设和备择假设中有所体现。

Single Restriction : t t t\mathbf{t} statistic based on robust standard error
单一限制:基于稳健标准误的 t t t\mathbf{t} 统计量

Example 1  示例 1

Suppose that MLR1-MLR4 are satisfied in the following model:
假设以下模型满足 MLR1-MLR4 条件:
lwage = β 0 + β 1 j c + β 2 u n i v + β 3 exper + u  lwage  = β 0 + β 1 j c + β 2 u n i v + β 3  exper  + u " lwage "=beta_(0)+beta_(1)jc+beta_(2)univ+beta_(3)" exper "+u\text { lwage }=\beta_{0}+\beta_{1} j c+\beta_{2} u n i v+\beta_{3} \text { exper }+u
Suppose that you are interested in whether the experience affects wage with education held fixed.
假设你关心在教育水平固定的情况下,经验是否影响工资。
H 0 : β 3 = 0 H 1 : β 3 0 H 0 : β 3 = 0 H 1 : β 3 0 H_(0):beta_(3)=0quadH_(1):beta_(3)!=0H_{0}: \beta_{3}=0 \quad H_{1}: \beta_{3} \neq 0
What would be the relevant matrix that picks β 3 β 3 beta_(3)\beta_{3} once multiplied to the β ^ β ^ hat(beta)\hat{\beta} vector?
什么矩阵乘以 β ^ β ^ hat(beta)\hat{\beta} 向量后会得到 β 3 β 3 beta_(3)\beta_{3}
R = [ 0 0 0 1 ] R = 0      0      0      1 R=[[0,0,0,1]]R=\left[\begin{array}{llll} 0 & 0 & 0 & 1 \end{array}\right]
so that  使得
R β = β 3 R β = β 3 R beta=beta_(3)R \beta=\beta_{3}

OPTIONAL  可选

Therefore the relevant asymptotic distribution we are interested in would be
因此,我们感兴趣的相关渐近分布是
R ( β ^ β ) R N ( 0 k + 1 , 1 n E [ x i x i ] 1 E [ u i 2 x i x i ] E [ x i x i ] 1 ) = N ( 0 k + 1 , 1 n R E [ x i x i ] 1 E [ u i 2 x i x i ] E [ x i x i ] 1 R ) β ^ 3 β 3 N ( 0 , [ 1 n R E [ x i x i ] 1 E [ u i 2 x i x i ] E [ x i x i ] 1 R ] ) t = β ^ 3 R n n k 1 ( X X ) 1 ( M ^ x u M ^ x u ) ( X X ) 1 R a N ( 0 , 1 ) W = β ^ 3 [ R n n k 1 ( X X ) 1 ( M ^ x u M ^ x u ) ( X X ) 1 R ] 1 β ^ 3 a χ 1 2 F = W q = W 1 = W a F 1 , R ( β ^ β ) R N 0 k + 1 , 1 n E x i x i 1 E u i 2 x i x i E x i x i 1 = N 0 k + 1 , 1 n R E x i x i 1 E u i 2 x i x i E x i x i 1 R β ^ 3 β 3 N 0 , 1 n R E x i x i 1 E u i 2 x i x i E x i x i 1 R t = β ^ 3 R n n k 1 X X 1 M ^ x u M ^ x u X X 1 R a N ( 0 , 1 ) W = β ^ 3 R n n k 1 X X 1 M ^ x u M ^ x u X X 1 R 1 β ^ 3 a χ 1 2 F = W q = W 1 = W a F 1 , {:[R( hat(beta)-beta)∼RN(0_(k+1),(1)/(n)E[x_(i)^(')x_(i)]^(-1)E[u_(i)^(2)x_(i)^(')x_(i)]E[x_(i)^(')x_(i)]^(-1))],[=N(0_(k+1),(1)/(n)RE[x_(i)^(')x_(i)]^(-1)E[u_(i)^(2)x_(i)^(')x_(i)]E[x_(i)^(')x_(i)]^(-1)R^('))],[ hat(beta)_(3)-beta_(3)∼N(0,sqrt([(1)/(n)RE[x_(i)^(')x_(i)]^(-1)E[u_(i)^(2)x_(i)^(')x_(i)]E[x_(i)^(')x_(i)]^(-1)R^(')]))],[t=( hat(beta)_(3))/(sqrt(R(n)/(n-k-1)(X^(')X)^(-1)( widehat(M)_(xu)^(') widehat(M)_(xu))(X^(')X)^(-1)R^(')))∼^(a)N(0","1)],[W= hat(beta)_(3)[R(n)/(n-k-1)(X^(')X)^(-1)( widehat(M)_(xu)^(') widehat(M)_(xu))(X^(')X)^(-1)R^(')]^(-1) hat(beta)_(3)∼^(a)chi_(1)^(2)],[F=(W)/(q)=(W)/(1)=W∼^(a)F_(1,oo)]:}\begin{aligned} R(\hat{\beta}-\beta) & \sim R N\left(0_{k+1}, \frac{1}{n} E\left[x_{i}^{\prime} x_{i}\right]^{-1} E\left[u_{i}^{2} x_{i}^{\prime} x_{i}\right] E\left[x_{i}^{\prime} x_{i}\right]^{-1}\right) \\ & =N\left(0_{k+1}, \frac{1}{n} R E\left[x_{i}^{\prime} x_{i}\right]^{-1} E\left[u_{i}^{2} x_{i}^{\prime} x_{i}\right] E\left[x_{i}^{\prime} x_{i}\right]^{-1} R^{\prime}\right) \\ \hat{\beta}_{3}-\beta_{3} & \sim N\left(0, \sqrt{\left[\frac{1}{n} R E\left[x_{i}^{\prime} x_{i}\right]^{-1} E\left[u_{i}^{2} x_{i}^{\prime} x_{i}\right] E\left[x_{i}^{\prime} x_{i}\right]^{-1} R^{\prime}\right]}\right) \\ t & =\frac{\hat{\beta}_{3}}{\sqrt{R \frac{n}{n-k-1}\left(X^{\prime} X\right)^{-1}\left(\widehat{M}_{x u}^{\prime} \widehat{M}_{x u}\right)\left(X^{\prime} X\right)^{-1} R^{\prime}}} \stackrel{a}{\sim} N(0,1) \\ W & =\hat{\beta}_{3}\left[R \frac{n}{n-k-1}\left(X^{\prime} X\right)^{-1}\left(\widehat{M}_{x u}^{\prime} \widehat{M}_{x u}\right)\left(X^{\prime} X\right)^{-1} R^{\prime}\right]^{-1} \hat{\beta}_{3} \stackrel{a}{\sim} \chi_{1}^{2} \\ F & =\frac{W}{q}=\frac{W}{1}=W \stackrel{a}{\sim} F_{1, \infty} \end{aligned}

Use coef() function  使用 coef() 函数

data(twoyear)
fit=lm(lwage~jc+univ+exper,data=twoyear)
# summary provides non robust SE
summary(fit)
Call:
lm(formula = lwage ~ jc + univ + exper, data = twoyear)
Residuals:
\begin{tabular}{rrrrr} 
Min & \(1 Q\) & Median & \(3 Q\) & Max \\
-2.10362 & -0.28132 & 0.00551 & 0.28518 & 1.78167
\end{tabular}
Coefficients:
        Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.4723256 0.0210602 69.910 <2e-16 ***
jc 0.0666967 0.0068288 9.767 <2e-16 ***
univ 0.0768762 0.0023087 33.298 <2e-16 ***
exper 0.0049442 0.0001575 31.397 <2e-16 ***
Signif. codes: 0 '***'
显著性代码:0 '***'
0.001 '**' '*' '.' 0.1 1
Residual standard error:
残差标准误差:
0.4301 on  0.4301 开启 6759 gr   freedom  自由
Multiple R-squared:  多重 R 平方: 0.2224, Adjusted  调整后 R-squared:  决定系数: 0.2221
F-statistic: 644.5 on 3
F 统计量:644.5,3 个自由度
and 6759  和 6759 DF, ue: 2.2 e-16
# est provides rob
coeftest (fit, vcov=vcovHC(fit, type="HC1"))
jc 0.0666967 0.0068288 9.767 <2e-16 *** univ 0.0768762 0.0023087 33.298 <2e-16 *** exper 0.0049442 0.0001575 31.397 <2e-16 *** Signif. codes: 0 '***' 0.001 '**' '*' '.' 0.1 1 Residual standard error: 0.4301 on 6759 gr freedom Multiple R-squared: 0.2224, Adjusted R-squared: 0.2221 F-statistic: 644.5 on 3 and 6759 DF, ue: 2.2 e-16 # est provides rob coeftest (fit, vcov=vcovHC(fit, type="HC1")) | jc | 0.0666967 | 0.0068288 | 9.767 | <2e-16 | *** | | | | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | univ | 0.0768762 | 0.0023087 | 33.298 | <2e-16 | *** | | | | exper | 0.0049442 | 0.0001575 | 31.397 | <2e-16 | *** | | | | | Signif. codes: 0 '***' | 0.001 | '**' | '*' | '.' | 0.1 | 1 | | Residual standard error: | | 0.4301 on | 6759 | gr | | freedom | | | | Multiple R-squared: | 0.2224, | Adjusted | R-squared: | | 0.2221 | | | | F-statistic: 644.5 on 3 | and 6759 | DF, | ue: | 2.2 | e-16 | | | # | est provides | rob | | | | | | | coeftest (fit, vcov=vcovHC(fit, type="HC1")) | | | | | | | |
t test of coefficients:
系数的 t 检验:
Estimate Std. Error t value Pr(>|t|)
估计值 标准误差 t 值 Pr(>|t|)
(Intercept)  (截距) 1.4723256 0.0216562 67.986 < ***
jc 0.066 0.0065043 10.254 < ***
univ 0.076 0.0023610 32.562 < 2.2 e 16 2.2 e 16 2.2e-162.2 \mathrm{e}-16 ***
exper 0.0049442 0.0001599 30.921 < 2.2 e 16 2.2 e 16 2.2e-162.2 \mathrm{e}-16 ***
Signif.  显著性 codes:  代码: '***' '**' '*' ' 0.1 '
Estimate Std. Error t value Pr(>|t|) (Intercept) 1.4723256 0.0216562 67.986 < *** jc 0.066 0.0065043 10.254 < *** univ 0.076 0.0023610 32.562 < 2.2e-16 *** exper 0.0049442 0.0001599 30.921 < 2.2e-16 *** Signif. codes: '***' '**' '*' ' 0.1 '| Estimate Std. Error t value Pr(>\|t|) | | | | | | | | | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | (Intercept) | 1.4723256 | 0.0216562 | 67.986 | < | *** | | | | jc | 0.066 | 0.0065043 | 10.254 | < | *** | | | | univ | 0.076 | 0.0023610 | 32.562 | < | $2.2 \mathrm{e}-16$ | *** | | | exper | 0.0049442 | 0.0001599 | 30.921 | < | $2.2 \mathrm{e}-16$ | *** | | | Signif. | codes: | '***' | '**' | '*' | ' | 0.1 | ' |

Use glht() function  使用 glht() 函数

t_test=glht(fit,linfct =c("exper=0"),vCov=vcovHC(fit, type="HC1"))
summary(t_test)
    Simultaneous Tests for General Linear Hypotheses
Fit: lm(formula = lwage ~ jc + univ + exper, data = twoyear)
Linear Hypotheses:  线性假设:
    Estimate Std. Error t value Pr(>|t|)
exper == 0 0.0049442 0.0001599 30.92 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Adjusted p values reported -- single-step method)
t_test2=glht(fit,linfct =matrix(c(0,0,0,1),nrow=1,ncol=4),vcov=vcovHC(fit, type="HC1"))
summary(t_test2)
    Simultaneous Tests for General Linear Hypotheses
Fit: lm(formula = lwage ~ jc + univ + exper, data = twoyear)
Linear Hypotheses:
    Estimate Std. Error t value Pr (>|t|)
1 == 0 0.0049442 0.0001599 30.92 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Adjusted p values reported -- single-step method)

Use linearHypothesis() function
使用 linearHypothesis() 函数

#computes F
f_result=linearHypothesis(fit,c("exper=0"),vcov=vcovHC(fit, type="HC1"),test="F")
f_result
Linear hypothesis test
Hypothesis:
exper = 0
Model 1: restricted model
Model 2: lwage ~ jc + univ + exper
Note: Coefficient covariance matrix supplied.
    Res.Df Df F Pr(>F)
1 6760
2 6759 1 956.12 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
When there is single restriction,
当只有一个限制时,
t 2 = W = F χ 1 2 = F 1 , t N ( 0 , 1 ) t 2 = W = F χ 1 2 = F 1 , t N ( 0 , 1 ) {:[t^(2)=W=F∼chi_(1)^(2)=F_(1,oo)],[t∼N(0","1)]:}\begin{aligned} & t^{2}=W=F \sim \chi_{1}^{2}=F_{1, \infty} \\ & t \sim N(0,1) \end{aligned}
and we can verify the relationship.
我们可以验证该关系。

Example 2  示例 2

Suppose that MLR1-MLR4 are satisfied in the following model:
假设在以下模型中满足 MLR1-MLR4:
lwage = β 0 + β 1 j c + β 2 u n i v + β 3 exper + u  lwage  = β 0 + β 1 j c + β 2 u n i v + β 3  exper  + u " lwage "=beta_(0)+beta_(1)jc+beta_(2)univ+beta_(3)" exper "+u\text { lwage }=\beta_{0}+\beta_{1} j c+\beta_{2} u n i v+\beta_{3} \text { exper }+u
Suppose that you are interested in whether the experience affects wage with education held fixed.
假设你关心在教育水平固定的情况下,工作经验是否影响工资。
H 0 : β 1 β 2 = 0 H 1 : β 1 β 2 0 H 0 : β 1 β 2 = 0 H 1 : β 1 β 2 0 H_(0):beta_(1)-beta_(2)=0quadH_(1):beta_(1)-beta_(2)!=0H_{0}: \beta_{1}-\beta_{2}=0 \quad H_{1}: \beta_{1}-\beta_{2} \neq 0
# recall that fit$coefficients vcov_beta_hat are already obtained above
linearHypothesis(fit,c("jc-univ=0"),vcov=vcovHC(fit,type="HC1"))
Linear hypothesis test
线性假设检验
Hypothesis:  假设:
jc - univ = 0
Model 1: restricted model
模型 1:受限模型

Model 2: lwage ~ jc + univ + exper
模型 2:lwage ~ jc + univ + exper
Note: Coefficient covariance matrix supplied.
注:提供了系数协方差矩阵。
    Res.Df Df F Pr(>F)
1 6760
2 6759 1 2.3452 0.1257
R=matrix(c(0,1,-1,0),nrow=1,ncol=4)
linearHypothesis(fit, hypothesis.matrix=R,vCov=vcovHC(fit,type="HC1"))
Linear hypothesis test  线性假设检验
Hypothesis:  假设:
jc - univ = 0
Model 1: restricted model
模型 1:受限模型

Model 2: lwage ~ jc + univ + exper
模型 2:lwage ~ jc + univ + exper

Note: Coefficient covariance matrix supplied.
注意:提供了系数协方差矩阵。
    Res.Df Df F Pr(>F)
1 6760
2 6759 1 2.3452 0.1257
test_r=glht(fit,linfct=R,vcov=vcovHC(fit,type="HC1"))
summary(test_r)
Simultaneous Tests for General Linear Hypotheses
Fit: lm(formula = lwage ~ jc + univ + exper, data = twoyear)
拟合:lm(公式 = lwage ~ jc + univ + exper,数据 = twoyear)

Linear Hypotheses:  线性假设:
Estimate Std. Error t t tt value Pr ( > | t | ) Pr ( > | t | ) Pr( > |t|)\operatorname{Pr}(>|t|)
估计值 标准误差 t t tt Pr ( > | t | ) Pr ( > | t | ) Pr( > |t|)\operatorname{Pr}(>|t|)

1 == 0 0.010180 0.006647 1.531 0.126 1 == 0 0.010180 0.006647 1.531 0.126 1==0-0.010180quad0.006647quad-1.531quad0.1261==0-0.010180 \quad 0.006647 \quad-1.531 \quad 0.126
(Adjusted p values reported – single-step method)
(报告的调整后 p 值——单步法)

Joint Hypothesis Test  联合假设检验

Suppose that you are interested in whether the education affects wage or not once experience is controlled:
假设你关心在控制了经验后,教育是否影响工资:
H 0 : β 1 = β 2 = 0 H 1 : otherwise. H 0 : β 1 = β 2 = 0 H 1 :  otherwise.  H_(0):beta_(1)=beta_(2)=0quadH_(1):" otherwise. "H_{0}: \beta_{1}=\beta_{2}=0 \quad H_{1}: \text { otherwise. }
W = ( R β ^ ) [ R × ( X X ) 1 ( M ^ x u M ^ x u ) ( X X ) 1 × R ] 1 ( R β ^ ) a χ 2 2 F = W 2 a F 2 , W = ( R β ^ ) R × X X 1 M ^ x u M ^ x u X X 1 × R 1 ( R β ^ ) a χ 2 2 F = W 2 a F 2 , {:[W=(R hat(beta))^(')[R xx(X^(')X)^(1)( widehat(M)_(xu)^(') widehat(M)_(xu))(X^(')X)^(1)xxR^(')]^(-1)(R hat(beta))∼^(a)chi_(2)^(2)],[F=(W)/(2)∼^(a)F_(2,oo)]:}\begin{aligned} W & =(R \hat{\beta})^{\prime}\left[R \times\left(X^{\prime} X\right)^{1}\left(\widehat{M}_{x u}^{\prime} \widehat{M}_{x u}\right)\left(X^{\prime} X\right)^{1} \times R^{\prime}\right]^{-1}(R \hat{\beta}) \stackrel{a}{\sim} \chi_{2}^{2} \\ F & =\frac{W}{2} \stackrel{a}{\sim} F_{2, \infty} \end{aligned}
What would be the F statistic?
F 统计量是多少?
'F with built-in function'
[1] "F with built-in function"
linearHypothesis(fit,c("univ=0","jc=0"),vcov=vcovHC(fit,type="HC1"),test="F")
Linear hypothesis test
Hypothesis:
univ = 0
jc = 0
Model 1: restricted model
Model 2: lwage ~ jc + univ + exper
Note: Coefficient covariance matrix supplied.
    Res.Df Df F Pr(>F)
1 6761
2 6759 2 550.5 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
'Below is not the correct way of doing the hypothesis where the F statistic is computed using
[1] "Below is not the correct way of doing the hypothesis where the F statistic is computed us
linearHypothesis(fit,c("univ=0","jc=0"),test="F")
Linear hypothesis test
Hypothesis:
univ = 0
jc = 0
Model 1: restricted model
Model 2: lwage ~ jc + univ + exper
    Res.Df RSS Df Sum of Sq F Pr(>F)
1 6761 1461.8
2 6759 1250.5 2 211.23 570.84 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# below three scripts produces the same results.
null_mat=matrix(c(0,1,0,0,0,0,1,0),nrow=2,ncol=4,byrow=TRUE)
null_mat
\begin{tabular}{lrrrr} 
& {\([, 1]\)} & {\([, 2]\)} & {\([, 3]\)} & {\([, 4]\)} \\
{\([1]\),} & 0 & 1 & 0 & 0 \\
{\([2]\),} & 0 & 0 & 1 & 0
\end{tabular}
data(twoyear)
fit=lm(lwage~jc+univ+exper,data=twoyear)
linearHypothesis(fit,c("univ=0","jc=0"),vcov=vcovHC(fit,type="HC1"),test="F")
Linear hypothesis test
线性假设检验
Hypothesis:
univ = 0
jc = 0
Model 1: restricted model
Model 2: lwage ~ jc + univ + exper
Note: Coefficient covariance matrix supplied.
注意:提供了系数协方差矩阵。
    Res.Df Df F Pr(>F)
1 6761
2 6759 2 550.5 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
linearHypothesis(fit,hypothesis.matrix=null_mat,test="F", vcov=vcovHC(fit,type="HC1"))
Linear hypothesis test
Hypothesis:  假设:
јс = 0 = 0 =0=0
univ = 0
Model 1: restricted model
模型 1:受限模型

Model 2: lwage ~ jc + univ + exper
模型 2:lwage ~ jc + univ + exper

Note: Coefficient covariance matrix supplied.
注:提供了系数协方差矩阵。
Res.Df Df F Pr(>F)
1 6761
2 6759 2 550.5 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
linearHypothesis(fit,hypothesis.matrix=null_mat,test="F", white.adjust="hc1")
Linear hypothesis test
Hypothesis:
jc = 0
univ = 0
Model 1: restricted model
Model 2: lwage ~ jc + univ + exper
Note: Coefficient covariance matrix supplied.
    Res.Df Df F Pr(>F)
1 6761
2 6759 2 550.5 < 2.2e-16 ***
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
'optional'
[1] "optional"
'Wald with built-in function'
[1] "Wald with built-in function"
linearHypothesis(fit,c("univ=0","jc=0"),vcov=vcovHC(fit,type="HC1"),test="Chisq")
Linear hypothesis test
Hypothesis:
univ = 0
jc = 0
Model 1: restricted model
Model 2: lwage ~ jc + univ + exper
Note: Coefficient covariance matrix supplied.
    Res.Df Df Chisq Pr(>Chisq)
1 6761
2 6759 2 1101 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1