Source:
Dynamic Panel Data : IV and GMM Estimation with Stata (Panel)
xtabond cheat sheet
簡(jiǎn)介
動(dòng)態(tài)面板數(shù)據(jù)模型捌治,是指通過(guò)在靜態(tài)面板數(shù)據(jù)模型中引入滯后被解釋變量以反映動(dòng)態(tài)滯后效應(yīng)的模型蚕泽。這種模型的特殊性在于被解釋變量的動(dòng)態(tài)滯后項(xiàng)與隨機(jī)誤差組成部分中的個(gè)體效應(yīng)相關(guān)聂喇,從而造成估計(jì)的內(nèi)生性矿卑。
也就是說(shuō)在動(dòng)態(tài)面板模型允許使用過(guò)去的可觀測(cè)值风喇,考慮了過(guò)去結(jié)果對(duì)當(dāng)前結(jié)果的影響饥臂。而實(shí)際上許多經(jīng)濟(jì)學(xué)問(wèn)題本質(zhì)上都是動(dòng)態(tài)的街佑,其中一些經(jīng)濟(jì)模型表明朴读,當(dāng)前的行為依賴于過(guò)去的行為屹徘,例如就業(yè)模型和公司投資問(wèn)題。
AR(1) 模型
基本設(shè)定
- 是一個(gè)的向量,由時(shí)間t上的樣本中每個(gè)空間單位的被解釋變量的一個(gè)觀測(cè)值衅金, 為其在時(shí)間上的滯后值的響應(yīng)參數(shù)
- 是的外生解釋變量矩陣噪伊,為其響應(yīng)參數(shù)向量
- 是特定效應(yīng)簿煌,且有
- 是服從 分布的干擾項(xiàng),且有
這里就特定效應(yīng)類型將模型分為兩大類
固定效應(yīng)模型(Fixed effect)
通過(guò)消去特定效應(yīng)項(xiàng)得到
但是此時(shí)與相關(guān)鉴吹,盡管是在是序列不相關(guān)的的情況下姨伟。這是因?yàn)?img class="math-inline" src="https://math.jianshu.com/math?formula=y_%7Bi%2C-1%7D" alt="y_{i,-1}" mathimg="1">與相關(guān),后一項(xiàng)的均值包含了這一項(xiàng)豆励,明顯與是相關(guān)的夺荒。這可以看出固定效應(yīng)模型的估計(jì)是有偏的。隨機(jī)效應(yīng)模型(Random effect )
若使用廣義最小二乘法(GLS)良蒸,同理可知般堆,與是相關(guān)的。
因此诚啃,可以看出淮摔,對(duì)于一個(gè)動(dòng)態(tài)面板數(shù)據(jù)模型來(lái)說(shuō),若使用GLS估計(jì)方法始赎,不管是固定效應(yīng)模型還是隨機(jī)效應(yīng)模型和橙,它的估計(jì)都是有偏且不一致連續(xù)的。且偏誤的階數(shù)是,僅當(dāng)時(shí)造垛。但是當(dāng) 很小魔招,時(shí)可能會(huì)引起很大的偏誤。
-
提出問(wèn)題:為什么當(dāng) 固定五辽,時(shí)會(huì)出現(xiàn)偏誤和不一致連續(xù)的情況办斑?
- 首先考慮沒(méi)有外生向量的模型:
假設(shè),對(duì)于向量 我們?cè)? 時(shí)有觀測(cè)值杆逗,
則固定效應(yīng)模型的估計(jì)量為
將等式(3)代入等式(4)中乡翅,可以得到估計(jì)量的特征
等式(5)中,當(dāng) 固定罪郊,的情況下蠕蚜,F(xiàn)E模型的估計(jì)值有偏且不一致。因?yàn)榈仁?5)右邊最后一項(xiàng)的期望不為零悔橄,且在的情況下不收斂到零靶累。Nickell (1981) 和 Hsia (2003) 曾提出過(guò):因此,對(duì)于固定的 癣疟,我們有不一致的估計(jì)量挣柬,不過(guò)這與無(wú)關(guān),已經(jīng)在估計(jì)過(guò)程過(guò)被去掉了睛挚。
這里的問(wèn)題是被解釋變量的動(dòng)態(tài)滯后項(xiàng)與隨機(jī)誤差組成部分中的個(gè)體效應(yīng)相關(guān)邪蛔,如在等式(2)與(5)我們所遇到的問(wèn)題,即與相關(guān)竞川。但當(dāng)時(shí)店溢,等式(6)收斂到零,此時(shí)當(dāng) 和時(shí)委乌,的估計(jì)是一致的床牧。
- 首先考慮沒(méi)有外生向量的模型:
估計(jì)方法
IV
為了解決估計(jì)量不一致的問(wèn)題,Anderson 和 Hsio (1981) 提出了工具變量估計(jì)(IV)遭贸。首先戈咳,我們考慮消去個(gè)體效應(yīng),對(duì)此壕吹,做差分得:
- 此處若使用最小二乘法(OSL)得到等式(7)的估計(jì)量是不一致的著蛙,盡管是在的情況下,這是因?yàn)?img class="math-inline" src="https://math.jianshu.com/math?formula=y_%7Bi%2Ct-1%7D" alt="y_{i,t-1}" mathimg="1">和相關(guān)耳贬。
- 轉(zhuǎn)換規(guī)范等式(7)給出一個(gè)IV估計(jì)的方法踏堡,例如,與相關(guān)咒劲,但與不相關(guān)顷蟆,所以選取作為工具變量,給出了的一個(gè)IV估計(jì):
對(duì)應(yīng)的關(guān)于等式(8)的一致性條件為 注意這里是MA(1)
- Anderson 和 Hsio (1981) 又給出了另一個(gè)IV估計(jì)的方案腐魂,這里選擇將作為工具變量帐偎。同理,得到等式(10)的一致性條件為 且只要不是自相關(guān)的蛔屹,等式(8)和(11)的一致性都得到了保障削樊。
可以看出,等式(10)構(gòu)建工具變量時(shí)比等式(8)多引入了一個(gè)滯后項(xiàng)兔毒,這導(dǎo)致缺失了一期的樣本數(shù)據(jù)漫贞。這就又提出了一個(gè)問(wèn)題,我們究竟是選擇等式(8)還是等式(10)的估計(jì)比較好育叁?
而矩估計(jì)(MM)法則不需要考慮這個(gè)問(wèn)題绕辖,MM估計(jì)可以統(tǒng)一所有的估計(jì)量且消去樣本容量減少的缺點(diǎn)。
GMM
可得等式(9)的矩條件為
同理擂红,等式(11)的矩條件為這兩個(gè)IV估計(jì)值都在估計(jì)中附加了一個(gè)矩條件仪际。但是,據(jù)我們所知昵骤,附加更多的矩條件則能增加估計(jì)值的效率树碱。
據(jù)此,Arellano 和 Bond (1991) 提出可以通過(guò)開(kāi)發(fā)附加矩來(lái)擴(kuò)大工具的列表并且是工具的數(shù)量隨著 t 變化变秦。首先成榜,固定T,這里考慮 T=4蹦玫。
- t = 2 時(shí)赎婚,矩條件變?yōu)椋?img class="math-inline" src="https://math.jianshu.com/math?formula=E%5B(%5Cepsilon_%7Bi%2C2%7D-%5Cepsilon_%7Bi%2C1%7D)y_%7Bi%2C0%7D%5D%3D0" alt="E[(\epsilon_{i,2}-\epsilon_{i,1})y_{i,0}]=0" mathimg="1">
這意味著變量是有效的工具刘绣,因?yàn)樗c高度相關(guān)而與不相關(guān)。 - t = 3 時(shí)挣输,同理可得纬凤,矩條件為: 同時(shí)也滿足
其中,與相關(guān)撩嚼,而與不相關(guān)停士。 - t = 4 時(shí),我們將得到三組矩條件
一直繼續(xù)這么添加矩條件之后完丽,有效的工具集合變?yōu)?img class="math-inline" src="https://math.jianshu.com/math?formula=(y_%7Bi0%7D%2Cy_%7Bi2%7D...y_%7Bi%2CT-2%7D)" alt="(y_{i0},y_{i2}...y_{i,T-2})" mathimg="1">
而所有的這些矩條件可以作為廣義矩估計(jì)(GMM)的一個(gè)框架恋技。對(duì)于一般的樣本大小 T,所有差分后的誤差項(xiàng)可排成一個(gè)向量:
由工具變量排成的矩陣為:
矩陣的每一行都包含了給定時(shí)段所有有效工具逻族。因此蜻底,所有矩條件的集合可寫(xiě)為:為了得到GMM估計(jì),將等式(16)改寫(xiě)成
顯然聘鳞,矩條件的數(shù)量會(huì)增加未知參數(shù)的數(shù)量播瞳。
這里我們通過(guò)最小化由等式(17)所對(duì)應(yīng)的條件表達(dá)的二次型來(lái)估計(jì)參數(shù):
其中是定義的對(duì)稱正定的權(quán)重矩陣坏平。
然后贬蛙,通過(guò)對(duì)等式(18)關(guān)于求微分并求解得到GMM估計(jì)量:
GMM估計(jì)并不強(qiáng)制要求關(guān)于個(gè)體與時(shí)間服從獨(dú)立分布逼侦,但是需要注意的是,需要不存在自相關(guān)以保證矩條件有效鸡典。因此源请,在一個(gè)短面板(即T比較小)彻况,建議強(qiáng)制不存在自相關(guān)谁尸,并結(jié)合同方差性假設(shè)。
Alvarez 和 Arellano (2003) 表示纽甘,通常良蛮,GMM估計(jì)在的情況下仍然保持一致性。但是悍赢,對(duì)于的情況下决瞳,GMM估計(jì)和FE估計(jì)會(huì)很接近,這給我們估計(jì)方法提供了一個(gè)更具有吸引力的選擇左权。
實(shí)際應(yīng)用
Arellano和Bond ( 1991) 提出了一階差分GMM (FD-GMM)估計(jì)方法皮胡,主要做法是用變量的水平滯后值作為其一階差分項(xiàng)的工具變量。具體來(lái)說(shuō):
- 由我們上文所考慮的沒(méi)有外生向量的模型(3)的水平方程赏迟,考慮它的差分方程
因?yàn)?img class="math-inline" src="https://math.jianshu.com/math?formula=%5CDelta%20y_%7Bi%2Ct-1%7D" alt="\Delta y_{i,t-1}" mathimg="1">與相關(guān)聯(lián)屡贺,所以將作為的工具變量。這種估計(jì)方法就是FD-GMM。
但是, Blundell和Bond (1998)曾指出,一階差分GMM估計(jì)方法容易受到弱工具變量的影響而得到有偏的估計(jì)結(jié)果甩栈。即:
- 由模型(3)的水平方程可得
當(dāng)接近1的時(shí)候泻仙,工具變量和外生變量的關(guān)系就會(huì)變的很弱,這就會(huì)產(chǎn)生“弱工具變量問(wèn)題”量没。
為了克服弱工具變量的影響, Arellano和Bover (1995) 以及Blundell和Bond (1998)提出了另外一種更加有效的方法,即系統(tǒng)GMM (SYS-GMM)估計(jì)方法玉转。其具體做法是將水平方程和差分方程結(jié)合起來(lái)進(jìn)行估計(jì),在這種估計(jì)方法中,滯后水平作為一階差分的工具變量,而一階差分又作為水平變量的工具變量。具體來(lái)說(shuō):
在上述FD-GMM估計(jì)中允蜈,可以看作是應(yīng)用了矩條件,但是卻有個(gè)矩條件被忽略了蒿柳,
即:
而SYS-GMM則是考慮到了這一點(diǎn)饶套,利用了更多的有效信息,使得估計(jì)不受接近1時(shí)的影響垒探。
Stata 范例
- 我們可以使用
xtabond
命令來(lái)實(shí)現(xiàn)FD-GMM估計(jì)妓蛮,這里我們使用數(shù)據(jù)abdata
. webuse abdata
. xtabond n L(0/2).(w k) yr1980-yr1984 year, vce(robust)
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 = 40 Wald chi2(13) = 1318.68
Prob > chi2 = 0.0000
One-step results
(Std. Err. adjusted for clustering on id)
------------------------------------------------------------------------------
| Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .6286618 .1161942 5.41 0.000 .4009254 .8563983
|
w |
--. | -.5104249 .1904292 -2.68 0.007 -.8836592 -.1371906
L1. | .2891446 .140946 2.05 0.040 .0128954 .5653937
L2. | -.0443653 .0768135 -0.58 0.564 -.194917 .1061865
|
k |
--. | .3556923 .0603274 5.90 0.000 .2374528 .4739318
L1. | -.0457102 .0699732 -0.65 0.514 -.1828552 .0914348
L2. | -.0619721 .0328589 -1.89 0.059 -.1263743 .0024301
|
yr1980 | -.0282422 .0166363 -1.70 0.090 -.0608488 .0043643
yr1981 | -.0694052 .028961 -2.40 0.017 -.1261677 -.0126426
yr1982 | -.0523678 .0423433 -1.24 0.216 -.1353591 .0306235
yr1983 | -.0256599 .0533747 -0.48 0.631 -.1302723 .0789525
yr1984 | -.0093229 .0696241 -0.13 0.893 -.1457837 .1271379
year | .0019575 .0119481 0.16 0.870 -.0214604 .0253754
_cons | -2.543221 23.97919 -0.11 0.916 -49.54158 44.45514
------------------------------------------------------------------------------
Instruments for differenced equation
GMM-type: L(2/.).n
Standard: D.w LD.w L2D.w D.k LD.k L2D.k D.yr1980 D.yr1981 D.yr1982
D.yr1983 D.yr1984 D.year
Instruments for level equation
Standard: _cons
- 下面用
xtdpdsys
命令來(lái)實(shí)現(xiàn)SYS-GMM估計(jì)
. xtdpdsys n L(0/2).(w k) yr1980-yr1984 year, 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 = 47 Wald chi2(13) = 2579.96
Prob > chi2 = 0.0000
One-step results
------------------------------------------------------------------------------
| Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .8221535 .093387 8.80 0.000 .6391184 1.005189
|
w |
--. | -.5427935 .1881721 -2.88 0.004 -.911604 -.1739831
L1. | .3703602 .1656364 2.24 0.025 .0457189 .6950015
L2. | -.0726314 .0907148 -0.80 0.423 -.2504292 .1051664
|
k |
--. | .3638069 .0657524 5.53 0.000 .2349346 .4926792
L1. | -.1222996 .0701521 -1.74 0.081 -.2597951 .015196
L2. | -.0901355 .0344142 -2.62 0.009 -.1575862 -.0226849
|
yr1980 | -.0308622 .016946 -1.82 0.069 -.0640757 .0023512
yr1981 | -.0718417 .0293223 -2.45 0.014 -.1293123 -.014371
yr1982 | -.0384806 .0373631 -1.03 0.303 -.1117111 .0347498
yr1983 | -.0121768 .0498519 -0.24 0.807 -.1098847 .0855311
yr1984 | -.0050903 .0655011 -0.08 0.938 -.1334701 .1232895
year | .0058631 .0119867 0.49 0.625 -.0176304 .0293566
_cons | -10.59198 23.92087 -0.44 0.658 -57.47602 36.29207
------------------------------------------------------------------------------
Instruments for differenced equation
GMM-type: L(2/.).n
Standard: D.w LD.w L2D.w D.k LD.k L2D.k D.yr1980 D.yr1981 D.yr1982
D.yr1983 D.yr1984 D.year
Instruments for level equation
GMM-type: LD.n
Standard: _cons
可以看到工具變量的數(shù)量變多。
-
xtdpd
則是一種更加靈活的替代方法圾叼,它可以用比xtabond
和xtdpdsys
更復(fù)雜的結(jié)構(gòu)來(lái)擬合在特殊誤差和預(yù)定變量中具有低階移動(dòng)平均關(guān)聯(lián)的模型蛤克。
假設(shè)檢驗(yàn)
序列相關(guān)檢驗(yàn)
可以看出 Arellano–Bond估計(jì)工具變量的設(shè)定的關(guān)鍵點(diǎn)在于
我們可以在 Stata 中使用estat abond
命令來(lái)測(cè)試這些條件。
從本質(zhì)上來(lái)說(shuō)夷蚊,一般未觀測(cè)到的的差分項(xiàng)應(yīng)與其因變量的第二期滯后和之后的滯后項(xiàng)都無(wú)關(guān)构挤。如果不是這樣,我們又回到了一開(kāi)始的問(wèn)題惕鼓,內(nèi)生性筋现。所以我們主要關(guān)心的是有沒(méi)有2階或者更高階的序列相關(guān)性。
下面我們用estat bond
命令來(lái)測(cè)試我們上述的例子:
. estat abond, artests(4)
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 = 47 Wald chi2(13) = 2579.96
Prob > chi2 = 0.0000
One-step results
(Std. Err. adjusted for clustering on id)
------------------------------------------------------------------------------
| Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .8221535 .093387 8.80 0.000 .6391184 1.005189
|
w |
--. | -.5427935 .1881721 -2.88 0.004 -.911604 -.1739831
L1. | .3703602 .1656364 2.24 0.025 .0457189 .6950015
L2. | -.0726314 .0907148 -0.80 0.423 -.2504292 .1051664
|
k |
--. | .3638069 .0657524 5.53 0.000 .2349346 .4926792
L1. | -.1222996 .0701521 -1.74 0.081 -.2597951 .015196
L2. | -.0901355 .0344142 -2.62 0.009 -.1575862 -.0226849
|
yr1980 | -.0308622 .016946 -1.82 0.069 -.0640757 .0023512
yr1981 | -.0718417 .0293223 -2.45 0.014 -.1293123 -.014371
yr1982 | -.0384806 .0373631 -1.03 0.303 -.1117111 .0347498
yr1983 | -.0121768 .0498519 -0.24 0.807 -.1098847 .0855311
yr1984 | -.0050903 .0655011 -0.08 0.938 -.1334701 .1232895
year | .0058631 .0119867 0.49 0.625 -.0176304 .0293566
_cons | -10.59198 23.92087 -0.44 0.658 -57.47602 36.29207
------------------------------------------------------------------------------
Instruments for differenced equation
GMM-type: L(2/.).n
Standard: D.w LD.w L2D.w D.k LD.k L2D.k D.yr1980 D.yr1981 D.yr1982
D.yr1983 D.yr1984 D.year
Instruments for level equation
GMM-type: LD.n
Standard: _cons
Arellano-Bond test for zero autocorrelation in first-differenced errors
+-----------------------+
|Order | z Prob > z|
|------+----------------|
| 1 |-4.6414 0.0000 |
| 2 |-1.0572 0.2904 |
| 3 |-.19492 0.8455 |
| 4 | .04472 0.9643 |
+-----------------------+
H0: no autocorrelation
可以看到的是箱歧,我們可以拒絕一階序列相關(guān)的原假設(shè)矾飞,但是不能拒絕2、3呀邢、4階序列相關(guān)的原假設(shè)洒沦。所以原模型是合理的。
?
過(guò)度識(shí)別檢驗(yàn)(estat overid)
檢驗(yàn)工具變量是否是與干擾項(xiàng)相關(guān)价淌,也就是工具變量是否為外生變量申眼。
原假設(shè)是:所有工具變量都是外生。
其中包含 hansen 檢驗(yàn)和 sargan 檢驗(yàn)蝉衣,可以用 Stata 中的xtabond2
命令實(shí)現(xiàn)豺型。
Stata 范例
-
xtabond
命令實(shí)現(xiàn)了 Arellano 和 Bond Roodman在1991年所提出的一階差分矩估計(jì)法(FD-GMM),此時(shí)它的矩條件是將因變量的滯后和外生變量的一階差分作為一階差分方程的工具买乃。 -
xtdpdsys
實(shí)現(xiàn)了Arellano姻氨、Bover/Blundell 和 Bond在1998年提出的系統(tǒng) GMM 估計(jì)(SYS-GMM) ,它使用了xtabond
的矩條件剪验,同時(shí)又將因變量滯后第一差分作為水平方程的工具肴焊。 -
xtdpd
則是一種更加靈活的替代方法前联,它可以用比xtabond
和xtdpdsys
更復(fù)雜的結(jié)構(gòu)來(lái)擬合在特殊誤差和預(yù)定變量中具有低階移動(dòng)平均關(guān)聯(lián)的模型。 - 后估計(jì)工具允許您在一階差分殘差中測(cè)試序列相關(guān)性娶眷,并測(cè)試過(guò)度識(shí)別限制的有效性似嗤。
例子:
基于Layard和Nickell(1986)的工作,Arellano和Bond(1991)將勞動(dòng)力需求的動(dòng)態(tài)模型擬合到位于英國(guó)的一個(gè)具有不平衡面板的公司上届宠。首先烁落,我們根據(jù) 工資(wages)、資本存量(capital stock)豌注、行業(yè)產(chǎn)出(industry output)伤塌、年度假人(year dummies) 以及 一個(gè)時(shí)間趨勢(shì)(a time trend )對(duì) 就業(yè)率(employment) 進(jìn)行建模,其中包括就業(yè)轧铁,工資和資本存量的滯后每聪。我們將使用xtabond
命令
. webuse abdata
. xtabond n L(0/2).(w k) yr1980-yr1984 year, vce(robust)
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 = 40 Wald chi2(13) = 1318.68
Prob > chi2 = 0.0000
One-step results
(Std. Err. adjusted for clustering on id)
------------------------------------------------------------------------------
| Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .6286618 .1161942 5.41 0.000 .4009254 .8563983
|
w |
--. | -.5104249 .1904292 -2.68 0.007 -.8836592 -.1371906
L1. | .2891446 .140946 2.05 0.040 .0128954 .5653937
L2. | -.0443653 .0768135 -0.58 0.564 -.194917 .1061865
|
k |
--. | .3556923 .0603274 5.90 0.000 .2374528 .4739318
L1. | -.0457102 .0699732 -0.65 0.514 -.1828552 .0914348
L2. | -.0619721 .0328589 -1.89 0.059 -.1263743 .0024301
|
yr1980 | -.0282422 .0166363 -1.70 0.090 -.0608488 .0043643
yr1981 | -.0694052 .028961 -2.40 0.017 -.1261677 -.0126426
yr1982 | -.0523678 .0423433 -1.24 0.216 -.1353591 .0306235
yr1983 | -.0256599 .0533747 -0.48 0.631 -.1302723 .0789525
yr1984 | -.0093229 .0696241 -0.13 0.893 -.1457837 .1271379
year | .0019575 .0119481 0.16 0.870 -.0214604 .0253754
_cons | -2.543221 23.97919 -0.11 0.916 -49.54158 44.45514
------------------------------------------------------------------------------
Instruments for differenced equation
GMM-type: L(2/.).n
Standard: D.w LD.w L2D.w D.k LD.k L2D.k D.yr1980 D.yr1981 D.yr1982
D.yr1983 D.yr1984 D.year
Instruments for level equation
Standard: _cons
由于我們的回歸模型中包含一個(gè)n的滯后,xtabond
使用滯后2期和back作為工具齿风。外生變量的差分也可以作為工具药薯。
這里,我們使用xtdpdsys
來(lái)重新定義模型
. xtdpdsys n L(0/2).(w k) yr1980-yr1984 year, 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 = 47 Wald chi2(13) = 2579.96
Prob > chi2 = 0.0000
One-step results
------------------------------------------------------------------------------
| Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .8221535 .093387 8.80 0.000 .6391184 1.005189
|
w |
--. | -.5427935 .1881721 -2.88 0.004 -.911604 -.1739831
L1. | .3703602 .1656364 2.24 0.025 .0457189 .6950015
L2. | -.0726314 .0907148 -0.80 0.423 -.2504292 .1051664
|
k |
--. | .3638069 .0657524 5.53 0.000 .2349346 .4926792
L1. | -.1222996 .0701521 -1.74 0.081 -.2597951 .015196
L2. | -.0901355 .0344142 -2.62 0.009 -.1575862 -.0226849
|
yr1980 | -.0308622 .016946 -1.82 0.069 -.0640757 .0023512
yr1981 | -.0718417 .0293223 -2.45 0.014 -.1293123 -.014371
yr1982 | -.0384806 .0373631 -1.03 0.303 -.1117111 .0347498
yr1983 | -.0121768 .0498519 -0.24 0.807 -.1098847 .0855311
yr1984 | -.0050903 .0655011 -0.08 0.938 -.1334701 .1232895
year | .0058631 .0119867 0.49 0.625 -.0176304 .0293566
_cons | -10.59198 23.92087 -0.44 0.658 -57.47602 36.29207
------------------------------------------------------------------------------
Instruments for differenced equation
GMM-type: L(2/.).n
Standard: D.w LD.w L2D.w D.k LD.k L2D.k D.yr1980 D.yr1981 D.yr1982
D.yr1983 D.yr1984 D.year
Instruments for level equation
GMM-type: LD.n
Standard: _cons
比較這兩個(gè)命令輸出的頁(yè)腳說(shuō)明了這兩個(gè)估計(jì)器之間的關(guān)鍵區(qū)別救斑。xtdpdsys
將n的滯后差也作為工具納入水平方程童本,而xtabond
沒(méi)有。xtdpdsys
的工具變量變多了脸候,但是模型的標(biāo)準(zhǔn)誤降低了巾陕。
這些GMM估計(jì)量的矩條件只有在特征誤差不存在序列相關(guān)性的情況下才有效。由于白噪聲的第一個(gè)差異必然是自相關(guān)的纪他,我們只需要關(guān)注第二個(gè)和更高的自相關(guān)鄙煤。我們可以使用estat abond
測(cè)試自相關(guān):
. estat abond, artests(4)
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 = 47 Wald chi2(13) = 2579.96
Prob > chi2 = 0.0000
One-step results
(Std. Err. adjusted for clustering on id)
------------------------------------------------------------------------------
| Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .8221535 .093387 8.80 0.000 .6391184 1.005189
|
w |
--. | -.5427935 .1881721 -2.88 0.004 -.911604 -.1739831
L1. | .3703602 .1656364 2.24 0.025 .0457189 .6950015
L2. | -.0726314 .0907148 -0.80 0.423 -.2504292 .1051664
|
k |
--. | .3638069 .0657524 5.53 0.000 .2349346 .4926792
L1. | -.1222996 .0701521 -1.74 0.081 -.2597951 .015196
L2. | -.0901355 .0344142 -2.62 0.009 -.1575862 -.0226849
|
yr1980 | -.0308622 .016946 -1.82 0.069 -.0640757 .0023512
yr1981 | -.0718417 .0293223 -2.45 0.014 -.1293123 -.014371
yr1982 | -.0384806 .0373631 -1.03 0.303 -.1117111 .0347498
yr1983 | -.0121768 .0498519 -0.24 0.807 -.1098847 .0855311
yr1984 | -.0050903 .0655011 -0.08 0.938 -.1334701 .1232895
year | .0058631 .0119867 0.49 0.625 -.0176304 .0293566
_cons | -10.59198 23.92087 -0.44 0.658 -57.47602 36.29207
------------------------------------------------------------------------------
Instruments for differenced equation
GMM-type: L(2/.).n
Standard: D.w LD.w L2D.w D.k LD.k L2D.k D.yr1980 D.yr1981 D.yr1982
D.yr1983 D.yr1984 D.year
Instruments for level equation
GMM-type: LD.n
Standard: _cons
Arellano-Bond test for zero autocorrelation in first-differenced errors
+-----------------------+
|Order | z Prob > z|
|------+----------------|
| 1 |-4.6414 0.0000 |
| 2 |-1.0572 0.2904 |
| 3 |-.19492 0.8455 |
| 4 | .04472 0.9643 |
+-----------------------+
H0: no autocorrelation
參考文獻(xiàn):
1、 Dynamic Panel Data : IV and GMM Estimation with Stata (Panel)
2茶袒、 xtabond cheat sheet
3梯刚、
重現(xiàn) Arollano and Bond (1991) FD-GMM 結(jié)果
clear all
set mem 32m
set matsize 800
use "http://www.stata-press.com/data/r7/abdata.dta"
- 設(shè)置變量,其一階差分是年度虛擬變量和常數(shù)項(xiàng)薪寓。
這個(gè)步驟一般不是必需的亡资,但需要完全模仿DPD,因?yàn)樗贔D-GMM中也是需要直接輸入時(shí)間虛擬和常數(shù)項(xiàng)向叉。
forvalues y = 1979/1984 {
gen yr`y'c = year>=`y'
}
gen cons = year
運(yùn)行結(jié)果
- a1
xtabond2 n L(0/1).(l.n w) l(0/2).(k ys) yr198?c cons, gmm(L.n) iv(L(0/1).w l(0/2).(k ys) yr198?c cons) noleveleq noconstant robust
輸出結(jié)果為:
Dynamic panel-data estimation, one-step difference GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 611
Time variable : year Number of groups = 140
Number of instruments = 41 Obs per group: min = 4
Wald chi2(16) = 1727.45 avg = 4.36
Prob > chi2 = 0.000 max = 6
------------------------------------------------------------------------------
| Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .6862261 .1445943 4.75 0.000 .4028266 .9696257
L2. | -.0853582 .0560155 -1.52 0.128 -.1951467 .0244302
|
w |
--. | -.6078208 .1782055 -3.41 0.001 -.9570972 -.2585445
L1. | .3926237 .1679931 2.34 0.019 .0633632 .7218842
|
k |
--. | .3568456 .0590203 6.05 0.000 .241168 .4725233
L1. | -.0580012 .0731797 -0.79 0.428 -.2014308 .0854284
L2. | -.0199475 .0327126 -0.61 0.542 -.0840631 .0441681
|
ys |
--. | .6085073 .1725313 3.53 0.000 .2703522 .9466624
L1. | -.7111651 .2317163 -3.07 0.002 -1.165321 -.2570095
L2. | .1057969 .1412021 0.75 0.454 -.1709542 .382548
|
yr1980c | .0029062 .0158028 0.18 0.854 -.0280667 .0338791
yr1981c | -.043344 .0169961 -2.55 0.011 -.0766557 -.0100323
yr1982c | -.024839 .0202692 -1.23 0.220 -.0645658 .0148878
yr1983c | -.0038161 .0219426 -0.17 0.862 -.0468227 .0391905
yr1984c | .0040626 .0218975 0.19 0.853 -.0388558 .046981
cons | .0095545 .0102896 0.93 0.353 -.0106127 .0297217
------------------------------------------------------------------------------
Instruments for first differences equation
Standard
D.(w L.w k L.k L2.k ys L.ys L2.ys yr1980c yr1981c yr1982c yr1983c yr1984c
cons)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(1/8).L.n
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -3.60 Pr > z = 0.000
Arellano-Bond test for AR(2) in first differences: z = -0.52 Pr > z = 0.606
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(25) = 67.59 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(25) = 31.38 Prob > chi2 = 0.177
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
iv(w L.w k L.k L2.k ys L.ys L2.ys yr1980c yr1981c yr1982c yr1983c yr1984c cons)
Hansen test excluding group: chi2(11) = 12.01 Prob > chi2 = 0.363
Difference (null H = exogenous): chi2(14) = 19.37 Prob > chi2 = 0.151
- a2
xtabond2 n L(0/1).(l.n w) l(0/2).(k ys) yr198?c cons, gmm(L.n) iv(L(0/1).w l(0/2).(k ys) yr198?c cons) noleveleq noconstant two
輸出結(jié)果為:
Dynamic panel-data estimation, two-step difference GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 611
Time variable : year Number of groups = 140
Number of instruments = 41 Obs per group: min = 4
Wald chi2(16) = 2216.93 avg = 4.36
Prob > chi2 = 0.000 max = 6
------------------------------------------------------------------------------
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .6287089 .0904543 6.95 0.000 .4514216 .8059961
L2. | -.0651882 .0265009 -2.46 0.014 -.117129 -.0132474
|
w |
--. | -.5257597 .0537692 -9.78 0.000 -.6311453 -.420374
L1. | .3112899 .0940116 3.31 0.001 .1270305 .4955492
|
k |
--. | .2783619 .0449083 6.20 0.000 .1903432 .3663807
L1. | .0140994 .0528046 0.27 0.789 -.0893957 .1175946
L2. | -.0402484 .0258038 -1.56 0.119 -.0908229 .010326
|
ys |
--. | .5919243 .1162114 5.09 0.000 .3641542 .8196943
L1. | -.5659863 .1396738 -4.05 0.000 -.8397419 -.2922306
L2. | .1005433 .1126749 0.89 0.372 -.1202955 .321382
|
yr1980c | .0006378 .0127959 0.05 0.960 -.0244417 .0257172
yr1981c | -.0556422 .0143097 -3.89 0.000 -.0836888 -.0275956
yr1982c | -.0209736 .0163224 -1.28 0.199 -.0529648 .0110177
yr1983c | .0019072 .014625 0.13 0.896 -.0267574 .0305718
yr1984c | -.0165899 .0153035 -1.08 0.278 -.0465842 .0134045
cons | .0112155 .0077507 1.45 0.148 -.0039756 .0264066
------------------------------------------------------------------------------
Warning: Uncorrected two-step standard errors are unreliable.
Instruments for first differences equation
Standard
D.(w L.w k L.k L2.k ys L.ys L2.ys yr1980c yr1981c yr1982c yr1983c yr1984c
cons)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(1/8).L.n
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -3.00 Pr > z = 0.003
Arellano-Bond test for AR(2) in first differences: z = -0.42 Pr > z = 0.678
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(25) = 67.59 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(25) = 31.38 Prob > chi2 = 0.177
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
iv(w L.w k L.k L2.k ys L.ys L2.ys yr1980c yr1981c yr1982c yr1983c yr1984c cons)
Hansen test excluding group: chi2(11) = 12.01 Prob > chi2 = 0.363
Difference (null H = exogenous): chi2(14) = 19.37 Prob > chi2 = 0.151
- b
xtabond2 n L(0/1).(l.n ys w) k yr198?c cons, gmm(L.n) iv(L(0/1).(ys w) k yr198?c cons) noleveleq noconstant two
輸出結(jié)果為:
Dynamic panel-data estimation, two-step difference GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 611
Time variable : year Number of groups = 140
Number of instruments = 38 Obs per group: min = 4
Wald chi2(13) = 1603.26 avg = 4.36
Prob > chi2 = 0.000 max = 6
------------------------------------------------------------------------------
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .4741506 .0853032 5.56 0.000 .3069594 .6413417
L2. | -.0529677 .0272843 -1.94 0.052 -.106444 .0005087
|
ys |
--. | .609776 .1085238 5.62 0.000 .3970732 .8224788
L1. | -.4463736 .1248148 -3.58 0.000 -.6910061 -.201741
|
w |
--. | -.5132049 .0493453 -10.40 0.000 -.60992 -.4164898
L1. | .22464 .0800628 2.81 0.005 .0677198 .3815601
|
k | .2927232 .0394626 7.42 0.000 .215378 .3700684
yr1980c | .0036333 .0127335 0.29 0.775 -.0213239 .0285905
yr1981c | -.050962 .0137101 -3.72 0.000 -.0778334 -.0240907
yr1982c | -.0321491 .0139863 -2.30 0.022 -.0595618 -.0047364
yr1983c | -.0123558 .0128418 -0.96 0.336 -.0375252 .0128135
yr1984c | -.0207296 .0136789 -1.52 0.130 -.0475398 .0060806
cons | .010509 .0072515 1.45 0.147 -.0037036 .0247216
------------------------------------------------------------------------------
Warning: Uncorrected two-step standard errors are unreliable.
Instruments for first differences equation
Standard
D.(ys L.ys w L.w k yr1980c yr1981c yr1982c yr1983c yr1984c cons)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(1/8).L.n
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -2.43 Pr > z = 0.015
Arellano-Bond test for AR(2) in first differences: z = -0.33 Pr > z = 0.739
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(25) = 75.46 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(25) = 30.11 Prob > chi2 = 0.220
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
iv(ys L.ys w L.w k yr1980c yr1981c yr1982c yr1983c yr1984c cons)
Hansen test excluding group: chi2(14) = 13.33 Prob > chi2 = 0.501
Difference (null H = exogenous): chi2(11) = 16.78 Prob > chi2 = 0.115
- c
可用數(shù)據(jù)集缺少銷售和庫(kù)存信息兽掰,因此這里必須使用別的工具熏挎。 該回歸完美地復(fù)制了 DPD 在 Ox包中 abest3.out 的結(jié)果
xtabond2 n L(0/1).(l.n ys w) k yr198?c cons, gmm(L.n) gmm(w k, lag(2 3)) iv(L(0/1).ys yr198?c cons) noleveleq noconstant two
輸出結(jié)果為:
Dynamic panel-data estimation, two-step difference GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 611
Time variable : year Number of groups = 140
Number of instruments = 59 Obs per group: min = 4
Wald chi2(13) = 2668.33 avg = 4.36
Prob > chi2 = 0.000 max = 6
------------------------------------------------------------------------------
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .8074308 .0491071 16.44 0.000 .7111827 .9036789
L2. | -.1134945 .0228508 -4.97 0.000 -.1582813 -.0687076
|
ys |
--. | .8599923 .1097787 7.83 0.000 .6448299 1.075155
L1. | -.8632569 .1101426 -7.84 0.000 -1.079132 -.6473814
|
w |
--. | -.5686242 .0598841 -9.50 0.000 -.6859949 -.4512536
L1. | .640707 .0672002 9.53 0.000 .508997 .772417
|
k | .1833987 .0567488 3.23 0.001 .0721731 .2946243
yr1980c | .0095269 .0112312 0.85 0.396 -.0124858 .0315397
yr1981c | -.0557186 .0117042 -4.76 0.000 -.0786584 -.0327788
yr1982c | -.0558586 .0122055 -4.58 0.000 -.0797809 -.0319362
yr1983c | -.0304113 .0133729 -2.27 0.023 -.0566217 -.0042009
yr1984c | -.0238496 .0137584 -1.73 0.083 -.0508155 .0031163
cons | .0162529 .006453 2.52 0.012 .0036053 .0289005
------------------------------------------------------------------------------
Warning: Uncorrected two-step standard errors are unreliable.
Instruments for first differences equation
Standard
D.(ys L.ys yr1980c yr1981c yr1982c yr1983c yr1984c cons)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(2/3).(w k)
L(1/8).L.n
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -4.07 Pr > z = 0.000
Arellano-Bond test for AR(2) in first differences: z = -0.68 Pr > z = 0.498
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(46) = 98.75 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(46) = 58.71 Prob > chi2 = 0.099
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
gmm(L.n, lag(1 .))
Hansen test excluding group: chi2(19) = 19.11 Prob > chi2 = 0.450
Difference (null H = exogenous): chi2(27) = 39.60 Prob > chi2 = 0.056
gmm(w k, lag(2 3))
Hansen test excluding group: chi2(22) = 22.98 Prob > chi2 = 0.403
Difference (null H = exogenous): chi2(24) = 35.73 Prob > chi2 = 0.058
iv(ys L.ys yr1980c yr1981c yr1982c yr1983c yr1984c cons)
Hansen test excluding group: chi2(38) = 40.24 Prob > chi2 = 0.371
Difference (null H = exogenous): chi2(8) = 18.47 Prob > chi2 = 0.018
重現(xiàn) SYS-GMM 結(jié)果
clear all
set matsize 800
use "http://www.stata-press.com/data/r7/abdata.dta"
- 設(shè)置變量,其一階差分是年度虛擬變量和常數(shù)項(xiàng)晌砾。
這個(gè)步驟一般不是必需的坎拐,但需要完全模仿DPD,因?yàn)樗贔D-GMM中也是需要直接輸入時(shí)間虛擬和常數(shù)項(xiàng)。
forvalues y = 1979/1984 {
gen yr`y'c = year>=`y'
}
gen cons = year
運(yùn)行結(jié)果
- FD-GMM
- a
xtabond2 n L.n L(0/1).(w k) yr*c cons, gmm(L.(w k n)) iv(yr*c cons) noleveleq noconstant robust
輸出結(jié)果
Dynamic panel-data estimation, one-step difference GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 751
Time variable : year Number of groups = 140
Number of instruments = 91 Obs per group: min = 5
Wald chi2(12) = 1163.33 avg = 5.36
Prob > chi2 = 0.000 max = 7
------------------------------------------------------------------------------
| Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .7074701 .0841788 8.40 0.000 .5424827 .8724576
|
w |
--. | -.7087965 .117102 -6.05 0.000 -.9383122 -.4792809
L1. | .5000149 .1113282 4.49 0.000 .2818157 .7182141
|
k |
--. | .4659776 .101044 4.61 0.000 .267935 .6640203
L1. | -.2151309 .0858525 -2.51 0.012 -.3833987 -.0468631
|
yr1979c | .0021095 .0177521 0.12 0.905 -.0326839 .0369028
yr1980c | -.0265559 .0194641 -1.36 0.172 -.0647048 .0115931
yr1981c | -.0326771 .0232915 -1.40 0.161 -.0783275 .0129733
yr1982c | .0223882 .0254598 0.88 0.379 -.0275121 .0722885
yr1983c | .0188752 .0235881 0.80 0.424 -.0273567 .0651071
yr1984c | .010743 .0269194 0.40 0.690 -.0420179 .063504
cons | .0057636 .0166077 0.35 0.729 -.0267868 .038314
------------------------------------------------------------------------------
Instruments for first differences equation
Standard
D.(yr1979c yr1980c yr1981c yr1982c yr1983c yr1984c cons)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(1/8).(L.w L.k L.n)
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -5.60 Pr > z = 0.000
Arellano-Bond test for AR(2) in first differences: z = -0.14 Pr > z = 0.891
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(79) = 125.19 Prob > chi2 = 0.001
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(79) = 88.80 Prob > chi2 = 0.211
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
iv(yr1979c yr1980c yr1981c yr1982c yr1983c yr1984c cons)
Hansen test excluding group: chi2(72) = 79.36 Prob > chi2 = 0.258
Difference (null H = exogenous): chi2(7) = 9.44 Prob > chi2 = 0.223
- b
xtabond2 n L.n L(0/1).(w k) yr*c cons, gmm(L.(w k n)) iv(yr*c cons) noleveleq robust twostep
輸出結(jié)果為:
Dynamic panel-data estimation, two-step difference GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 751
Time variable : year Number of groups = 140
Number of instruments = 91 Obs per group: min = 5
Wald chi2(12) = 909.34 avg = 5.36
Prob > chi2 = 0.000 max = 7
------------------------------------------------------------------------------
| Corrected
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .6787867 .0890781 7.62 0.000 .5041969 .8533765
|
w |
--. | -.7198296 .1221408 -5.89 0.000 -.9592211 -.4804381
L1. | .4626914 .1134755 4.08 0.000 .2402835 .6850992
|
k |
--. | .4539046 .1275537 3.56 0.000 .2039038 .7039053
L1. | -.1914923 .1044671 -1.83 0.067 -.396244 .0132595
|
yr1979c | -.0023874 .0174565 -0.14 0.891 -.0366015 .0318267
yr1980c | -.0258997 .0187008 -1.38 0.166 -.0625525 .0107532
yr1981c | -.0317158 .0239383 -1.32 0.185 -.078634 .0152024
yr1982c | .0226915 .0268209 0.85 0.398 -.0298764 .0752594
yr1983c | .0246047 .0257232 0.96 0.339 -.0258117 .0750211
yr1984c | .0105049 .0271836 0.39 0.699 -.0427738 .0637837
cons | .0052583 .0156783 0.34 0.737 -.0254706 .0359872
------------------------------------------------------------------------------
Instruments for first differences equation
Standard
D.(yr1979c yr1980c yr1981c yr1982c yr1983c yr1984c cons)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(1/8).(L.w L.k L.n)
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -4.46 Pr > z = 0.000
Arellano-Bond test for AR(2) in first differences: z = -0.17 Pr > z = 0.866
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(79) = 125.19 Prob > chi2 = 0.001
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(79) = 88.80 Prob > chi2 = 0.211
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
iv(yr1979c yr1980c yr1981c yr1982c yr1983c yr1984c cons)
Hansen test excluding group: chi2(72) = 79.36 Prob > chi2 = 0.258
Difference (null H = exogenous): chi2(7) = 9.44 Prob > chi2 = 0.223
-
SYS-GMM
eq(level)
選項(xiàng)通常也不是必需的廉白,但需要完美的模仿个初。
同樣,dpds2
是一個(gè)未記錄的選項(xiàng)猴蹂,模擬在DPD中one-step GMM的錯(cuò)誤院溺,使誤差方差的點(diǎn)估計(jì)值加倍(sig2)并影響Sargan和AR()統(tǒng)計(jì)量。
dpds2
僅用于演示xtabond2
完全匹配DPD的能力磅轻。
- a
xtabond2 n L.n L(0/1).(w k) yr1978-yr1984, gmm(L.n, split) gmm(L.(w k)) iv(yr1978-yr1984, eq(level)) h(2) dpds2 robust
輸出結(jié)果
Dynamic panel-data estimation, one-step system GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 891
Time variable : year Number of groups = 140
Number of instruments = 113 Obs per group: min = 6
Wald chi2(12) = 4921.25 avg = 6.36
Prob > chi2 = 0.000 max = 8
------------------------------------------------------------------------------
| Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .8714137 .0440549 19.78 0.000 .7850676 .9577597
|
w |
--. | -.7810899 .1159218 -6.74 0.000 -1.008292 -.5538873
L1. | .5120738 .1675084 3.06 0.002 .1837634 .8403843
|
k |
--. | .4688295 .0706695 6.63 0.000 .3303199 .6073391
L1. | -.3559805 .0718965 -4.95 0.000 -.496895 -.2150659
|
yr1978 | .0047266 .02076 0.23 0.820 -.0359621 .0454154
yr1979 | .0193132 .0245036 0.79 0.431 -.028713 .0673394
yr1980 | .0014647 .0247206 0.06 0.953 -.0469868 .0499163
yr1981 | -.0211725 .029662 -0.71 0.475 -.0793089 .0369639
yr1982 | .0148305 .0274198 0.54 0.589 -.0389113 .0685723
yr1983 | .0310377 .0255244 1.22 0.224 -.0189891 .0810646
yr1984 | .0201427 .0314874 0.64 0.522 -.0415714 .0818568
_cons | .9994287 .3899577 2.56 0.010 .2351257 1.763732
------------------------------------------------------------------------------
Instruments for first differences equation
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(1/8).(L.w L.k)
L(1/8).L.n
Instruments for levels equation
Standard
yr1978 yr1979 yr1980 yr1981 yr1982 yr1983 yr1984
_cons
GMM-type (missing=0, separate instruments for each period unless collapsed)
D.(L.w L.k)
D.L.n
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -5.98 Pr > z = 0.000
Arellano-Bond test for AR(2) in first differences: z = -0.17 Pr > z = 0.867
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(100) = 157.41 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(100) = 111.59 Prob > chi2 = 0.201
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
GMM instruments for levels
Hansen test excluding group: chi2(79) = 88.15 Prob > chi2 = 0.225
Difference (null H = exogenous): chi2(21) = 23.43 Prob > chi2 = 0.321
gmm(L.n, eq(diff) lag(1 8))
Hansen test excluding group: chi2(72) = 85.96 Prob > chi2 = 0.125
Difference (null H = exogenous): chi2(28) = 25.63 Prob > chi2 = 0.593
gmm(L.n, eq(diff) lag(1 8)) eq(level) lag(0 0))
Hansen test excluding group: chi2(93) = 106.68 Prob > chi2 = 0.157
Difference (null H = exogenous): chi2(7) = 4.91 Prob > chi2 = 0.671
gmm(L.w L.k, lag(1 .))
Hansen test excluding group: chi2(30) = 43.22 Prob > chi2 = 0.056
Difference (null H = exogenous): chi2(70) = 68.37 Prob > chi2 = 0.533
iv(yr1978 yr1979 yr1980 yr1981 yr1982 yr1983 yr1984, eq(level))
Hansen test excluding group: chi2(93) = 109.91 Prob > chi2 = 0.111
Difference (null H = exogenous): chi2(7) = 1.68 Prob > chi2 = 0.976
- b
xtabond2 n L.n L(0/1).(w k) yr1978-yr1984, gmm(L.n, split) gmm(L.(w k)) iv(yr1978-yr1984, eq(level)) h(2) robust twostep
輸出結(jié)果為:
Dynamic panel-data estimation, two-step system GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 891
Time variable : year Number of groups = 140
Number of instruments = 113 Obs per group: min = 6
Wald chi2(12) = 5912.36 avg = 6.36
Prob > chi2 = 0.000 max = 8
------------------------------------------------------------------------------
| Corrected
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
L1. | .872881 .0452841 19.28 0.000 .7841259 .9616362
|
w |
--. | -.7797449 .1165601 -6.69 0.000 -1.008199 -.5512913
L1. | .5268032 .1620827 3.25 0.001 .2091269 .8444795
|
k |
--. | .4700773 .0798591 5.89 0.000 .3135562 .6265983
L1. | -.3576081 .0800305 -4.47 0.000 -.514465 -.2007512
|
yr1978 | .0058018 .0197099 0.29 0.768 -.0328288 .0444325
yr1979 | .0188977 .0227673 0.83 0.407 -.0257254 .0635207
yr1980 | .0028196 .0240708 0.12 0.907 -.0443583 .0499976
yr1981 | -.0200226 .0274419 -0.73 0.466 -.0738078 .0337625
yr1982 | .0152802 .0233063 0.66 0.512 -.0303992 .0609597
yr1983 | .031731 .0234974 1.35 0.177 -.0143231 .0777852
yr1984 | .0224206 .0310743 0.72 0.471 -.038484 .0833251
_cons | .9484881 .3775501 2.51 0.012 .2085035 1.688473
------------------------------------------------------------------------------
Instruments for first differences equation
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(1/8).(L.w L.k)
L(1/8).L.n
Instruments for levels equation
Standard
yr1978 yr1979 yr1980 yr1981 yr1982 yr1983 yr1984
_cons
GMM-type (missing=0, separate instruments for each period unless collapsed)
D.(L.w L.k)
D.L.n
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -5.81 Pr > z = 0.000
Arellano-Bond test for AR(2) in first differences: z = -0.15 Pr > z = 0.883
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(100) = 157.41 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(100) = 111.59 Prob > chi2 = 0.201
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
GMM instruments for levels
Hansen test excluding group: chi2(79) = 88.15 Prob > chi2 = 0.225
Difference (null H = exogenous): chi2(21) = 23.43 Prob > chi2 = 0.321
gmm(L.n, eq(diff) lag(1 8))
Hansen test excluding group: chi2(72) = 85.96 Prob > chi2 = 0.125
Difference (null H = exogenous): chi2(28) = 25.63 Prob > chi2 = 0.593
gmm(L.n, eq(diff) lag(1 8)) eq(level) lag(0 0))
Hansen test excluding group: chi2(93) = 106.68 Prob > chi2 = 0.157
Difference (null H = exogenous): chi2(7) = 4.91 Prob > chi2 = 0.671
gmm(L.w L.k, lag(1 .))
Hansen test excluding group: chi2(30) = 43.22 Prob > chi2 = 0.056
Difference (null H = exogenous): chi2(70) = 68.37 Prob > chi2 = 0.533
iv(yr1978 yr1979 yr1980 yr1981 yr1982 yr1983 yr1984, eq(level))
Hansen test excluding group: chi2(93) = 109.91 Prob > chi2 = 0.111
Difference (null H = exogenous): chi2(7) = 1.68 Prob > chi2 = 0.976
重現(xiàn) Greene 書(shū)中結(jié)果
重現(xiàn) Greene, Econometric Analysis, 5th ed. p. 554例子
這里需要加載數(shù)據(jù)
并使用infile
語(yǔ)句提取文件
clear all
set mem 32m
set matsize 800
infile id year expend revenue grants using h:\macros\T7987.asc, clear
tsset id year
輸出:
panel variable: id (strongly balanced)
time variable: year, 1979 to 1987
delta: 1 unit
運(yùn)行結(jié)果
- 無(wú)設(shè)置年度虛擬變量
xi: xtabond2 expend l(1/3).(expend revenue grants) i.year, gmm(l.expend) iv(i.year) noleveleq twostep h(1)
輸出結(jié)果為:
Dynamic panel-data estimation, two-step difference GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 1325
Time variable : year Number of groups = 265
Number of instruments = 30 Obs per group: min = 5
Wald chi2(17) = 796.67 avg = 5.00
Prob > chi2 = 0.000 max = 5
------------------------------------------------------------------------------
expend | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
expend |
L1. | 1.154936 .3440941 3.36 0.001 .4805244 1.829348
L2. | -.0376625 .2267605 -0.17 0.868 -.482105 .40678
L3. | -.5644067 .2179554 -2.59 0.010 -.9915915 -.137222
|
revenue |
L1. | -1.238006 .3617064 -3.42 0.001 -1.946938 -.5290747
L2. | .0770075 .2717902 0.28 0.777 -.4556915 .6097065
L3. | .6497806 .2693003 2.41 0.016 .1219617 1.177599
|
grants |
L1. | .0163122 .824194 0.02 0.984 -1.599078 1.631703
L2. | 1.553793 .7584145 2.05 0.040 .0673281 3.040258
L3. | 1.789179 .6929651 2.58 0.010 .4309924 3.147366
|
_Iyear_1980 | 0 (omitted)
_Iyear_1981 | 0 (omitted)
_Iyear_1982 | 0 (omitted)
_Iyear_1983 | -.0036579 .0002969 -12.32 0.000 -.0042399 -.0030759
_Iyear_1984 | -.0041546 .0005716 -7.27 0.000 -.0052748 -.0030343
_Iyear_1985 | -.0037737 .0006463 -5.84 0.000 -.0050404 -.0025071
_Iyear_1986 | -.003459 .0007194 -4.81 0.000 -.0048689 -.0020491
_Iyear_1987 | -.0025902 .0006666 -3.89 0.000 -.0038968 -.0012837
------------------------------------------------------------------------------
Warning: Uncorrected two-step standard errors are unreliable.
Instruments for first differences equation
Standard
D.(_Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984 _Iyear_1985
_Iyear_1986 _Iyear_1987)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(1/8).L.expend
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -2.98 Pr > z = 0.003
Arellano-Bond test for AR(2) in first differences: z = -2.26 Pr > z = 0.024
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(13) = 39.24 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(13) = 22.83 Prob > chi2 = 0.044
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
iv(_Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984 _Iyear_1985 _Iyear_1986 _Iyear_1987)
Hansen test excluding group: chi2(8) = 7.82 Prob > chi2 = 0.451
Difference (null H = exogenous): chi2(5) = 15.01 Prob > chi2 = 0.010
- 為了完美匹配珍逸,設(shè)置一階差分為年度虛擬變量
forvalues y=1980/1987 {
gen yr`y'c = year>=`y'
}
xtabond2 expend l(1/3).(expend revenue grants) yr*c, gmm(l.expend) iv(yr*c) noleveleq twostep h(1)
輸出結(jié)果為:
Dynamic panel-data estimation, two-step difference GMM
------------------------------------------------------------------------------
Group variable: id Number of obs = 1325
Time variable : year Number of groups = 265
Number of instruments = 30 Obs per group: min = 5
Wald chi2(17) = 796.67 avg = 5.00
Prob > chi2 = 0.000 max = 5
------------------------------------------------------------------------------
expend | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
expend |
L1. | 1.154936 .3440941 3.36 0.001 .4805244 1.829348
L2. | -.0376625 .2267605 -0.17 0.868 -.482105 .40678
L3. | -.5644067 .2179554 -2.59 0.010 -.9915915 -.137222
|
revenue |
L1. | -1.238006 .3617064 -3.42 0.001 -1.946938 -.5290747
L2. | .0770075 .2717902 0.28 0.777 -.4556915 .6097065
L3. | .6497806 .2693003 2.41 0.016 .1219617 1.177599
|
grants |
L1. | .0163122 .824194 0.02 0.984 -1.599078 1.631703
L2. | 1.553793 .7584145 2.05 0.040 .0673281 3.040258
L3. | 1.789179 .6929651 2.58 0.010 .4309924 3.147366
|
yr1980c | 0 (omitted)
yr1981c | 0 (omitted)
yr1982c | 0 (omitted)
yr1983c | -.0036579 .0002969 -12.32 0.000 -.0042399 -.0030759
yr1984c | -.0004967 .0004128 -1.20 0.229 -.0013057 .0003123
yr1985c | .0003809 .0003094 1.23 0.218 -.0002255 .0009872
yr1986c | .0003147 .0003282 0.96 0.338 -.0003286 .000958
yr1987c | .0008688 .000148 5.87 0.000 .0005788 .0011588
------------------------------------------------------------------------------
Warning: Uncorrected two-step standard errors are unreliable.
Instruments for first differences equation
Standard
D.(yr1980c yr1981c yr1982c yr1983c yr1984c yr1985c yr1986c yr1987c)
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(1/8).L.expend
------------------------------------------------------------------------------
Arellano-Bond test for AR(1) in first differences: z = -2.98 Pr > z = 0.003
Arellano-Bond test for AR(2) in first differences: z = -2.26 Pr > z = 0.024
------------------------------------------------------------------------------
Sargan test of overid. restrictions: chi2(13) = 39.24 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(13) = 22.83 Prob > chi2 = 0.044
(Robust, but weakened by many instruments.)
Difference-in-Hansen tests of exogeneity of instrument subsets:
iv(yr1980c yr1981c yr1982c yr1983c yr1984c yr1985c yr1986c yr1987c)
Hansen test excluding group: chi2(8) = 7.82 Prob > chi2 = 0.451
Difference (null H = exogenous): chi2(5) = 15.01 Prob > chi2 = 0.010