浙江大学【面板数据分析与STATA应用】——第四讲动态面板数据类型
國際頂級期刊的編輯非常重視內生性問題,一定要處理好內生性問題,03講了工具變量,本講中通過動態面板數據能夠較好處理內生性問題。
動態面板數據
動態面板數據(Dynamic Panel Data,DPD):是指在面板模型中,解釋變量包含了被假釋變量的滯后值。在動態面板數據類型中被解釋變量和上一期變量之間存在關系。即,yi,ty_{i,t}yi,t?與yi,t?1y_{i,t-1}yi,t?1?之間是有關系的,上一期的值決定著下一期的值。
動態面板數據模型的設定是在原有的靜態面板數據模型的基礎上引入被解釋變量的滯后期,而其他的都相同。
其中,uitu_{it}uit?為復合誤差項,uitu_{it}uit? = μi\mu_{i}μi? + vitv_{it}vit?,vitv_{it}vit?為隨機擾動項,μi\mu_{i}μi?為不可觀測的個體效應。可以很容易的看出,模型中yi,t?1y_{i,t-1}yi,t?1?是一個內生變量,模型存在內生性問題,所以使用傳統的最小二乘進行估計,估計結果是有偏且不一致的。
對上述動態面板數據模型進行擬合估計:首先進行一階差分將原始模型中的不可觀測的個體效應μi\mu_{i}μi?去除,得到差分后的模型為:
由于Δyi,t?1\Delta{y_{i,t-1}}Δyi,t?1?與 εi,t?1\varepsilon_{i,t-1}εi,t?1?相關,所以Δyi,t?1\Delta{y_{i,t-1}}Δyi,t?1?與 Δεi,t?1\Delta\varepsilon_{i,t-1}Δεi,t?1?是相關的,所以一階差分后的動態面板數據模型仍存在內生性問題。Anderson等人在1982年提出了一種為差分變量 yi,t?1{y_{i,t-1}}yi,t?1? - yi,t?2{y_{i,t-2}}yi,t?2?尋找工具變量的方法。這個工具變量為yi,t?2{y_{i,t-2}}yi,t?2?。由于差分變量本身包含著yi,t?2{y_{i,t-2}}yi,t?2?,所以工具變量和內生變量存在高度的相關性,在誤差項εi,t\varepsilon_{i,t}εi,t?不存在自相關的前提下,工具變量yi,t?2{y_{i,t-2}}yi,t?2?與誤差項的差分εi,t\varepsilon_{i,t}εi,t? - εi,t?1\varepsilon_{i,t-1}εi,t?1?不相關,因此,yi,t?2{y_{i,t-2}}yi,t?2? 滿足工具變量的條件。需要注意的是,yi,t?2{y_{i,t-2}}yi,t?2?并不是唯一的工具變量,被解釋變量滯后三期、四期(即,yi,t?3{y_{i,t-3}}yi,t?3?,yi,t?4{y_{i,t-4}}yi,t?4?)都滿足工具變量的條件。
同時,他們認為這種相當于兩階段最小二乘估計的結果雖然是一致的,但卻并不是有效的,因為他們沒有充分利用樣本里的所有信息,于是他們提出了使用更多工具變量的**廣義矩估計方法(GMM)**來進行動態面板數據模型的估計,工具變量來自更多的滯后期。
廣義矩估計GMM
動態面板數據模型的GMM估計方法又可以分為兩種,即差分GMM(DIF-GMM)和系統GMM(SYS-GMM)估計方法。
需要注意的是,差分GMM和系統GMM方法主要適用于短動態面板數據。這是因為,雖然基于IV或GMM的估計方法是一致估計量(即當 n→∞n\to\inftyn→∞時,沒有偏差),但對于nnn較小而TTT較大的長面板則可能存在較嚴重的偏差。對于長動態面板數據模型的估計可以使用“偏差校正LSDV法”進行估計。
差分GMM的基本思路是:對基本模型進行一階差分以去除固定效應的影響,然后,用一組滯后的解釋變量作為差分方程中相應變量的工具變量。
Blundell和Bond兩位作者認為,差分GMM的估計量較易受弱工具變量的影響而產生向下的大的有限樣本偏差。為了克服這一問題,Blundell和Bond提出了系統廣義矩估計即系統GMM估計方法。
系統GMM估計方法是基于差分GMM之上形成的,結合了差分方程和水平方程,此外,還增加了一組滯后的差分變量作為水平方程相應的工具變量,更具有系統性。
相對來說,系統GMM估計量具有更好的有限樣本性質。
系統GMM估計方法的前提假定是:工具變量的一階差分與固定效應項不相關。然而,到目前為止,并沒有方法能夠對這一個假定進行檢驗。
此外,使用系統GMM估計方法的條件是:
(1)大N小T,即短面板數據;
(2)線性函數關系,構造的計量模型要求是線性的;
(3)方程等號左邊的變量作為動態變量;
(4)方程等號右邊的變量并不是嚴格外生的;
(5)控制個體固定效應;
(6)默認不存在截面相關問題,并且建議采用雙向固定效應。
時間虛擬變量的引入可以使誤差項的截面相關變得不相關,所以在模型設定中盡可能地引入時間虛擬變量以減少截面相關的可能。
在理論層面,GMM估計量(差分GMM、系統GMM)的一致性關鍵取決于各項假設條件是否滿足,這需要進行兩個假設檢驗。
(1)通過Hansen過度識別約束檢驗對所使用的工具變量的有效性進行檢驗,此檢驗的原假設是所使用的工具變量與誤差項是不相關的。
(2)通過Arellano-Bond的自相關檢驗方法對差分方程的隨機誤差項的二階序列相關進行檢驗,其原假設是一階差分方程的隨機誤差項中不存在二階序列相關。如果不拒絕原假設則意味著工具變量有效和模型設定正確。
stata操作
數據集
使用英國140家企業1976~1984年的數據來研究就業數據abdata.dta,是非平衡面板,被解釋變量為nnn,是就業的對數,存在著兩期滯后。重要的解釋變量有當期和滯后一期的工資水平www,當期、滯后一期和滯后兩期的資本存量kkk,以及當期、滯后一期和滯后兩期的公司產出ysysys,所有的變量都取對數形式。
結果:
obs: 1,031 Layard & Nickell, Unemployment in Britain, Economica 53, 1986 from Ox distvars: 16 21 May 2013 21:52 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------storage display value variable name type format label variable label ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ind int %8.0g industry year int %8.0g emp float %9.0g employment wage float %9.0g real wage cap float %9.0g gross capital stock indoutpt float %9.0g industry output n float %9.0g log(employment) w float %9.0g log(real wage) k float %9.0g log(gross capital stock) ys float %9.0g log(industry output) yr1980 float %9.0g yr1981 float %9.0g yr1982 float %9.0g yr1983 float %9.0g yr1984 float %9.0g id float %9.0g firm ID ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sorted by: id year sum結果:
Variable | Obs Mean Std. Dev. Min Max -------------+---------------------------------------------------------ind | 1,031 5.123181 2.678095 1 9year | 1,031 1979.651 2.21607 1976 1984emp | 1,031 7.891677 15.93492 .104 108.562wage | 1,031 23.9188 5.648418 8.0171 45.2318cap | 1,031 2.507432 6.248712 .0119 47.1079 -------------+---------------------------------------------------------indoutpt | 1,031 103.8012 9.938008 86.9 128.3653n | 1,031 1.056002 1.341506 -2.263364 4.687321w | 1,031 3.142988 .2630081 2.081577 3.8118k | 1,031 -.4415775 1.514132 -4.431217 3.852441ys | 1,031 4.638015 .0939611 4.464758 4.85488 -------------+---------------------------------------------------------yr1980 | 1,031 .1357905 .3427322 0 1yr1981 | 1,031 .1357905 .3427322 0 1yr1982 | 1,031 .1357905 .3427322 0 1yr1983 | 1,031 .0756547 .2645732 0 1yr1984 | 1,031 .0339476 .1811823 0 1 -------------+---------------------------------------------------------id | 1,031 73.20369 41.23333 1 140結果:
Source | SS df MS Number of obs = 751 -------------+---------------------------------- F(15, 735) = 8676.37Model | 1343.3054 15 89.5536936 Prob > F = 0.0000Residual | 7.58634832 735 .010321562 R-squared = 0.9944 -------------+---------------------------------- Adj R-squared = 0.9943Total | 1350.89175 750 1.801189 Root MSE = .1016------------------------------------------------------------------------------n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 1.043 0.034 31.01 0.000 0.977 1.109L2. | -0.076 0.033 -2.30 0.022 -0.140 -0.011|w |--. | -0.522 0.049 -10.71 0.000 -0.618 -0.426L1. | 0.474 0.049 9.75 0.000 0.379 0.570|k |--. | 0.342 0.025 13.42 0.000 0.292 0.392L1. | -0.198 0.040 -4.96 0.000 -0.276 -0.119L2. | -0.118 0.028 -4.16 0.000 -0.174 -0.062|ys |--. | 0.429 0.123 3.50 0.001 0.188 0.669L1. | -0.768 0.166 -4.63 0.000 -1.093 -0.442L2. | 0.318 0.111 2.85 0.004 0.099 0.536|yr1980 | 0.011 0.014 0.84 0.401 -0.015 0.038yr1981 | -0.033 0.018 -1.85 0.065 -0.068 0.002yr1982 | -0.026 0.018 -1.39 0.164 -0.062 0.010yr1983 | -0.003 0.018 -0.14 0.885 -0.039 0.033yr1984 | 0.006 0.021 0.26 0.794 -0.036 0.047_cons | 0.284 0.350 0.81 0.418 -0.404 0.972 ----------------------------------------------------------------------------- xi:reg n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year //LSDV估計結果:
i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) note: _Iyear_1977 omitted because of collinearity note: _Iyear_1978 omitted because of collinearitySource | SS df MS Number of obs = 751 -------------+---------------------------------- F(16, 734) = 8136.58Model | 1343.31797 16 83.9573732 Prob > F = 0.0000Residual | 7.57378164 734 .010318504 R-squared = 0.9944 -------------+---------------------------------- Adj R-squared = 0.9943Total | 1350.89175 750 1.801189 Root MSE = .10158------------------------------------------------------------------------------n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 1.045 0.034 31.03 0.000 0.979 1.111L2. | -0.077 0.033 -2.33 0.020 -0.141 -0.012|w |--. | -0.524 0.049 -10.74 0.000 -0.619 -0.428L1. | 0.477 0.049 9.79 0.000 0.381 0.572|k |--. | 0.343 0.026 13.46 0.000 0.293 0.393L1. | -0.202 0.040 -5.04 0.000 -0.281 -0.123L2. | -0.116 0.028 -4.06 0.000 -0.172 -0.060|ys |--. | 0.433 0.123 3.53 0.000 0.192 0.674L1. | -0.768 0.166 -4.63 0.000 -1.093 -0.442L2. | 0.312 0.111 2.80 0.005 0.094 0.531|_Iyear_1977 | 0.000 (omitted)_Iyear_1978 | 0.000 (omitted)_Iyear_1979 | 0.016 0.014 1.10 0.270 -0.012 0.044_Iyear_1980 | 0.022 0.017 1.32 0.187 -0.011 0.055_Iyear_1981 | -0.022 0.020 -1.09 0.278 -0.062 0.018_Iyear_1982 | -0.015 0.021 -0.73 0.468 -0.056 0.026_Iyear_1983 | 0.007 0.020 0.36 0.717 -0.033 0.047_Iyear_1984 | 0.015 0.023 0.67 0.504 -0.030 0.061_cons | 0.275 0.351 0.78 0.433 -0.413 0.963 ------------------------------------------------------------------------------結果:
Fixed-effects (within) regression Number of obs = 751 Group variable: id Number of groups = 140R-sq: Obs per group:within = 0.7973 min = 5between = 0.9808 avg = 5.4overall = 0.9758 max = 7F(15,596) = 156.25 corr(u_i, Xb) = 0.5474 Prob > F = 0.0000------------------------------------------------------------------------------n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 0.732 0.039 18.68 0.000 0.655 0.809L2. | -0.140 0.040 -3.49 0.001 -0.218 -0.061|w |--. | -0.559 0.057 -9.82 0.000 -0.671 -0.448L1. | 0.314 0.061 5.16 0.000 0.195 0.434|k |--. | 0.388 0.031 12.56 0.000 0.327 0.448L1. | -0.079 0.038 -2.07 0.039 -0.154 -0.004L2. | -0.028 0.033 -0.86 0.389 -0.093 0.036|ys |--. | 0.466 0.123 3.80 0.000 0.225 0.708L1. | -0.630 0.158 -3.99 0.000 -0.940 -0.320L2. | 0.061 0.134 0.46 0.648 -0.202 0.325|yr1980 | 0.008 0.013 0.60 0.551 -0.018 0.034yr1981 | -0.029 0.019 -1.53 0.127 -0.066 0.008yr1982 | -0.038 0.020 -1.92 0.055 -0.077 0.001yr1983 | -0.032 0.022 -1.46 0.146 -0.074 0.011yr1984 | -0.015 0.024 -0.62 0.534 -0.063 0.033_cons | 1.797 0.507 3.54 0.000 0.801 2.793 -------------+----------------------------------------------------------------sigma_u | .22630054sigma_e | .09388866rho | .85314812 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(139, 596) = 1.90 Prob > F = 0.0000 xi:xtreg n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year,fe結果:
i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) note: _Iyear_1977 omitted because of collinearity note: _Iyear_1984 omitted because of collinearityFixed-effects (within) regression Number of obs = 751 Group variable: id Number of groups = 140R-sq: Obs per group:within = 0.7973 min = 5between = 0.9809 avg = 5.4overall = 0.9758 max = 7F(16,595) = 146.27 corr(u_i, Xb) = 0.5459 Prob > F = 0.0000------------------------------------------------------------------------------n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 0.733 0.039 18.65 0.000 0.656 0.810L2. | -0.139 0.040 -3.48 0.001 -0.218 -0.061|w |--. | -0.560 0.057 -9.81 0.000 -0.672 -0.448L1. | 0.315 0.061 5.17 0.000 0.195 0.435|k |--. | 0.388 0.031 12.55 0.000 0.328 0.449L1. | -0.081 0.038 -2.09 0.037 -0.156 -0.005L2. | -0.028 0.033 -0.85 0.397 -0.092 0.037|ys |--. | 0.469 0.123 3.81 0.000 0.227 0.710L1. | -0.629 0.158 -3.98 0.000 -0.939 -0.318L2. | 0.058 0.135 0.43 0.667 -0.206 0.322|_Iyear_1977 | 0.000 (omitted)_Iyear_1978 | 0.012 0.026 0.46 0.649 -0.039 0.063_Iyear_1979 | 0.017 0.025 0.67 0.503 -0.032 0.065_Iyear_1980 | 0.023 0.025 0.93 0.355 -0.026 0.072_Iyear_1981 | -0.013 0.026 -0.52 0.605 -0.065 0.038_Iyear_1982 | -0.022 0.023 -0.98 0.328 -0.068 0.023_Iyear_1983 | -0.016 0.021 -0.77 0.442 -0.057 0.025_Iyear_1984 | 0.000 (omitted)_cons | 1.780 0.501 3.55 0.000 0.795 2.765 -------------+----------------------------------------------------------------sigma_u | .22568151sigma_e | .09395847rho | .85227336 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(139, 595) = 1.89 Prob > F = 0.0000結果:
. tab year,gen(year)year | Freq. Percent Cum. ------------+-----------------------------------1976 | 80 7.76 7.761977 | 138 13.39 21.141978 | 140 13.58 34.721979 | 140 13.58 48.301980 | 140 13.58 61.881981 | 140 13.58 75.461982 | 140 13.58 89.041983 | 78 7.57 96.611984 | 35 3.39 100.00 ------------+-----------------------------------Total | 1,031 100.00. ivreg D.n (D.L.n=L2.n) D.(L2.n w L.w k L.k L2.k ys L.ys L2.ys year1 year2 year3 year4 year5 year6 year7 year8 year9)Instrumental variables (2SLS) regressionSource | SS df MS Number of obs = 611 -------------+---------------------------------- F(15, 595) = 5.84Model | -24.6768882 15 -1.64512588 Prob > F = 0.0000Residual | 37.2768667 595 .062650196 R-squared = . -------------+---------------------------------- Adj R-squared = .Total | 12.5999785 610 .020655702 Root MSE = .2503------------------------------------------------------------------------------D.n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |LD. | 2.308 2.000 1.15 0.249 -1.619 6.235L2D. | -0.224 0.181 -1.23 0.217 -0.580 0.132|w |D1. | -0.810 0.265 -3.05 0.002 -1.331 -0.289LD. | 1.422 1.195 1.19 0.235 -0.925 3.770|k |D1. | 0.253 0.147 1.73 0.085 -0.035 0.541LD. | -0.552 0.624 -0.89 0.376 -1.777 0.672L2D. | -0.213 0.243 -0.88 0.382 -0.690 0.265|ys |D1. | 0.991 0.469 2.11 0.035 0.069 1.912LD. | -1.938 1.457 -1.33 0.184 -4.800 0.924L2D. | 0.487 0.517 0.94 0.346 -0.528 1.502|year1 |D1. | 0.000 (omitted)|year2 |D1. | 0.000 (omitted)|year3 |D1. | 0.000 (omitted)|year4 |D1. | 0.047 0.045 1.03 0.305 -0.043 0.136|year5 |D1. | 0.076 0.063 1.20 0.230 -0.048 0.201|year6 |D1. | 0.023 0.056 0.40 0.689 -0.088 0.134|year7 |D1. | 0.013 0.056 0.23 0.818 -0.096 0.122|year8 |D1. | 0.010 0.046 0.21 0.830 -0.081 0.101|year9 |D1. | 0.000 (omitted)|_cons | 0.016 0.028 0.58 0.565 -0.038 0.070 ------------------------------------------------------------------------------ Instrumented: LD.n Instruments: L2D.n D.w LD.w D.k LD.k L2D.k D.ys LD.ys L2D.ys D.year1D.year2 D.year3 D.year4 D.year5 D.year6 D.year7 D.year8D.year9 L2.n -----------------------------------------------------------------------------使用lag()選項控制工具變量的滯后期數
. xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n, lag(2 5)) iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year) nolevel robust small nomata i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) _Iyear_1977 dropped because of collinearity. _Iyear_1978 dropped because of collinearity. Building GMM instruments.. 2 instrument(s) dropped because of collinearity. Estimating. Performing specification tests.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 = 33 Obs per group: min = 4 F(14, 139) = 117.25 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------| Robustn | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 1.017 0.284 3.58 0.000 0.455 1.578L2. | -0.114 0.051 -2.23 0.027 -0.215 -0.013|w |--. | -0.659 0.204 -3.22 0.002 -1.064 -0.255L1. | 0.634 0.325 1.95 0.053 -0.009 1.276|k |--. | 0.335 0.065 5.12 0.000 0.205 0.464L1. | -0.158 0.117 -1.35 0.179 -0.391 0.074L2. | -0.065 0.051 -1.28 0.204 -0.165 0.036|ys |--. | 0.680 0.198 3.43 0.001 0.289 1.072L1. | -0.993 0.401 -2.48 0.014 -1.785 -0.201L2. | 0.235 0.206 1.14 0.257 -0.173 0.642|_Iyear_1979 | 0.019 0.014 1.41 0.162 -0.008 0.047_Iyear_1980 | 0.038 0.023 1.62 0.107 -0.008 0.084_Iyear_1981 | 0.001 0.033 0.03 0.975 -0.064 0.066_Iyear_1982 | -0.010 0.031 -0.32 0.747 -0.072 0.052_Iyear_1983 | -0.002 0.031 -0.07 0.941 -0.063 0.059_Iyear_1984 | 0.010 0.029 0.34 0.734 -0.047 0.066 ------------------------------------------------------------------------------ Instruments for first differences equationStandardD.(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979_Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984)GMM-type (missing=0, separate instruments for each period unless collapsed)L(2/5).L.n ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -2.74 Pr > z = 0.006 Arellano-Bond test for AR(2) in first differences: z = -0.67 Pr > z = 0.504 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(17) = 27.69 Prob > chi2 = 0.049(Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(17) = 21.79 Prob > chi2 = 0.193(Robust, but weakened by many instruments.)-使用or選項向前正交變換
. xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n, lag(2 5)) iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year) nolevel robust small nomata i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) _Iyear_1977 dropped because of collinearity. _Iyear_1978 dropped because of collinearity. Building GMM instruments.. 2 instrument(s) dropped because of collinearity. Estimating. Performing specification tests.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 = 33 Obs per group: min = 4 F(14, 139) = 117.25 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------| Robustn | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 1.017 0.284 3.58 0.000 0.455 1.578L2. | -0.114 0.051 -2.23 0.027 -0.215 -0.013|w |--. | -0.659 0.204 -3.22 0.002 -1.064 -0.255L1. | 0.634 0.325 1.95 0.053 -0.009 1.276|k |--. | 0.335 0.065 5.12 0.000 0.205 0.464L1. | -0.158 0.117 -1.35 0.179 -0.391 0.074L2. | -0.065 0.051 -1.28 0.204 -0.165 0.036|ys |--. | 0.680 0.198 3.43 0.001 0.289 1.072L1. | -0.993 0.401 -2.48 0.014 -1.785 -0.201L2. | 0.235 0.206 1.14 0.257 -0.173 0.642|_Iyear_1979 | 0.019 0.014 1.41 0.162 -0.008 0.047_Iyear_1980 | 0.038 0.023 1.62 0.107 -0.008 0.084_Iyear_1981 | 0.001 0.033 0.03 0.975 -0.064 0.066_Iyear_1982 | -0.010 0.031 -0.32 0.747 -0.072 0.052_Iyear_1983 | -0.002 0.031 -0.07 0.941 -0.063 0.059_Iyear_1984 | 0.010 0.029 0.34 0.734 -0.047 0.066 ------------------------------------------------------------------------------ Instruments for first differences equationStandardD.(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979_Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984)GMM-type (missing=0, separate instruments for each period unless collapsed)L(2/5).L.n ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -2.74 Pr > z = 0.006 Arellano-Bond test for AR(2) in first differences: z = -0.67 Pr > z = 0.504 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(17) = 27.69 Prob > chi2 = 0.049(Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(17) = 21.79 Prob > chi2 = 0.193(Robust, but weakened by many instruments.). xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n) iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year) nolevel robus small or i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) Favoring space over speed. To switch, type or click on mata: mata set matafavor speed, perm. Warning: Two-step estimated covariance matrix of moments is singular.Using a generalized inverse to calculate robust weighting matrix for Hansen test.Difference-in-Sargan/Hansen statistics may be negative.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 = 42 Obs per group: min = 4 F(18, 140) = 109.69 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------| Robustn | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 0.653 0.083 7.87 0.000 0.489 0.817L2. | -0.100 0.073 -1.38 0.170 -0.244 0.043|w |--. | -0.558 0.157 -3.56 0.001 -0.867 -0.248L1. | 0.272 0.133 2.04 0.043 0.009 0.535|k |--. | 0.398 0.059 6.78 0.000 0.282 0.514L1. | -0.058 0.055 -1.04 0.300 -0.167 0.052L2. | -0.033 0.042 -0.80 0.427 -0.117 0.050|ys |--. | 0.455 0.171 2.66 0.009 0.116 0.794L1. | -0.579 0.197 -2.93 0.004 -0.969 -0.189L2. | 0.034 0.141 0.24 0.811 -0.245 0.313|_Iyear_1977 | 0.000 (omitted)_Iyear_1978 | 0.012 0.030 0.38 0.703 -0.049 0.072_Iyear_1979 | 0.014 0.030 0.48 0.632 -0.045 0.074_Iyear_1980 | 0.020 0.029 0.71 0.482 -0.037 0.077_Iyear_1981 | -0.015 0.028 -0.54 0.588 -0.071 0.041_Iyear_1982 | -0.025 0.021 -1.21 0.229 -0.067 0.016_Iyear_1983 | -0.018 0.020 -0.90 0.368 -0.058 0.022_Iyear_1984 | 0.000 (omitted) ------------------------------------------------------------------------------ Instruments for orthogonal deviations equationStandardFOD.(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978_Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984)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 = -4.95 Pr > z = 0.000 Arellano-Bond test for AR(2) in first differences: z = -0.10 Pr > z = 0.918 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(24) = 62.01 Prob > chi2 = 0.000(Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(24) = 31.62 Prob > chi2 = 0.137(Robust, but weakened by many instruments.)Difference-in-Hansen tests of exogeneity of instrument subsets:iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984)Hansen test excluding group: chi2(9) = 11.52 Prob > chi2 = 0.242Difference (null H = exogenous): chi2(15) = 20.10 Prob > chi2 = 0.168-使用更多工具變量
. xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n, lag(1 .)) gmm(w, lag(2 .)) gmm(L.w) gmm(L.k) gmm(k, lag(2 .)) iv(L2.n L2.k ys L.ys L2.ys i.year) > nolevel robust small i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) Favoring space over speed. To switch, type or click on mata: mata set matafavor speed, perm. Warning: Two-step estimated covariance matrix of moments is singular.Using a generalized inverse to calculate robust weighting matrix for Hansen test.Difference-in-Sargan/Hansen statistics may be negative.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 = 90 Obs per group: min = 4 F(18, 140) = 75.56 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------| Robustn | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 0.818 0.086 9.50 0.000 0.648 0.988L2. | -0.112 0.050 -2.23 0.027 -0.212 -0.013|w |--. | -0.682 0.143 -4.77 0.000 -0.964 -0.399L1. | 0.656 0.203 3.23 0.002 0.255 1.056|k |--. | 0.353 0.122 2.89 0.004 0.111 0.594L1. | -0.154 0.086 -1.78 0.078 -0.325 0.017L2. | -0.030 0.032 -0.95 0.346 -0.094 0.033|ys |--. | 0.651 0.190 3.43 0.001 0.275 1.026L1. | -0.916 0.264 -3.47 0.001 -1.439 -0.394L2. | 0.279 0.186 1.50 0.136 -0.089 0.646|_Iyear_1977 | 0.000 (omitted)_Iyear_1978 | 0.000 (omitted)_Iyear_1979 | 0.011 0.009 1.23 0.221 -0.007 0.030_Iyear_1980 | 0.026 0.017 1.52 0.132 -0.008 0.061_Iyear_1981 | -0.014 0.029 -0.47 0.640 -0.071 0.044_Iyear_1982 | -0.035 0.030 -1.16 0.246 -0.095 0.024_Iyear_1983 | -0.031 0.035 -0.88 0.381 -0.100 0.039_Iyear_1984 | -0.024 0.037 -0.65 0.518 -0.097 0.049 ------------------------------------------------------------------------------ Instruments for first differences equationStandardD.(L2.n L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980_Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984)GMM-type (missing=0, separate instruments for each period unless collapsed)L(2/8).kL(1/8).L.kL(1/8).L.wL(2/8).wL(1/8).L.n ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -5.39 Pr > z = 0.000 Arellano-Bond test for AR(2) in first differences: z = -0.78 Pr > z = 0.436 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(72) = 120.62 Prob > chi2 = 0.000(Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(72) = 73.72 Prob > chi2 = 0.422(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(46) = 43.99 Prob > chi2 = 0.557Difference (null H = exogenous): chi2(26) = 29.72 Prob > chi2 = 0.279gmm(w, lag(2 .))Hansen test excluding group: chi2(65) = 73.72 Prob > chi2 = 0.215Difference (null H = exogenous): chi2(7) = 0.00 Prob > chi2 = 1.000gmm(L.w, lag(1 .))Hansen test excluding group: chi2(52) = 73.72 Prob > chi2 = 0.025Difference (null H = exogenous): chi2(20) = 0.00 Prob > chi2 = 1.000gmm(L.k, lag(1 .))Hansen test excluding group: chi2(67) = 73.72 Prob > chi2 = 0.268Difference (null H = exogenous): chi2(5) = 0.00 Prob > chi2 = 1.000gmm(k, lag(2 .))Hansen test excluding group: chi2(51) = 73.72 Prob > chi2 = 0.020Difference (null H = exogenous): chi2(21) = 0.00 Prob > chi2 = 1.000iv(L2.n L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984)Hansen test excluding group: chi2(61) = 56.99 Prob > chi2 = 0.622Difference (null H = exogenous): chi2(11) = 16.72 Prob > chi2 = 0.116一步法與兩步法的比較
. xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n L.w L.k) iv(ys L.ys L2.ys i.year) nolevel robust small nomata //一步法 i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) _Iyear_1977 dropped because of collinearity. _Iyear_1978 dropped because of collinearity. Building GMM instruments.... 2 instrument(s) dropped because of collinearity. Estimating. Performing specification tests.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 = 90 Obs per group: min = 4 F(14, 139) = 90.85 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------| Robustn | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 0.818 0.086 9.51 0.000 0.648 0.988L2. | -0.112 0.050 -2.23 0.027 -0.212 -0.013|w |--. | -0.682 0.143 -4.78 0.000 -0.964 -0.400L1. | 0.656 0.202 3.24 0.001 0.256 1.056|k |--. | 0.353 0.122 2.89 0.004 0.112 0.593L1. | -0.154 0.086 -1.78 0.077 -0.324 0.017L2. | -0.030 0.032 -0.95 0.345 -0.094 0.033|ys |--. | 0.651 0.190 3.43 0.001 0.276 1.026L1. | -0.916 0.264 -3.47 0.001 -1.438 -0.394L2. | 0.279 0.186 1.50 0.135 -0.088 0.645|_Iyear_1979 | 0.011 0.009 1.23 0.220 -0.007 0.030_Iyear_1980 | 0.026 0.017 1.52 0.131 -0.008 0.061_Iyear_1981 | -0.014 0.029 -0.47 0.639 -0.071 0.044_Iyear_1982 | -0.035 0.030 -1.17 0.245 -0.094 0.024_Iyear_1983 | -0.031 0.035 -0.88 0.380 -0.100 0.038_Iyear_1984 | -0.024 0.037 -0.65 0.517 -0.097 0.049 ------------------------------------------------------------------------------ Instruments for first differences equationStandardD.(ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980_Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984)GMM-type (missing=0, separate instruments for each period unless collapsed)L(1/.).(L.n L.w L.k) ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -5.39 Pr > z = 0.000 Arellano-Bond test for AR(2) in first differences: z = -0.78 Pr > z = 0.436 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(74) = 120.62 Prob > chi2 = 0.001(Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(74) = 73.72 Prob > chi2 = 0.487(Robust, but weakened by many instruments.). xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n L.w L.k) iv(ys L.ys L2.ys i.year) two nolevel robust small nomata //兩步法 i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) _Iyear_1977 dropped because of collinearity. _Iyear_1978 dropped because of collinearity. Building GMM instruments.... 2 instrument(s) dropped because of collinearity. Estimating. Computing Windmeijer finite-sample correction............................................................................................................................... > .............. Performing specification tests.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 = 90 Obs per group: min = 4 F(14, 139) = 78.27 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------| Correctedn | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------n |L1. | 0.824 0.097 8.51 0.000 0.633 1.016L2. | -0.101 0.053 -1.90 0.059 -0.207 0.004|w |--. | -0.711 0.152 -4.67 0.000 -1.013 -0.410L1. | 0.631 0.178 3.54 0.001 0.279 0.984|k |--. | 0.377 0.135 2.79 0.006 0.110 0.643L1. | -0.169 0.113 -1.49 0.137 -0.392 0.055L2. | -0.058 0.044 -1.32 0.191 -0.145 0.029|ys |--. | 0.662 0.170 3.89 0.000 0.325 0.999L1. | -0.943 0.259 -3.65 0.000 -1.454 -0.432L2. | 0.361 0.196 1.84 0.068 -0.027 0.748|_Iyear_1979 | 0.017 0.010 1.73 0.086 -0.002 0.036_Iyear_1980 | 0.030 0.016 1.83 0.070 -0.002 0.062_Iyear_1981 | -0.012 0.027 -0.44 0.663 -0.066 0.042_Iyear_1982 | -0.022 0.031 -0.71 0.481 -0.084 0.040_Iyear_1983 | -0.005 0.039 -0.12 0.905 -0.082 0.072_Iyear_1984 | -0.002 0.044 -0.03 0.972 -0.088 0.085 ------------------------------------------------------------------------------ Instruments for first differences equationStandardD.(ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980_Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984)GMM-type (missing=0, separate instruments for each period unless collapsed)L(1/.).(L.n L.w L.k) ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -3.92 Pr > z = 0.000 Arellano-Bond test for AR(2) in first differences: z = -0.77 Pr > z = 0.441 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(74) = 120.62 Prob > chi2 = 0.001(Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(74) = 73.72 Prob > chi2 = 0.487(Robust, but weakened by many instruments.)參考資料
小白學統計|面板數據分析與Stata應用筆記(七)
總結
以上是生活随笔為你收集整理的浙江大学【面板数据分析与STATA应用】——第四讲动态面板数据类型的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python 北京大学陈斌教授_陈斌 -
- 下一篇: S5PV210 WM8960 ASOC