天鹰(中南财大——博士研究生)
E-mail: [yanbinglh@163.com]
- 在通过前两期对广义矩估计GMM基本理论了解的基础上,下面要做的就是如何在STATA中实现操作。
- 本文所使用的数据是Arellano & Bond(1991)中的数据,具体数据可以在网上进行下载(webuse abdata)
xtset id year ----告诉Stata该数据为面板数据----
browse
gen lnemp=log(emp)
g lnwage=log(wage) ----实际工资----
g lncap=log(cap) ----总资本----
g lnindoutpt=log(indoutpt) ----工业产出--衡量工业需求波动----
【T较小】的动态面板模型
一、【差分GMM】--Arellano-Bond(1991)
xtabond lnemp l(0/2).lnindoutpt yr1980-yr1984, lags(2) maxldep(3) maxlags(5) ///
pre(lnwage,lag(1,2)) endogenous(lncap,lag(2,2)) ///
twostep vce(robust)
命令中各部分解读
lags(2)表示模型中含被解释变量p=2阶滞后变量--默认为p=1
maxldep(3)表示最多使用被解释变量3阶滞后变量作为工具变量
默认为使用所有可能滞后变量
maxlags(5)表示模型中前定变量、内生变量作为IV,出现的最大滞后阶数为5
默认前定变量使用T_i-p-1的滞后变量,内生变量T_i-p-2
pre(lnwage,lag(0,2))表示lnwage为前定变量--0表示无滞后变量作为解释变量--
2表示使用其2个更高阶滞后变量作为工具变量
endogenous()类似
inst()表示额外工具变量
twostep表示使用GMM--默认为一步估计GMM
noconstant表示不包括常数项
Arellano-Bond dynamic panel-data estimation Number of obs = 611
Group variable: id Number of groups = 140
Time variable: year
Obs per group:
min = 4
avg = 4.364286
max = 6
Number of instruments = 64 Wald chi2(15) = 762.81
Prob > chi2 = 0.0000
Two-step results
(Std. Err. adjusted for clustering on id)
------------------------------------------------------------------------------
| WC-Robust
lnemp | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lnemp |
L1. | .6346906 .1206567 5.26 0.000 .3982077 .8711734
L2. | -.011178 .0712712 -0.16 0.875 -.150867 .128511
|
lnwage |
--. | -.8325778 .2063351 -4.04 0.000 -1.236987 -.4281685
L1. | .5276342 .1964994 2.69 0.007 .1425025 .9127659
|
lncap |
--. | .3082871 .1269762 2.43 0.015 .0594183 .557156
L1. | -.2126035 .0991537 -2.14 0.032 -.4069413 -.0182658
L2. | -.0785079 .0892686 -0.88 0.379 -.2534711 .0964553
|
lnindoutpt |
--. | .6628442 .1817787 3.65 0.000 .3065645 1.019124
L1. | -.8691549 .269533 -3.22 0.001 -1.39743 -.3408798
L2. | .409885 .2007265 2.04 0.041 .0164682 .8033017
|
yr1980 | .0127509 .0144001 0.89 0.376 -.0154727 .0409745
yr1981 | -.0285024 .028541 -1.00 0.318 -.0844417 .027437
yr1982 | -.0590263 .0344995 -1.71 0.087 -.126644 .0085915
yr1983 | -.048875 .0451834 -1.08 0.279 -.1374329 .0396829
yr1984 | -.0582126 .0504474 -1.15 0.249 -.1570877 .0406625
_cons | .4368342 1.21651 0.36 0.720 -1.947482 2.82115
------------------------------------------------------------------------------
Instruments for differenced equation
GMM-type: L(2/4).lnemp L(1/5).L.lnwage L(2/5).L2.lncap
Standard: D.lnindoutpt LD.lnindoutpt L2D.lnindoutpt D.yr1980
D.yr1981 D.yr1982 D.yr1983 D.yr1984
Instruments for level equation
Standard: _cons
estimates store DIFFGMM
- 首先需要进行序列相关检验
差分GMM--使用前提--原模型扰动项无自相关
等价于差分模型扰动项一阶自相关,二阶及以上无自相关
H0:差分模型扰动项无序列相关
- 尝试(1)
xtabond lnemp l(0/2).lnindoutpt yr1980-yr1984, lags(2) maxldep(3) ///
pre(lnwage,lag(1,2)) pre(lncap,lag(2,2)) ///
twostep vce(robust)
Arellano-Bond test for zero autocorrelation in first-differenced errors
+-----------------------+
|Order | z Prob > z|
|------+----------------|
| 1 |-1.6326 0.1026 |
| 2 |-1.4714 0.1412 |
| 3 | .32461 0.7455 |
+-----------------------+
H0: no autocorrelation
结果(1)并没有通过序列相关检验
尝试(2)
xtabond lnemp l(0/2).lnindoutpt yr1980-yr1984, lags(2) maxldep(3) ///
endogenous(lnwage,lag(1,.)) end(lncap,lag(2,.)) ///
twostep vce(robust)
Arellano-Bond test for zero autocorrelation in first-differenced errors
+-----------------------+
|Order | z Prob > z|
|------+----------------|
| 1 |-3.1853 0.0014 |
| 2 |-1.5918 0.1114 |
| 3 |-.22025 0.8257 |
+-----------------------+
H0: no autocorrelation
结果(2)通过序列相关检验
然后需要进行工具变量检验
sargan检验工具变量过度识别问题
H0:所有工具变量均有效
sargan检验假设扰动项iid
sargan检验时,xtabond不能使用vce(robust)
quietly xtabond lnemp l(0/2).lnindoutpt yr1980-yr1984, lags(2) maxldep(3) ///
end(lnwage,lag(1,.)) endogenous(lncap,lag(2,.)) ///
twostep
- 检验命令
estat sargan
Sargan test of overidentifying restrictions
H0: overidentifying restrictions are valid
chi2(46) = 45.31908
Prob > chi2 = 0.5007
- 结果表明,接受原假设,也即工具变量选择合理。
在通过序列相关以及工具变量检验等一系列操作后最终结果呈现,报告差分GMM的结果
xtabond lnemp l(0/2).lnindoutpt yr1980-yr1984, lags(2) maxldep(3) ///
end(lnwage,lag(1,.)) endogenous(lncap,lag(2,.)) ///
twostep vce(robust)
estimates store DIFFGMM2
* ssc install st0085_2 ----安装非Stata系统软件包----
esttab DIFFGMM2 using testdpdreg1.doc, ar2(%8.4f) se(%8.4f) ///
nogap brackets aic bic mtitles replace
二、【系统GMM】--Blundell-Bond(1998)
xtdpdsys lnemp l(0/2).lnindoutpt yr1980-yr1984, lags(2) maxldep(3) ///
end(lnwage,lag(1,2)) endogenous(lncap,lag(2,2)) ///
twostep vce(robust)
System dynamic panel-data estimation Number of obs = 751
Group variable: id Number of groups = 140
Time variable: year
Obs per group:
min = 5
avg = 5.364286
max = 7
Number of instruments = 64 Wald chi2(15) = 4688.05
Prob > chi2 = 0.0000
Two-step results
------------------------------------------------------------------------------
| WC-Robust
lnemp | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lnemp |
L1. | 1.013517 .1098739 9.22 0.000 .7981677 1.228866
L2. | -.1201835 .0835322 -1.44 0.150 -.2839036 .0435366
|
lnwage |
--. | -.8432712 .2420882 -3.48 0.000 -1.317755 -.368787
L1. | .7576676 .2341127 3.24 0.001 .2988151 1.21652
|
lncap |
--. | .3568467 .1093836 3.26 0.001 .1424587 .5712348
L1. | -.2209638 .0979843 -2.26 0.024 -.4130095 -.0289182
L2. | -.060357 .0940223 -0.64 0.521 -.2446373 .1239234
|
lnindoutpt |
--. | .8191945 .2030095 4.04 0.000 .4213031 1.217086
L1. | -1.219047 .3778686 -3.23 0.001 -1.959656 -.4784387
L2. | .3588023 .2551511 1.41 0.160 -.1412847 .8588894
|
yr1980 | .0315266 .0175931 1.79 0.073 -.0029552 .0660084
yr1981 | -.0064883 .0313917 -0.21 0.836 -.0680148 .0550383
yr1982 | -.0258735 .0366644 -0.71 0.480 -.0977345 .0459874
yr1983 | -.0115748 .0330189 -0.35 0.726 -.0762906 .0531411
yr1984 | -.0196536 .0280715 -0.70 0.484 -.0746727 .0353656
_cons | .6042958 .6189738 0.98 0.329 -.6088706 1.817462
------------------------------------------------------------------------------
Instruments for differenced equation
GMM-type: L(2/4).lnemp L(2/3).L.lnwage L(2/3).L2.lncap
Standard: D.lnindoutpt LD.lnindoutpt L2D.lnindoutpt D.yr1980
D.yr1981 D.yr1982 D.yr1983 D.yr1984
Instruments for level equation
GMM-type: LD.lnemp L2D.lnwage L3D.lncap
Standard: _cons
- 首先进行序列相关检验
estat abond, artests(3)
- 结果
Arellano-Bond test for zero autocorrelation in first-differenced errors
+-----------------------+
|Order | z Prob > z|
|------+----------------|
| 1 | -3.855 0.0001 |
| 2 |-.89148 0.3727 |
| 3 | .17864 0.8582 |
+-----------------------+
H0: no autocorrelation
结果显示通过序列自相关检验
然后进行序列相关检验
xtdpdsys lnemp l(0/2).lnindoutpt yr1980-yr1984, lags(2) maxldep(3) ///
end(lnwage,lag(1,2)) endogenous(lncap,lag(2,2)) ///
twostep
estat sargan
- 结果
Sargan test of overidentifying restrictions
H0: overidentifying restrictions are valid
chi2(48) = 45.09386
Prob > chi2 = 0.5926
- 结果表明接受原假设,也即工具变量选择合适,所有工具变量均有效。
在通过序列相关以及工具变量检验等一系列操作后最终结果呈现,报告系统GMM的结果
xtdpdsys lnemp l(0/2).lnindoutpt yr1980-yr1984, lags(2) maxldep(3) ///
end(lnwage,lag(1,2)) endogenous(lncap,lag(2,2)) ///
twostep vce(robust)
estimates store SYSGMM2
* ssc install st0085_2 ----安装非Stata系统软件包----
esttab SYSGMM2 using testdpdreg3.doc, ar2(%8.4f) se(%8.4f) ///
nogap brackets aic bic mtitles replace
注意事项:
- 在了解差分GMM与系统GMM基础上,进行STATA操作会易于上手,同时文献中通常是两种方法都汇报,以示稳健性。