温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。
冀云阳 (广东财经大学,Dufejyy@163.com)
贺 旭 (中央财经大学)
目录
OLS 有一个经典的假设:解释变量与随机误差项不相关,即
工具变量 (IV) 法为解决「内生解释变量」问题提供了一种可行的方法。为此,我们需要找到满足以下条件的「外生解释变量 (
根据「内生解释变量」与「工具变量」间的数量关系,又可以分为以下几种情况:
在「恰好识别」的情况下,我们可以估计
值得注意, 2SLS 只有在「同方差」的情况下才是最优效率的,而在「过度识别」和「异方差」的情况下,广义矩估计 (Generalized Method of Moments, GMM) 才是最有效率的。关于 GMM 介绍详见:「Stata:GMM 简介及实现范例」和「GMM 简介与 Stata 实现」。
在使用工具变量之前,我们仍需进行若干检验:
在「恰好识别」的情况下,我们无法检验工具变量的外生性,只能进行「定性讨论或依赖专家意见」,详见「IV-估计:工具变量不外生时也可以用!」。因此,我们重点关注「过度识别检验」的方法和在 Stata 中实现。
温馨提示: 文中链接在微信中无法生效。请点击底部「阅读原文」。
假设共有
同时,假设共有
由于「扰动项
则原假设可写为:
记辅助回归的可决系数为
其中,Sargan 统计量的渐进分布为
Note:本部分内容摘自「陈强等. 计量经济学及 Stata 应用[M]. 高等教育出版社, 2015.」,详见 200 页。
在「同方差」假设下,2SLS 是最有效率的,而在「过度识别且存在异方差」情况下,GMM 更有效率。
考虑以下原假设:
其实,这就是检验总体矩条件是否成立:
与总体矩条件
将上式看成一个联立方程组,未知参数
在过度识别的情况下,Hansen (1982) 提出了一种可行的方案:虽然无法找到
更一般地,可以用一个「权重矩阵
其中,因子
实际上,GMM 估计量的目标函数
其中,
Note:本部分内容摘自「陈强. 高级计量经济学及 Stata 应用[M]. 高等教育出版社, 2014.」,详见 146-150 页。同时,也参考了「工具变量法(四):GMM」。
如果过度识别检验拒绝了「所有工具变量都外生」的原假设,则可以怀疑部分工具变量不满足外生性。假设在
其中,
Note:本部分内容参考「陈强. 高级计量经济学及 Stata 应用[M]. 高等教育出版社, 2014.」,详见 150、298-299 页。
温馨提示: 文中链接在微信中无法生效。请点击底部「阅读原文」。
以官方 griliches76.dta
数据为例,lw 为工资对数,s 为受教育年限,expr 为工龄,tenure 为现单位工作年数,rns 为美国南方虚拟变量 (住在南方 = 1),smsa 为大城市虚拟变量 (住在大城市 = 1),iq 为智商,med 为母亲受教育年限,kww 为一项职业测试成绩 (score on knowledge in world of work test),age 为年龄,mrt 为婚姻状况 (已婚 = 1)。
在研究「智商」对「工资」的影响时,「智商」通常会被认为是一个内生的解释变量,因此我们需要为「智商」寻找工具变量。当然外生解释变量可以被看作自身的工具变量。在这里,我们将母亲受教育年限 (med)、职业测试成绩 (kww)、年龄 (age) 和婚姻状况 (mrt)作为「智商」的工具变量,并进行「过度识别」检验。
在使用 ivreg2
命令进行工具变量回归时,默认提供 Sargan 统计量,而在命令后加入 robust
、bw
、cluster
等选项时,Stata 默认提供 Hansen J 统计量。若要报告 orthog(varlist_ex)
选项,其中 varlist_ex
为需要检验外生性的变量。关于 ivreg2
更多介绍,详见 help ivreg2
。
*-安装命令
ssc install ivreg2, replace
*-Sargan 检验
use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
ivreg2 lw s expr tenure rns smsa i.year (iq=med kww age mrt)
*-Hansen J 检验
ivreg2 lw s expr tenure rns smsa i.year (iq=med kww age mrt), robust
*-C 统计量
ivreg2 lw s expr tenure rns smsa i.year (iq=med kww age mrt), orthog(s)
. *-Sargan 检验
. use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
(Wages of Very Young Men, Zvi Griliches, J.Pol.Ec. 1976)
. ivreg2 lw s expr tenure rns smsa i.year (iq=med kww age mrt)
IV (2SLS) estimation
--------------------
Estimates efficient for homoskedasticity only
Statistics consistent for homoskedasticity only
Number of obs = 758
F( 12, 745) = 45.91
Prob > F = 0.0000
Total (centered) SS = 139.2861498 Centered R2 = 0.4255
Total (uncentered) SS = 24652.24662 Uncentered R2 = 0.9968
Residual SS = 80.0182337 Root MSE = .3249
------------------------------------------------------------------------------
lw | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
iq | .0001747 .0039035 0.04 0.964 -.007476 .0078253
s | .0691759 .0129366 5.35 0.000 .0438206 .0945312
expr | .029866 .0066393 4.50 0.000 .0168533 .0428788
tenure | .0432738 .0076271 5.67 0.000 .0283249 .0582226
rns | -.1035897 .029481 -3.51 0.000 -.1613715 -.0458079
smsa | .1351148 .0266573 5.07 0.000 .0828674 .1873623
|
year |
67 | -.052598 .0476924 -1.10 0.270 -.1460734 .0408774
68 | .0794686 .0447194 1.78 0.076 -.0081797 .1671169
69 | .2108962 .0439336 4.80 0.000 .1247878 .2970045
70 | .2386338 .0509733 4.68 0.000 .1387281 .3385396
71 | .2284609 .0437436 5.22 0.000 .1427251 .3141967
73 | .3258944 .0407181 8.00 0.000 .2460884 .4057004
|
_cons | 4.39955 .2685443 16.38 0.000 3.873213 4.925887
------------------------------------------------------------------------------
Underidentification test (Anderson canon. corr. LM statistic): 52.436
Chi-sq(4) P-val = 0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic): 13.786
Stock-Yogo weak ID test critical values: 5% maximal IV relative bias 16.85
10% maximal IV relative bias 10.27
20% maximal IV relative bias 6.71
30% maximal IV relative bias 5.34
10% maximal IV size 24.58
15% maximal IV size 13.96
20% maximal IV size 10.26
25% maximal IV size 8.31
Source: Stock-Yogo (2005). Reproduced by permission.
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments): 87.655
Chi-sq(3) P-val = 0.0000
------------------------------------------------------------------------------
Instrumented: iq
Included instruments: s expr tenure rns smsa 67.year 68.year 69.year 70.year
71.year 73.year
Excluded instruments: med kww age mrt
------------------------------------------------------------------------------
*-Hansen J 检验
. ivreg2 lw s expr tenure rns smsa i.year (iq=med kww age mrt), robust
IV (2SLS) estimation
--------------------
Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity
Number of obs = 758
F( 12, 745) = 46.94
Prob > F = 0.0000
Total (centered) SS = 139.2861498 Centered R2 = 0.4255
Total (uncentered) SS = 24652.24662 Uncentered R2 = 0.9968
Residual SS = 80.0182337 Root MSE = .3249
------------------------------------------------------------------------------
| Robust
lw | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
iq | .0001747 .0041241 0.04 0.966 -.0079085 .0082578
s | .0691759 .0132907 5.20 0.000 .0431266 .0952253
expr | .029866 .0066974 4.46 0.000 .0167394 .0429926
tenure | .0432738 .0073857 5.86 0.000 .0287981 .0577494
rns | -.1035897 .029748 -3.48 0.000 -.1618947 -.0452847
smsa | .1351148 .026333 5.13 0.000 .0835032 .1867265
|
year |
67 | -.052598 .0457261 -1.15 0.250 -.1422195 .0370235
68 | .0794686 .0428231 1.86 0.063 -.0044631 .1634003
69 | .2108962 .0408774 5.16 0.000 .1307779 .2910144
70 | .2386338 .0529825 4.50 0.000 .1347901 .3424776
71 | .2284609 .0426054 5.36 0.000 .1449558 .311966
73 | .3258944 .0405569 8.04 0.000 .2464044 .4053844
|
_cons | 4.39955 .290085 15.17 0.000 3.830994 4.968106
------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic): 41.537
Chi-sq(4) P-val = 0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic): 13.786
(Kleibergen-Paap rk Wald F statistic): 12.167
Stock-Yogo weak ID test critical values: 5% maximal IV relative bias 16.85
10% maximal IV relative bias 10.27
20% maximal IV relative bias 6.71
30% maximal IV relative bias 5.34
10% maximal IV size 24.58
15% maximal IV size 13.96
20% maximal IV size 10.26
25% maximal IV size 8.31
Source: Stock-Yogo (2005). Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments): 74.165
Chi-sq(3) P-val = 0.0000
------------------------------------------------------------------------------
Instrumented: iq
Included instruments: s expr tenure rns smsa 67.year 68.year 69.year 70.year
71.year 73.year
Excluded instruments: med kww age mrt
------------------------------------------------------------------------------
. *-C 统计量
. ivreg2 lw s expr tenure rns smsa i.year (iq=med kww age mrt), orthog(age)
IV (2SLS) estimation
--------------------
Estimates efficient for homoskedasticity only
Statistics consistent for homoskedasticity only
Number of obs = 758
F( 12, 745) = 45.91
Prob > F = 0.0000
Total (centered) SS = 139.2861498 Centered R2 = 0.4255
Total (uncentered) SS = 24652.24662 Uncentered R2 = 0.9968
Residual SS = 80.0182337 Root MSE = .3249
------------------------------------------------------------------------------
lw | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
iq | .0001747 .0039035 0.04 0.964 -.007476 .0078253
s | .0691759 .0129366 5.35 0.000 .0438206 .0945312
expr | .029866 .0066393 4.50 0.000 .0168533 .0428788
tenure | .0432738 .0076271 5.67 0.000 .0283249 .0582226
rns | -.1035897 .029481 -3.51 0.000 -.1613715 -.0458079
smsa | .1351148 .0266573 5.07 0.000 .0828674 .1873623
|
year |
67 | -.052598 .0476924 -1.10 0.270 -.1460734 .0408774
68 | .0794686 .0447194 1.78 0.076 -.0081797 .1671169
69 | .2108962 .0439336 4.80 0.000 .1247878 .2970045
70 | .2386338 .0509733 4.68 0.000 .1387281 .3385396
71 | .2284609 .0437436 5.22 0.000 .1427251 .3141967
73 | .3258944 .0407181 8.00 0.000 .2460884 .4057004
|
_cons | 4.39955 .2685443 16.38 0.000 3.873213 4.925887
------------------------------------------------------------------------------
Underidentification test (Anderson canon. corr. LM statistic): 52.436
Chi-sq(4) P-val = 0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic): 13.786
Stock-Yogo weak ID test critical values: 5% maximal IV relative bias 16.85
10% maximal IV relative bias 10.27
20% maximal IV relative bias 6.71
30% maximal IV relative bias 5.34
10% maximal IV size 24.58
15% maximal IV size 13.96
20% maximal IV size 10.26
25% maximal IV size 8.31
Source: Stock-Yogo (2005). Reproduced by permission.
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments): 87.655
Chi-sq(3) P-val = 0.0000
-orthog- option:
Sargan statistic (eqn. excluding suspect orthogonality conditions): 47.413
Chi-sq(2) P-val = 0.0000
C statistic (exogeneity/orthogonality of suspect instruments): 40.242
Chi-sq(1) P-val = 0.0000
Instruments tested: age
------------------------------------------------------------------------------
Instrumented: iq
Included instruments: s expr tenure rns smsa 67.year 68.year 69.year 70.year
71.year 73.year
Excluded instruments: med kww age mrt
------------------------------------------------------------------------------
可以看出,无论是「Sargan 检验」还是「Hansen J」检验都拒绝了「原假设:所有工具变量都外生」,表明存在一部分内生的工具变量。进一步,我们又构造了
以 mus08psidextract.dta
为例,该数据包含 595 名美国人 1976-1982 与工资相关的变量 (n = 595, T = 7),其中 lwage 为工资对数,wks 为工作周数,ms 为婚否,union 为是否由工会合同确定工资,occ 为是否是蓝领工人,south 为是否在美国南部,smsa 为是否住在大城市,ind 为是否在在制造业工作。
在使用 xtabond2
命令进行 GMM 回归时,Stata 同时提供 Sargan 检验、Hansen J 检验、以及
*-安装命令
ssc install xtabond2, replace
*-动态面板过度识别检验
sysuse mus08psidextract.dta, clear
xtabond2 lwage L(1/2).lwage L(0/1).wks ms union occ south smsa ind, \\\
gmm(lwage, lag(2 4)) gmm(wks ms union, lag(2 3)) \\\
iv(occ south smsa ind) nolevel twostep robust
上述命令中,L(1/2).lwage
表示 L1.wage L2.wage
,L(0/1).wks
表示 wks L1.wks
;gmm(lwage, lag(2 4))
表示使用 lwage 的 2-4 阶作为 GMM 式工具变量,gmm(wks ms union, lag(2 3))
表示使用 wks ms union 的 2-3 阶作为 GMM 式工具变量,iv(occ south smsa ind)
表示使用 occ south smsa ind 作为自身工具变量。
Dynamic panel-data estimation, two-step difference GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 2380
Time variable : t Number of groups = 595
Number of instruments = 39 Obs per group: min = 4
Wald chi2(10) = 1287.77 avg = 4.00
Prob > chi2 = 0.000 max = 4
------------------------------------------------------------------------------
| Corrected
lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lwage |
L1. | .611753 .0373491 16.38 0.000 .5385501 .6849559
L2. | .2409058 .0319939 7.53 0.000 .1781989 .3036127
|
wks |
--. | -.0159751 .0082523 -1.94 0.053 -.0321493 .000199
L1. | .0039944 .0027425 1.46 0.145 -.0013807 .0093695
|
ms | .1859324 .144458 1.29 0.198 -.0972 .4690649
union | -.1531329 .1677842 -0.91 0.361 -.4819839 .1757181
occ | -.0357509 .0347705 -1.03 0.304 -.1038999 .032398
south | -.0250368 .2150806 -0.12 0.907 -.446587 .3965134
smsa | -.0848223 .0525243 -1.61 0.106 -.187768 .0181235
ind | .0227008 .0424207 0.54 0.593 -.0604422 .1058437
------------------------------------------------------------------------------
Instruments for first differences equation
Standard
D.(occ south smsa ind)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(2/3).(wks ms union)
L(2/4).lwage
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -4.52 Pr > z = 0.000
Arellano-Bond test for AR(2) in first differences: z = -1.60 Pr > z = 0.109
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(29) = 59.55 Prob > chi2 = 0.001
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(29) = 39.88 Prob > chi2 = 0.086
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
gmm(lwage, lag(2 4))
Hansen test excluding group: chi2(18) = 23.59 Prob > chi2 = 0.169
Difference (null H = exogenous): chi2(11) = 16.29 Prob > chi2 = 0.131
gmm(wks ms union, lag(2 3))
Hansen test excluding group: chi2(5) = 6.43 Prob > chi2 = 0.266
Difference (null H = exogenous): chi2(24) = 33.44 Prob > chi2 = 0.095
iv(occ south smsa ind)
Hansen test excluding group: chi2(25) = 28.00 Prob > chi2 = 0.308
Difference (null H = exogenous): chi2(4) = 11.87 Prob > chi2 = 0.018
可以看出,工具变量总的个数为 39,而内生变量的个数为 10。同时,扰动项的差分存在一阶自相关,而不存在二阶自相关,故不能拒绝原假设「扰动项无自相关」,可以使用差分 GMM。
Sargan 统计量和 Hansen 统计量在 10% 的水平上都拒绝了「所有工具变量都外生」的原假设。值得注意的是,Sargan 统计量并不稳健,但不受工具变量过多的影响,而 Hansen 统计量虽然稳健,但受工具变量过多的影响。
关于
Note:本部分内容参考「陈强. 高级计量经济学及 Stata 应用[M]. 高等教育出版社, 2014.」,详见 150、298-299 页。同时,也参考了「Which test to see in Difference-in Hansen test, excluding or difference」。关于「动态面板模型」的介绍,详见「动态面板模型」。
温馨提示: 文中链接在微信中无法生效。请点击底部「阅读原文」。
在使用 ivreg2
命令进行估计时,我们经常会发现 Sargan 检验或 Hansen J 检验始终无法通过。这可能是由于「工具变量过多」造成的,如模型中控制了年份固定效应、地区固定效应和行业固定效应等虚拟变量。
但是,当「虚拟变量的个数 < (外生变量个数 + 工具变量个数)」时,正交条件对应的方差-协方差矩阵 help ivreg2
查看。
利用 Frisch-Waugh-Lovell (FWL) 定理,我们可以尝试「partial out」一定数量的外生变量 (通常主要是虚拟变量),以保证 ivreg2
命令执行 2SLS 或 GMM 估计时,我们可以加入 partial()
选项,选项中先填入所有外生的虚拟变量,如有必要,可以进一步加入其它外生的解释变量。
Note:关于「partial out」更多详细介绍,请参考 help ivreg2
。关于「Frisch-Waugh-Lovell (FWL)」定理的详细介绍,详见「Frisch-Waugh定理与部分回归图:图示多元线性回归的系数」。
温馨提示: 文中链接在微信中无法生效。请点击底部「阅读原文」。
接下来,以案例形式简要介绍「partial out」的原理。
sysuse "auto.dta", clear
rename (price length weight) (Y X1 X2)
ivregress 2sls Y X1 X2
est store m0 //原始结果
*-Partial out X2
ivregress 2sls Y X2 //从 y 中除去 X2 的影响
predict e_y, res
ivregress 2sls X1 X2 //从 X1 中除去 X2 的影响
predict e_x1, res
ivregress 2sls e_y e_x1 //partial out 后的的回归结果
est store m1
esttab m0 m1, nogap
restore
--------------------------------------------
(1) (2)
Y e_y
--------------------------------------------
X1 -97.96*
(-2.55)
X2 4.699***
(4.27)
e_x1 -97.96*
(-2.55)
_cons 10386.5* 2.04e-12
(2.46) (0.00)
--------------------------------------------
N 74 74
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
*-Notes:
(1) 如果采用 regress 进行回归,SE 会有微小差异,
主要是因为 regress 会针对小样本进行自由度调整。
(2) 采用 IV/GMM 估计,即 ivregress 命令就不会有这个问题了。
sysuse auto, clear
drop if rep78==.
global yx "price wei len mpg"
ivregress 2sls $yx i.rep78
est store m0
bysort rep78: center $yx, inplace //prefix(c_)
ivregress 2sls $yx
est store m1
esttab m0 m1, nogap nobase
restore
--------------------------------------------
(1) (2)
price price
--------------------------------------------
weight 5.187*** 5.187***
(4.74) (4.74)
length -124.2*** -124.2***
(-3.29) (-3.29)
mpg -126.8 -126.8
(-1.60) (-1.60)
2.rep78 1137.3
(0.67)
3.rep78 1254.6
(0.80)
4.rep78 2267.2
(1.42)
5.rep78 3850.8*
(2.29)
_cons 14614.5* 0.0000116
(2.52) (0.00)
--------------------------------------------
N 69 69
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
*-Note: FE 模型其实就是先 partial out 公司虚拟变量,然后再对转换后的数据执行 OLS 回归。
partial()
选项无影响以 Acem_data_done.dta
数据为例,进行演示说明:
*-数据下载地址
* https://gitee.com/arlionn/data/blob/master/data01/Acem_data_done.dta
use Acem_data_done.dta, clear
global y "change_gdp"
global x "change_dependency"
global z "devo1990 lpop1990 base_dependency" // 控制变量
global IVs "birthrate1960_1965 birthrate1965_1970 birthrate1970_1975 birthrate1975_1980 birthrate1980_1985 birthrate1985_1990"// 工具变量
ivregress 2sls $y ($x=$IVs) $z i.region_code, robust //官方命令
est store a1
ivreg2 $y ($x=$IVs) $z i.region_code, robust // 等价-外部命令
est store a2 // without -partial()- option
ivreg2 $y ($x=$IVs) $z i.region_code, robust ///
partial(lpop1990 i.region_code base_dependency)
est store c5 // with -partial()- option
*-手动计算:(特别注意:此时的 SE 是错误的!)
* Step1:
reg $x $IVs $z i.region_code
cap drop xhat
predict xhat
* Step2:
reg $y xhat $z i.region_code
est store a3
*-对比结果:
local m "a1 a2 c5 a3"
esttab `m' `s', nogap replace ///
b(%6.3f) s(N r2_a rkf j jp) ///
star(* 0.1 ** 0.05 *** 0.01) ///
order(change_dependency xhat) ///
indicate("Region Dummies =*.region_code") ///
addnotes("*** 1% ** 5% * 10%") nobase
----------------------------------------------------------------------------
(a1) (a2) (c5) (a3)
no-parital no-partial partial-out by-hand
CMD ivregress ivreg2 ivreg2 regress
----------------------------------------------------------------------------
change_dep~y 1.703*** 1.703*** 1.703***
(4.14) (4.14) (4.14)
xhat 1.703***
(3.80)
devo1990 -0.190*** -0.190*** -0.190*** -0.190***
(-4.22) (-4.22) (-4.22) (-4.58)
lpop1990 -0.017 -0.017 -0.017
(-0.83) (-0.83) (-0.96)
base_depen~y -0.041 -0.041 -0.041
(-0.14) (-0.14) (-0.13)
_cons 1.899*** 1.899*** 1.899***
(4.99) (4.99) (5.54)
Region Dum~s Yes Yes No Yes
----------------------------------------------------------------------------
N 169.000 169.000 169.000 169.000
r2_a 0.179 0.179 -0.024 0.261
rkf 19.365 19.365
j 4.280 4.280
jp 0.510 0.510
----------------------------------------------------------------------------
t statistics in parentheses, p<0.1, ** p<0.05, *** p<0.01
Notes:(1) a1 与 c5 结果完全相同,因此 partial out 部分变量不影响系数估计值;(2) partial out 的目的是为了减少干扰项的方差协方差矩阵
范例4:是否加入 partial
选项有显著影响
我们将通过下例来演示加入 partial
选项引起的变化。
use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, clear
ivreg2 lw s expr tenure rns smsa i.year (iq=med kww age), cluster(year)
执行完上述命令后,会出现如下提示,即由于矩条件的协方差矩阵非满秩,过度识别检验的结果无法显示。在此情况下,可筛除一些虚拟变量。
Warning: estimated covariance matrix of moment conditions not of full rank.overidentification statistic not reported, and standard errors and model tests should be interpreted with caution.
Possible causes: number of clusters insufficient to calculate robust covariance matrix singleton dummy variable (dummy with one 1 and N-1 0s or vice versa).
partial option may address problem.
下面利用 partial()
选项筛除年份虚拟变量后回归,即可呈现 Hansen J 的检验结果。
ivreg2 lw s expr tenure rns smsa i.year (iq=med kww age), cluster(year) partial(i.year)
温馨提示: 文中链接在微信中无法生效。请点击底部「阅读原文」。
连享会-直播课 上线了!
http://lianxh.duanshu.com
免费公开课:
直击面板数据模型 - 连玉君,时长:1小时40分钟 Stata 33 讲 - 连玉君, 每讲 15 分钟. 部分直播课 课程资料下载 (PPT,dofiles等)
支持回看,所有课程可以随时购买观看。
专题 | 嘉宾 | 直播/回看视频 |
---|---|---|
⭐ 最新专题 ⭐ | DSGE, 因果推断, 空间计量等 | |
⭕ Stata数据清洗 | 游万海 | 直播, 2 小时,已上线 |
研究设计 | 连玉君 | 我的特斯拉-实证研究设计,-幻灯片- |
面板模型 | 连玉君 | 动态面板模型,-幻灯片- |
面板模型 | 连玉君 | 直击面板数据模型 [免费公开课,2小时] |
Note: 部分课程的资料,PPT 等可以前往 连享会-直播课 主页查看,下载。
关于我们
课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法
等
连享会小程序:扫一扫,看推文,看视频……
扫码加入连享会微信群,提问交流更方便
✏ 连享会学习群-常见问题解答汇总:
✨ https://gitee.com/arlionn/WD