xtdpdgmm:動態面板數據模型一網打盡

2021-02-15 Stata連享會

🍎 連享會主頁:lianxh.cn

New! lianxh 命令發布了:   GIF 動圖介紹
隨時搜索 Stata 推文、教程、手冊、論壇,安裝命令如下:
  . ssc install lianxh

連享會 · 最受歡迎的課


🍓 2021 Stata 寒假班
⌚ 2021 年 1.25-2.4

🌲 主講:連玉君 (中山大學);江艇 (中國人民大學)

👉 課程主頁:https://gitee.com/arlionn/PX

作者: 謝雁翔 (南開大學)
郵箱: xyxmask1995@163.com

編者按: 本文主要參考「Sebastian Kripfganz」 的如下內容,特此致謝!

Source:  Kripfganz S . XTDPDGMM: Stata module to perform generalized method of moments estimation of linear dynamic panel data models[J]. Statistical Software Components, 2019. -Link-

Kripfganz S . Generalized method of moments estimation of linear dynamic panel-data models[C]. London Stata Conference 2019. Stata Users Group, 2019. -Link-

目錄

1. 簡介

2. 估計方法

2.1 差分 GMM

2.2 水平 GMM

2.3 系統 GMM

3. xtdpdgmm 命令介紹

3.1 xtdpdgmm 命令語法

3.2 xtdpdgmm 命令實操

3.3 各估計方式呈現

4. 參考文獻

5. 相關推文


溫馨提示: 文中連結在微信中無法生效。請點擊底部「閱讀原文」。

1. 簡介

對於動態面板數據模型 (Dynamic Panel Data, DPD),直接用最小二乘法估計是有偏的,為解決這一問題,Arellano 和 Bond (1991)、 Arellano 和 Bover (1995)、以及 Blundell 和 Bond (1998) 等提出了「一階差分 GMM (FD-GMM)」和「系統 GMM (SYS-GMM)」估計法。

相應地,Stata 也提供了 xtabond、xtdpdsys、以及 xtabond2 等早期估計 GMM 的命令。Kripfganz (2019) 在此基礎上,編寫了 xtdpdgmm 命令,該命令解決了 xtabond2 等命令的一些缺陷,並使估計更加靈活。特別的,該命令整合了 Ahn 和 Schmidt (1995) 非線性矩條件、更好解決了高度自相關問題、以及提供了 Hansen 等 (1996) 的迭代 GMM 估計。

本文的主要目的是介紹動態面板數據模型的兩種估計方法,以及  xtdpdgmm 命令的應用。

2. 估計方法2.1 差分 GMM

考慮以下動態面板模型:

通過一階差分消去個體效應

然而,由於

為此,Anderson 和 Hsiao (1981) 認為由於

Arellano 和 Bond (1991) 使用所有可能的滯後變量作為工具變量 (工具變量個數可能多於內生變量) 進行估計,這一方法又被稱為「差分 GMM」。值得注意的是,在使用差分 GMM 時,擾動項

差分 GMM 注意事項:

如果

如果

不隨時間變化的變量

如果序列

2.2 水平 GMM

為克服上述差分 GMM 將不隨時間變化的變量

2.3 系統 GMM

Blundell 和 Bond (1998) 將差分 GMM 與水平 GMM 聯合進行 GMM 估計,即「系統 GMM」。與差分 GMM 相比,系統 GMM 的優點是,可以提高估計的效率,並且可以估計不隨時間變化的變量

Note:本部分內容摘自「陳強. 高級計量經濟學及 Stata 應用[M]. 高等教育出版社, 2014. -Link-」,詳見 289-291 頁,特此感謝!

3. xtdpdgmm 命令介紹3.1 xtdpdgmm 命令語法

xtdpdgmm 命令的安裝:

ssc install xtdpdgmm, replace

xtdpdgmm 命令的語法:

 xtdpdgmm depvar [indepvars] [if] [in] [, options]

其中,option 具體選項如下:

iv(iv_spec):指定標準式工具變量,並可指定任意多次;gmmiv(gmmiv_spec):指定 GMM 式工具變量,並可指定任意多次;nl (nl_spec):添加由誤差協方差結構得出的非線性矩條件;collapse:摺疊式工具變量為標準式工具變量;model(model_spec):設置工具變量的默認形式及標準誤;wmatrix(wmat_spec):指定用於獲得一階 GMM 估計或兩步 GMM 估計的初始估計的加權矩陣;onestep|twostep:確定一步估計或兩步估計;vce(vce_spec):設置聚類標準誤的估計方式進行穩健標準誤估計;level(#):設置置信區間,默認為水平為 95%;display_options:控制列和列的格式,行間距,行寬,需要省略的變量以及基礎空白單元格、因子變量的標記;from(init_spec):確定係數的初始值;nodots:在迭代 GMM 估計中的每個步驟中顯示迭代日誌,而不是點;igmm_options:控制迭代的 GMM 過程;minimize_options:控制最小化過程。3.2 xtdpdgmm 命令實操

以 abdata.dta 數據集為例,該數據集是 140 個國家 1976 年到 1984 年的各種宏觀指標的面板數據。id 代表每個國家的標號,year 代表年份,其他變量包括就業率 emp、平均工資 wage、投資佔 GDP 的百分比 cap 等。

*數據下載地址:https://gitee.com/arlionn/data/blob/master/data01/abdata.dta
*use abdata.dta, clear
webuse abdata //調用網絡數據
describe //數據結構
sum //描述性統計
xtset id year //聲明面板數據

一階差分 GMM 估計:

xtdpdgmm L(0/1).n w k, model(diff) gmm(n, lag(2 .)) gmm(w, lag(1 .)) gmm(k, lag(. .)) nocons

note: standard errors may not be valid

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = .01960406

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 126 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 126 max = 8

---
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .4144164 .0341502 12.14 0.000 .3474833 .4813495
|
w | -.8292293 .0588914 -14.08 0.000 -.9446543 -.7138042
k | .3929936 .0223829 17.56 0.000 .3491239 .4368634
---
Instruments corresponding to the linear moment conditions:
1, model(diff):
1978:L2.n 1979:L2.n 1980:L2.n 1981:L2.n 1982:L2.n 1983:L2.n 1984:L2.n
1979:L3.n 1980:L3.n 1981:L3.n 1982:L3.n 1983:L3.n 1984:L3.n 1980:L4.n
1981:L4.n 1982:L4.n 1983:L4.n 1984:L4.n 1981:L5.n 1982:L5.n 1983:L5.n
1984:L5.n 1982:L6.n 1983:L6.n 1984:L6.n 1983:L7.n 1984:L7.n 1984:L8.n
2, model(diff):
1978:L1.w 1979:L1.w 1980:L1.w 1981:L1.w 1982:L1.w 1983:L1.w 1984:L1.w
1978:L2.w 1979:L2.w 1980:L2.w 1981:L2.w 1982:L2.w 1983:L2.w 1984:L2.w
1979:L3.w 1980:L3.w 1981:L3.w 1982:L3.w 1983:L3.w 1984:L3.w 1980:L4.w
1981:L4.w 1982:L4.w 1983:L4.w 1984:L4.w 1981:L5.w 1982:L5.w 1983:L5.w
1984:L5.w 1982:L6.w 1983:L6.w 1984:L6.w 1983:L7.w 1984:L7.w 1984:L8.w
3, model(diff):
1978:F6.k 1978:F5.k 1979:F5.k 1978:F4.k 1979:F4.k 1980:F4.k 1978:F3.k
1979:F3.k 1980:F3.k 1981:F3.k 1978:F2.k 1979:F2.k 1980:F2.k 1981:F2.k
1982:F2.k 1978:F1.k 1979:F1.k 1980:F1.k 1981:F1.k 1982:F1.k 1983:F1.k
1978:k 1979:k 1980:k 1981:k 1982:k 1983:k 1984:k 1978:L1.k 1979:L1.k
1980:L1.k 1981:L1.k 1982:L1.k 1983:L1.k 1984:L1.k 1978:L2.k 1979:L2.k
1980:L2.k 1981:L2.k 1982:L2.k 1983:L2.k 1984:L2.k 1979:L3.k 1980:L3.k
1981:L3.k 1982:L3.k 1983:L3.k 1984:L3.k 1980:L4.k 1981:L4.k 1982:L4.k
1983:L4.k 1984:L4.k 1981:L5.k 1982:L5.k 1983:L5.k 1984:L5.k 1982:L6.k
1983:L6.k 1984:L6.k 1983:L7.k 1984:L7.k 1984:L8.k

差分 GMM 兩步估計:

xtdpdgmm L(0/1).n w k, model(diff) gmm(n, lag(2 .)) gmm(w, lag(1 .)) gmm(k, lag(. .)) nocons two vce(r) nofootnote

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = .01960406
Step 2 f(b) = .90967907

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 126 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 126 max = 8

(Std. Err. adjusted for 140 clusters in id)
---
| WC-Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .4126102 .0740255 5.57 0.000 .2675228 .5576976
|
w | -.8271943 .0944749 -8.76 0.000 -1.012362 -.6420268
k | .3931545 .0484993 8.11 0.000 .2980975 .4882114
---

*序列相關檢驗
estat serial

Arellano-Bond test for autocorrelation of the first-differenced residuals
H0: no autocorrelation of order 1: z = -3.8127 Prob > |z| = 0.0001
H0: no autocorrelation of order 2: z = -0.8686 Prob > |z| = 0.3851

*過度識別檢驗
estat overid

Sargan-Hansen test of the overidentifying restrictions
H0: overidentifying restrictions are valid

2-step moment functions, 2-step weighting matrix chi2(123) = 127.3551
Prob > chi2 = 0.3757

2-step moment functions, 3-step weighting matrix chi2(123) = 127.6358
Prob > chi2 = 0.3691

差分 GMM 與系統 GMM 對比:

*差分 GMM
xtdpdgmm L(0/1).n w k, model(diff) collapse gmm(n, lag(2 4)) gmm(w, lag(1 3)) gmm(k, lag(0 2)) nocons two vce(r)
estat serial, ar(1/3)
estat overid

*系統 GMM
xtdpdgmm L(0/1).n w k, model(diff) collapse gmm(n, lag(2 4)) gmm(w k, lag(1 3)) gmm(n, lag(1 1) diff model(level)) gmm(w k, lag(0 0) diff model(level)) two vce(r)
estat serial, ar(1/3)
estat overid

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = .0006272
Step 2 f(b) = .08562737

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 9 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 9 max = 8

(Std. Err. adjusted for 140 clusters in id)
---
| WC-Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .3564619 .1074848 3.32 0.001 .1457956 .5671281
|
w | -1.432958 .2141048 -6.69 0.000 -1.852595 -1.01332
k | .2860594 .0541221 5.29 0.000 .1799821 .3921367
---
Instruments corresponding to the linear moment conditions:
1, model(diff):
L2.n L3.n L4.n
2, model(diff):
L1.w L2.w L3.w
3, model(diff):
k L1.k L2.k

Arellano-Bond test for autocorrelation of the first-differenced residuals
H0: no autocorrelation of order 1: z = -2.6865 Prob > |z| = 0.0072
H0: no autocorrelation of order 2: z = -0.9414 Prob > |z| = 0.3465
H0: no autocorrelation of order 3: z = -0.3256 Prob > |z| = 0.7447

Sargan-Hansen test of the overidentifying restrictions
H0: overidentifying restrictions are valid

2-step moment functions, 2-step weighting matrix chi2(6) = 11.9878
Prob > chi2 = 0.0622

2-step moment functions, 3-step weighting matrix chi2(6) = 12.8283
Prob > chi2 = 0.0458

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = .00285146
Step 2 f(b) = .11568719

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 13 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 13 max = 8

(Std. Err. adjusted for 140 clusters in id)
---
| WC-Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .5117523 .1208484 4.23 0.000 .2748937 .7486109
|
w | -1.323125 .2383451 -5.55 0.000 -1.790273 -.855977
k | .1931365 .0941343 2.05 0.040 .0086367 .3776363
_cons | 4.698425 .7943584 5.91 0.000 3.141511 6.255339
---
Instruments corresponding to the linear moment conditions:
1, model(diff):
L2.n L3.n L4.n
2, model(diff):
L1.w L2.w L3.w L1.k L2.k L3.k
3, model(level):
L1.D.n
4, model(level):
D.w D.k
5, model(level):
_cons

Arellano-Bond test for autocorrelation of the first-differenced residuals
H0: no autocorrelation of order 1: z = -3.3341 Prob > |z| = 0.0009
H0: no autocorrelation of order 2: z = -1.2436 Prob > |z| = 0.2136
H0: no autocorrelation of order 3: z = -0.1939 Prob > |z| = 0.8462

Sargan-Hansen test of the overidentifying restrictions
H0: overidentifying restrictions are valid

2-step moment functions, 2-step weighting matrix chi2(9) = 16.1962
Prob > chi2 = 0.0629

2-step moment functions, 3-step weighting matrix chi2(9) = 13.8077
Prob > chi2 = 0.1293

3.3 各估計方式呈現

具有嚴格外生變量的 Anderson-Hsiao IV 估計:

xtdpdgmm L(0/1).n w k, iv(L2.n w k, d) m(d) nocons
xtdpdgmm L(0/1).n w k, iv(L2.n) iv(w k, d) m(d) nocons

note: standard errors may not be valid

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = 1.000e-32

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 3 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 3 max = 8

---
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .1512874 .1313926 1.15 0.250 -.1062374 .4088122
|
w | -.5149142 .0512699 -10.04 0.000 -.6154013 -.4144271
k | .4141651 .0468689 8.84 0.000 .3223038 .5060264
---
Instruments corresponding to the linear moment conditions:
1, model(diff):
D.L2.n D.w D.k

note: standard errors may not be valid

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = 3.096e-32

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 3 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 3 max = 8

---
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | 1.093635 .1414757 7.73 0.000 .816348 1.370922
|
w | -.5565656 .0762891 -7.30 0.000 -.7060895 -.4070417
k | .1353903 .0560407 2.42 0.016 .0255525 .2452282
---
Instruments corresponding to the linear moment conditions:
1, model(diff):
L2.n
2, model(diff):
D.w D.k

具有嚴格外生變量和工具變量約束的 Arellano-Bond 一步 GMM 估計:

xtdpdgmm L(0/1).n w k, gmm(L.n, l(1 4) c) iv(w k, d) m(d) nocons

  note: standard errors may not be valid

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = .00130087

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 6 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 6 max = 8

---
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .8602906 .0979689 8.78 0.000 .6682752 1.052306
|
w | -.5922287 .065327 -9.07 0.000 -.7202672 -.4641902
k | .2072601 .0434627 4.77 0.000 .1220748 .2924454
---
Instruments corresponding to the linear moment conditions:
1, model(diff):
L1.L.n L2.L.n L3.L.n L4.L.n
2, model(diff):
D.w D.k

具有前定變量和工具變量約束的 Arellano-Bover 兩步 GMM 估計:

xtdpdgmm L(0/1).n w k, gmm(L.n w k, l(0 3) c) m(fod) two vce(r)

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = .00317868
Step 2 f(b) = .11805918

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 13 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 13 max = 8

(Std. Err. adjusted for 140 clusters in id)
---
| WC-Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .4582898 .1314203 3.49 0.000 .2007107 .7158688
|
w | -1.607401 .3437998 -4.68 0.000 -2.281237 -.9335663
k | .0878702 .1647289 0.53 0.594 -.2349925 .4107329
_cons | 5.644924 1.001522 5.64 0.000 3.681976 7.607871
---
Instruments corresponding to the linear moment conditions:
1, model(fodev):
L.n L1.L.n L2.L.n L3.L.n w L1.w L2.w L3.w k L1.k L2.k L3.k
2, model(level):
_cons

具有前定變量和工具變量約束的 Ahn-Schmidt 兩步 GMM 估計:

xtdpdgmm L(0/1).n w k, gmm(L.n w k, l(1 4) c) m(d) nl(noser) two vce(r)
xtdpdgmm L(0/1).n w k, gmm(L.n w k, l(1 4) c) m(d) nl(iid) two vce(r)

Generalized method of moments estimation

Fitting full model:

Step 1:
initial: f(b) = 6.9689895
alternative: f(b) = 1.9358147
rescale: f(b) = .09404104
Iteration 0: f(b) = .09404104
Iteration 1: f(b) = .00092528
Iteration 2: f(b) = .00073988
Iteration 3: f(b) = .00073977
Iteration 4: f(b) = .00073977

Step 2:
Iteration 0: f(b) = .1213722
Iteration 1: f(b) = .10323966
Iteration 2: f(b) = .10315659
Iteration 3: f(b) = .103154
Iteration 4: f(b) = .1031539

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 13 Obs per group: min = 6
nonlinear = 6 avg = 6.364286
total = 19 max = 8

(Std. Err. adjusted for 140 clusters in id)
---
| WC-Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .4304133 .1198004 3.59 0.000 .1956088 .6652178
|
w | -1.41989 .2825341 -5.03 0.000 -1.973647 -.8661332
k | .1917874 .1248583 1.54 0.125 -.0529303 .4365051
_cons | 5.112359 .8521958 6.00 0.000 3.442086 6.782632
---
Instruments corresponding to the linear moment conditions:
1, model(diff):
L1.L.n L2.L.n L3.L.n L4.L.n L1.w L2.w L3.w L4.w L1.k L2.k L3.k L4.k
2, model(level):
_cons

Generalized method of moments estimation

Fitting full model:

Step 1:
initial: f(b) = 7.1763841
alternative: f(b) = 2.0088687
rescale: f(b) = .10682203
Iteration 0: f(b) = .10682203
Iteration 1: f(b) = .00313745
Iteration 2: f(b) = .00214453
Iteration 3: f(b) = .00213797
Iteration 4: f(b) = .00213795

Step 2:
Iteration 0: f(b) = .22634011
Iteration 1: f(b) = .18572491
Iteration 2: f(b) = .18339137
Iteration 3: f(b) = .18323575
Iteration 4: f(b) = .18322289
Iteration 5: f(b) = .18322171
Iteration 6: f(b) = .1832216

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 19 Obs per group: min = 6
nonlinear = 7 avg = 6.364286
total = 26 max = 8

(Std. Err. adjusted for 140 clusters in id)
---
| WC-Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .3162345 .1040268 3.04 0.002 .1123458 .5201233
|
w | -1.225117 .2050917 -5.97 0.000 -1.62709 -.8231451
k | .3370022 .1265224 2.66 0.008 .0890228 .5849816
_cons | 4.729435 .6060333 7.80 0.000 3.541632 5.917239
---
Instruments corresponding to the linear moment conditions:
1, model(iid):
1978:L.n 1979:L.n 1980:L.n 1981:L.n 1982:L.n 1983:L.n
2, model(diff):
L1.L.n L2.L.n L3.L.n L4.L.n L1.w L2.w L3.w L4.w L1.k L2.k L3.k L4.k
3, model(level):
_cons

具有前定變量和工具變量約束的 Blundell-Bond 兩步 GMM 估計:

xtdpdgmm L(0/1).n w k, gmm(L.n w k, l(1 4) c m(d)) iv(L.n w k, d) two vce(r)

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = .00329575
Step 2 f(b) = .16391388

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 16 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 16 max = 8

(Std. Err. adjusted for 140 clusters in id)
---
| WC-Robust
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .4695086 .1167909 4.02 0.000 .2406028 .6984145
|
w | -1.287266 .2672931 -4.82 0.000 -1.811151 -.7633817
k | .2172426 .0913599 2.38 0.017 .0381805 .3963046
_cons | 4.633068 .8721846 5.31 0.000 2.923618 6.342518
---
Instruments corresponding to the linear moment conditions:
1, model(diff):
L1.L.n L2.L.n L3.L.n L4.L.n L1.w L2.w L3.w L4.w L1.k L2.k L3.k L4.k
2, model(level):
D.L.n D.w D.k
3, model(level):
_cons

具有前定變量的 Hayakawa-Qi-Breitung IV 估計量:

xtdpdgmm L(0/1).n w k, iv(L.n w k, bod) m(fod) nocons

note: standard errors may not be valid

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = 1.737e-33

Group variable: id Number of obs = 891
Time variable: year Number of groups = 140

Moment conditions: linear = 3 Obs per group: min = 6
nonlinear = 0 avg = 6.364286
total = 3 max = 8

---
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
n |
L1. | .4698431 .1508717 3.11 0.002 .1741401 .7655461
|
w | -.682973 .3756931 -1.82 0.069 -1.419318 .0533719
k | -.1261108 .339384 -0.37 0.710 -.7912913 .5390696
---
Instruments corresponding to the linear moment conditions:
1, model(fodev):
B.L.n B.w B.k

方法: 固定效應模型、FM 估計、動態面板、穩健性檢驗、衡量偏誤問題
直接聽課 | 課件展示:https://gitee.com/arlionn/paper101

複製靜態 (加權) 固定效應估計:

xtdpdgmm n w k, iv(w k) m(md)
by id: egen weight = count(e(sample))
replace weight = sqrt(weight/(weight-1))
xtreg n w k [aw=weight], fe

note: standard errors may not be valid

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = 2.557e-25

Group variable: id Number of obs = 1031
Time variable: year Number of groups = 140

Moment conditions: linear = 3 Obs per group: min = 7
nonlinear = 0 avg = 7.364286
total = 3 max = 9

---
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
w | -.3666355 .0522024 -7.02 0.000 -.4689504 -.2643207
k | .6407201 .0200955 31.88 0.000 .6013336 .6801065
_cons | 2.491261 .1627504 15.31 0.000 2.172276 2.810246
---
Instruments corresponding to the linear moment conditions:
1, model(mdev):
w k
2, model(level):
_cons

(1,031 real changes made)

Fixed-effects (within) regression Number of obs = 1,031
Group variable: id Number of groups = 140

R-sq: Obs per group:
within = 0.5707 min = 7
between = 0.8466 avg = 7.4
overall = 0.8341 max = 9

F(2,889) = 590.79
corr(u_i, Xb) = 0.4345 Prob > F = 0.0000

---
n | Coef. Std. Err. t P>|t| [95% Conf. Interval]
---+----
w | -.3666355 .0522948 -7.01 0.000 -.4692711 -.2639999
k | .6407201 .0201368 31.82 0.000 .6011988 .6802413
_cons | 2.492481 .163067 15.29 0.000 2.17244 2.812523
---+----
sigma_u | .58858668
sigma_e | .13719403
rho | .94846853 (fraction of variance due to u_i)
---
F test that all u_i=0: F(139, 889) = 110.65 Prob > F = 0.0000

複製靜態 (未加權) 固定效應估計:

xtdpdgmm n w k, iv(w k) m(md) nores
xtreg n w k, fe

note: standard errors may not be valid

Generalized method of moments estimation

Fitting full model:
Step 1 f(b) = 4.270e-25

Group variable: id Number of obs = 1031
Time variable: year Number of groups = 140

Moment conditions: linear = 3 Obs per group: min = 7
nonlinear = 0 avg = 7.364286
total = 3 max = 9

---
n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---+----
w | -.367774 .0522015 -7.05 0.000 -.470087 -.2654611
k | .6403675 .020095 31.87 0.000 .6009819 .679753
_cons | 2.494684 .1627475 15.33 0.000 2.175704 2.813663
---
Instruments corresponding to the linear moment conditions:
1, model(mdev):
w k
2, model(level):
_cons

Fixed-effects (within) regression               Number of obs     =      1,031
Group variable: id Number of groups = 140

R-sq: Obs per group:
within = 0.5704 min = 7
between = 0.8466 avg = 7.4
overall = 0.8341 max = 9

F(2,889) = 590.13
corr(u_i, Xb) = 0.4352 Prob > F = 0.0000

---
n | Coef. Std. Err. t P>|t| [95% Conf. Interval]
---+----
w | -.367774 .0523227 -7.03 0.000 -.4704645 -.2650835
k | .6403675 .0201417 31.79 0.000 .6008366 .6798984
_cons | 2.494684 .1631256 15.29 0.000 2.174527 2.81484
---+----
sigma_u | .58883268
sigma_e | .1372825
rho | .94844636 (fraction of variance due to u_i)
---
F test that all u_i=0: F(139, 889) = 110.72 Prob > F = 0.0000

4. 參考文獻

溫馨提示: 文中連結在微信中無法生效。請點擊底部「閱讀原文」。

Ahn, S. C., and P. Schmidt. 1995.  Efficient estimation of models for dynamic panel data.  Journal of Econometrics 68: 5-27. -Link-Anderson, T. W., and C. Hsiao. 1981.  Estimation of dynamic models with error components.  Journal of the American Statistical Association 76: 598-606. -Link-Arellano, M., and S. R. Bond. 1991.  Some tests of specification for panel data: Monte Carlo evidence and an application to employment equations.  Review of Economic Studies 58: 277-297. -Link-Arellano, M., and O. Bover. 1995.  Another look at the instrumental variable estimation of error-components models.  Journal of Econometrics 68: 29-51. -Link-Blundell, R., and S. R. Bond. 1998.  Initial conditions and moment restrictions in dynamic panel data models.  Journal of Econometrics 87: 115-143. -Link-Hansen, L. P., J. Heaton, and A. Yaron. 1996.  Finite-sample properties of some alternative GMM estimators.  Journal of Business & Economic Statistics 14: 262-280. -Link-Hayakawa, K., M. Qi, and J. Breitung. 2019.  Double filter instrumental variable estimation of panel data models with weakly exogenous variables.  Econometric Reviews 38: 1055-1088. -Link-Kiviet, J. F. 2020.  Microeconometric dynamic panel data methods: Model specification and selection issues.  Econometrics and Statistics 13: 16-45. -Link-Kripfganz, S., and C. Schwarz. 2019.  Estimation of linear dynamic panel data models with time-invariant regressors.  Journal of Applied Econometrics 34: 526-546. -Link-Roodman, D. 2009.  A note on the theme of too many instruments.  Oxford Bulletin of Economics and Statistics 71: 135-158. -Link-Windmeijer, F. 2005.  A finite sample correction for the variance of linear efficient two-step GMM estimators.  Journal of Econometrics 126: 25-51. -Link-

5. 相關推文

Note: 產生如下推文列表的命令為:
  lianxh 動態面板 過度識別 GMM IV, m
安裝最新版 lianxh 命令:
  ssc install lianxh, replace

溫馨提示: 文中連結在微信中無法生效。請點擊底部「閱讀原文」。

Sargan+Hansen:過度識別檢驗及Stata實現IV-工具變量法:第一階段係數符號確定時的小樣本無偏估計IV 經典:尋找 IV 的足跡——Card(1993)Abadie新作:簡明IV,DID,RDD教程和綜述

連享會 · 最受歡迎的課


🍓 2021 Stata 寒假班
⌚ 2021 年 1.25-2.4

🌲 主講:連玉君 (中山大學);江艇 (中國人民大學)

👉 課程主頁:https://gitee.com/arlionn/PX

關於我們

🍎 連享會 ( 主頁:lianxh.cn ) 由中山大學連玉君老師團隊創辦,定期分享實證分析經驗。👉 直達連享會:百度一下:連享會】即可直達連享會主頁。亦可進一步添加 主頁,知乎,面板數據,研究設計 等關鍵詞細化搜索。

New! lianxh 命令發布了:    GIF 動圖介紹
隨時搜索連享會推文、Stata 資源,安裝命令如下:
  . ssc install lianxh
使用詳情參見幫助文件 (有驚喜):
  . help lianxh

相關焦點

  • xtdpdgmm:動態面板模型
    簡介對於動態面板數據模型 (Dynamic Panel Data, DPD),直接用最小二乘法估計是有偏的,為解決這一問題,Arellano 和 Bond (1991)、 Arellano 和 Bover (1995)、以及 Blundell 和 Bond (1998) 等提出了「一階差分 GMM (FD-GMM)」和「系統 GMM (SYS-GMM
  • Stata實操陷阱:動態面板數據模型
    問題背景關於動態面板數據模型 (dynamic panel data,DPD),我們常常會遇到如下問題:當解釋變量中含有內生變量時,應該如何對模型進行估計;接下來,本文將對上述問題提出對應的解決方案。2.
  • Stata: 面板數據模型-一文讀懂
    常見的數據形式有時間序列數據( Time series data ),截面數據( Cross-sectional data )和面板數據( Panel data )。從維度來看,時間序列數據和截面數據均為一維。面板數據可以看做為時間序列與截面混合數據,因此它是二維數據。數據形式如下:
  • 面板數據門限回歸模型
    但是對於大樣本、面板數據如何尋找結構突變點。所以本文在此講解面板門限回歸的問題,門限回歸也適用於時間序列(文章後面將介紹stata15.0新命令進行時間序列的門限回歸)。門限效應,是指當一個經濟參數達到特定的數值後,引起另外一個經濟參數發生突然轉向其它發展形式的現象(結構突變)。
  • 如何進行面板數據分析?
    導讀 面板數據也被稱作時間序列與截面混合數據。是截面上個體在不同時點重複觀測數據。面板數據分析就是根據面板數據進行分析得出相應對於時間以及重複概率的結論。
  • 面板數據模型選擇問題
    1 面板數據模型選擇問題
  • 用Stata搞實證之面板模型入門
    :整個中國2010至2020年的GDP而第三種數據結構便是面板數據,實際上就是橫截面數據和時間序列數據的結合值得注意的是,不同軟體輸入面板數據的格式不一樣,我只推薦Stata來處理這些數據,因為真的對新手很友好面板數據可以在excel整理好,直接粘貼到Stata以北京上海和廣州3個城市2010至2016年的人口,地區生成總值和商品房均價為例,在excel裡的整理如下:可以看到,
  • 面板數據(Panel Data)匯總
    協整檢驗方法的文獻綜述:(1)Kao(1999)、Kao and Chiang(2000)利用推廣的DF和ADF檢驗提出了檢驗面板協整的方法,這種方法零假設是沒有協整關係,並且利用靜態面板回歸的殘差來構建統計量。(2)Pedron(1999)在零假設是在動態多元面板回歸中沒有協整關係的條件下給出了七種基於殘差的面板協整檢驗方法。
  • 面板數據主要分析方法匯總
    ,面板數據模型在回歸前需檢驗數據的平穩性。協整檢驗方法的文獻綜述:(1)Kao(1999)、Kao and Chiang(2000)利用推廣的DF和ADF檢驗提出了檢驗面板協整的方法,這種方法零假設是沒有協整關係,並且利用靜態面板回歸的殘差來構建統計量。(2)Pedron(1999)在零假設是在動態多元面板回歸中沒有協整關係的條件下給出了七種基於殘差的面板協整檢驗方法。
  • xtseqreg:面板模型如何估計不隨時間變化的變量
    問題背景在常見的固定效應靜態面板模型中,非時變的變量由於與個體固定效應完全共線性,無法估計出係數,在 Stata 中會直接匯報 omitted。另一方面,在動態面板模型中,我們一般使用 GMM 估計方法。
  • stata 面板數據攻略
    3、定義面板數據,輸入以下命令:. xtset province year  4、單位根檢驗    面板數據的單位根檢驗方法有很多種,一般我們只選兩種,即相同根單位根檢驗和不同根單位根檢驗。如果數據是平衡的,則可使用LLC檢驗(適用於同根)和IPS檢驗(適用於不同根)。
  • DCC-GARCH:動態條件相關係數模型
    方法: 固定效應模型、FM 估計、動態面板、穩健性檢驗、衡量偏誤問題直接聽課 | 課件展示:https://gitee.com/arlionn/paper101針對這個問題,Engle (2002) 提出了動態條件相關 GARCH 模型,簡記為:DCC-MGARCH 模型,模型的設定如下:
  • Stata:面板分位數模型估計及內生性初探
    結合分位數回歸與面板數據,採用分位數回歸的方法對面板數據變量的參數進行估計,不僅能夠更好的控制個體的異質性,以緩解遺漏變量導致的內生性問題;還夠分析在特定的分位數處自變量對因變量的邊際效應,使我們得以從多個維度進行分析。接下來我們將介紹面板分位數回歸模型的兩種形式,並主要展示固定效應面板分位數回歸模型的估計。
  • Stata數據統計分析及模型應用核心技術與應用培訓
    STATA不僅可以實現諸多的統計分析方法,如單元統計、多元統計等內容;還包括了許多經典和前沿的計量模型,如單方程回歸模型、離散選擇模型、分位數回歸、時間序列分析、面板數據分析、蒙特卡洛模擬和自舉法等。   主講教師   王群勇,經濟學博士,南開大學數量經濟研究所教授、博士生導師,天津市數量經濟學會秘書長。美國堪薩斯大學經濟系訪問學者。
  • 【重發】面板門檻模型-stata命令xthreg介紹
    如果模型的研究對象包含多個個體、多個年度,那麼就是面板門檻模型。    目前,Stata14沒有官方命令可以估計門檻模型或者面板門檻模型,最新的Stata15加入了估計門檻模型的功能,但依然不能估計面板門檻模型。所以,一般我們還是藉助外部命令,在Stata14版本下估計面板門檻模型。一、命令介紹目前面板門限回歸有兩個命令。
  • Nuleic Acids Res:三維基因組數據的動態染色質可接近性模型
    在此項研究中,李程研究組使用基於 Hi- C 數據的染色質區域間的相對空間距離,利用布朗運動描述轉錄因子和染色質修飾蛋白在不同染色質區域之間的動態轉移過程,並以此建立了染色質區域附近分子濃度變化和趨於穩定的馬爾可夫模型。
  • 【Stata教程】如何用Stata分析面板數據
    在計量研究中,用於實證分析的數據主要有時間序列數據、橫截面數據以及面板數據。
  • 門檻回歸模型完全攻略
    在Hansen(1999)的模型中,解釋變量中不能包含內生解釋變量,無法擴展應用領域。Caner和Hansen在2004年解決了這個問題。他們研究了帶有內生變量和一個外生門限變量的面板門限模型。與靜態面板數據門限回歸模型有所不同,在含有內生解釋變量的面板數據門限回歸模型中,需要利用簡化型對內生變量進行一定的處理,然後用2SLS(兩階段最小二乘法)或者GMM(廣義矩估計)對參數進行估計。
  • 門檻回歸模型系列講解(二):門檻回歸模型完全攻略
    但是對於大樣本、面板數據如何尋找結構突變點。所以本文在此講解面板門限回歸的問題,門限回歸也適用於時間序列。、門限效應,是指當一個經濟參數達到特定的數值後,引起另外一個經濟參數發生突然轉向其它發展形式的現象(結構突變)。作為原因現象的臨界值稱為門限值。例如,成果和時間存在非線性關係,但是在每個階段是線性關係。有些人將這樣的模型稱為門檻模型,或者門限模型。
  • 實證分析三步走:數據、模型還有結果檢驗
    Stock 等在其流行的計量經濟學教科書的第八章中有一個經典例子: 運用美國各州的截面數據發現啤酒稅的高低和交通事故率之間存在奇怪的正相關關係。但是,運用固定效應模型的面板數據後,這個相關關係變成了顯著的負相關。這是因為各州對酒駕的態度不一樣,截面數據模型無法控制這個變量,而導致了內生性問題; 而面板數據能夠通過控制州的效果而去除這個變量的影響。