天鷹(中南財(cái)大——博士研究生)
E-mail: [yanbinglh@163.com]
- 在通過前兩期對(duì)廣義矩估計(jì)GMM基本理論了解的基礎(chǔ)上黔州,下面要做的就是如何在STATA中實(shí)現(xiàn)操作者疤。
- 本文所使用的數(shù)據(jù)是Arellano & Bond(1991)中的數(shù)據(jù)福澡,具體數(shù)據(jù)可以在網(wǎng)上進(jìn)行下載(webuse abdata)
xtset id year ----告訴Stata該數(shù)據(jù)為面板數(shù)據(jù)----
browse
gen lnemp=log(emp)
g lnwage=log(wage) ----實(shí)際工資----
g lncap=log(cap) ----總資本----
g lnindoutpt=log(indoutpt) ----工業(yè)產(chǎn)出--衡量工業(yè)需求波動(dòng)----
【T較小】的動(dòng)態(tài)面板模型
一、【差分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階滯后變量--默認(rèn)為p=1
maxldep(3)表示最多使用被解釋變量3階滯后變量作為工具變量
默認(rèn)為使用所有可能滯后變量
maxlags(5)表示模型中前定變量驹马、內(nèi)生變量作為IV革砸,出現(xiàn)的最大滯后階數(shù)為5
默認(rèn)前定變量使用T_i-p-1的滯后變量,內(nèi)生變量T_i-p-2
pre(lnwage,lag(0,2))表示lnwage為前定變量--0表示無滯后變量作為解釋變量--
2表示使用其2個(gè)更高階滯后變量作為工具變量
endogenous()類似
inst()表示額外工具變量
twostep表示使用GMM--默認(rèn)為一步估計(jì)GMM
noconstant表示不包括常數(shù)項(xiàng)
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
- 首先需要進(jìn)行序列相關(guān)檢驗(yàn)
差分GMM--使用前提--原模型擾動(dòng)項(xiàng)無自相關(guān)
等價(jià)于差分模型擾動(dòng)項(xiàng)一階自相關(guān)糯累,二階及以上無自相關(guān)
H0:差分模型擾動(dòng)項(xiàng)無序列相關(guān)
- 嘗試(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
結(jié)果(1)并沒有通過序列相關(guān)檢驗(yàn)
嘗試(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
結(jié)果(2)通過序列相關(guān)檢驗(yàn)
然后需要進(jìn)行工具變量檢驗(yàn)
sargan檢驗(yàn)工具變量過度識(shí)別問題
H0:所有工具變量均有效
sargan檢驗(yàn)假設(shè)擾動(dòng)項(xiàng)iid
sargan檢驗(yàn)時(shí)算利,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
- 檢驗(yàn)命令
estat sargan
Sargan test of overidentifying restrictions
H0: overidentifying restrictions are valid
chi2(46) = 45.31908
Prob > chi2 = 0.5007
- 結(jié)果表明,接受原假設(shè)泳姐,也即工具變量選擇合理效拭。
在通過序列相關(guān)以及工具變量檢驗(yàn)等一系列操作后最終結(jié)果呈現(xiàn),報(bào)告差分GMM的結(jié)果
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系統(tǒng)軟件包----
esttab DIFFGMM2 using testdpdreg1.doc, ar2(%8.4f) se(%8.4f) ///
nogap brackets aic bic mtitles replace
二仗岸、【系統(tǒng)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
- 首先進(jìn)行序列相關(guān)檢驗(yàn)
estat abond, artests(3)
- 結(jié)果
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
結(jié)果顯示通過序列自相關(guān)檢驗(yàn)
然后進(jìn)行序列相關(guān)檢驗(yàn)
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
- 結(jié)果
Sargan test of overidentifying restrictions
H0: overidentifying restrictions are valid
chi2(48) = 45.09386
Prob > chi2 = 0.5926
- 結(jié)果表明接受原假設(shè)允耿,也即工具變量選擇合適,所有工具變量均有效扒怖。
在通過序列相關(guān)以及工具變量檢驗(yàn)等一系列操作后最終結(jié)果呈現(xiàn)较锡,報(bào)告系統(tǒng)GMM的結(jié)果
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系統(tǒng)軟件包----
esttab SYSGMM2 using testdpdreg3.doc, ar2(%8.4f) se(%8.4f) ///
nogap brackets aic bic mtitles replace
注意事項(xiàng):
- 在了解差分GMM與系統(tǒng)GMM基礎(chǔ)上,進(jìn)行STATA操作會(huì)易于上手盗痒,同時(shí)文獻(xiàn)中通常是兩種方法都匯報(bào)蚂蕴,以示穩(wěn)健性。