全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
64229 81
2013-06-04
悬赏 100 个论坛币 已解决
请求高手帮忙运行一个命令,空间面板数据模型的GMM,我运行总是出错,请高手帮忙运行一下,看看是什么问题,附件里面有命令、数据及帮助文件,不甚感激!

spgmmxt.zip

大小:37.42 KB

 马上下载

最佳答案

无他 查看完整内容

我遇到你一样的情况,但是我摸索出来了,不知道你是否合适: 1、你的spgmmxt.dta数据文件所在的文件目录里有spgmmxt的ADO文件,也就是命令文件,你把它删除; 2、确保你的stata程序所在目录 stata\ado\plus\s 里面已安装 spgmmxt命令,以及spweight和spweightxt命令,具体你可通过 findit spgmmxt 等安装; 不过,很有可能是没有安装spweightxt命令。 然后你再运行,或许你第一步完成后就能得到跟大家一样的结果。 既然该 ...
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-6-4 21:23:21
我遇到你一样的情况,但是我摸索出来了,不知道你是否合适:

1、你的spgmmxt.dta数据文件所在的文件目录里有spgmmxt的ADO文件,也就是命令文件,你把它删除;
2、确保你的stata程序所在目录 stata\ado\plus\s  里面已安装 spgmmxt命令,以及spweight和spweightxt命令,具体你可通过 findit spgmmxt 等安装;
不过,很有可能是没有安装spweightxt命令。

然后你再运行,或许你第一步完成后就能得到跟大家一样的结果。
既然该命令能执行,那就不应该是软件升级的问题,肯定是权重矩阵的命令的问题。

我不太懂stata的运行机制,但我的想法是:stata直接调用你空间数据文件dta所在的spgmmt命令,但是该命令下没有spweght等相关权重命令,如果你之前是通过 findit spgmmxt 安装空间动态面板命令spgmmxt的话,该命令应该在stata\ado\plus\s  里面,而(你所得到有错误的运行命令情况下)默认的权重矩阵命令无法调用,所以就出现你的那个结果。删除后(及上面的第一步)stata又回到它系统默认的命令调用模式了,所以就出现正常结果。

不知道对不对。

大家共同进步。


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-6-5 12:07:38
测试没有问题


. clear

. clear all

. sysuse spgmmxt.dta, clear

. spgmmxt y  x1 x2 , nc(7) wmfile(SPWxt) gmm(1) mfx(lin) test

==============================================================================
*** Binary (0/1) Weight Matrix: 49x49 - NC=7 NT=7 (Non Normalized)
==============================================================================
==============================================================================
* Spatial Panel Autoregressive Generalized Method of Moments (SPGMM)
==============================================================================
  y = x1 + x2
------------------------------------------------------------------------------
  Sample Size       =          49   |   Cross Sections Number   =           7
  Wald Test         =     45.3388   |   P-Value > Chi2(2)       =      0.0000
  F-Test            =     22.6694   |   P-Value > F(2 , 40)     =      0.0000
(Buse 1973) R2     =      0.7748   |   Raw Moments R2          =      0.9590
(Buse 1973) R2 Adj =      0.7297   |   Raw Moments R2 Adj      =      0.9509
  Root MSE (Sigma)  =      8.6984   |   Log Likelihood Function =   -170.5500
------------------------------------------------------------------------------
- R2h= 0.5500   R2h Adj= 0.4600  F-Test =   28.11 P-Value > F(2 , 40)  0.0000
- R2v= 0.4508   R2v Adj= 0.3410  F-Test =   18.88 P-Value > F(2 , 40)  0.0000
------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          x1 |  -.2904423   .0941184    -3.09   0.004    -.4806627   -.1002219
          x2 |  -1.323453   .3309552    -4.00   0.000    -1.992338   -.6545674
       _cons |   64.47419   5.091475    12.66   0.000     54.18394    74.76445
------------------------------------------------------------------------------

==============================================================================
* Panel Model Selection Diagnostic Criteria
==============================================================================
- Log Likelihood Function                   LLF            =   -170.5500
---------------------------------------------------------------------------
- Akaike Information Criterion              (1974) AIC     =     69.8112
- Akaike Information Criterion              (1973) Log AIC =      4.2458
---------------------------------------------------------------------------
- Schwarz Criterion                         (1978) SC      =     78.3840
- Schwarz Criterion                         (1978) Log SC  =      4.3616
---------------------------------------------------------------------------
- Amemiya Prediction Criterion              (1969) FPE     =     80.2952
- Hannan-Quinn Criterion                    (1979) HQ      =     72.9474
- Rice Criterion                            (1984) Rice    =     70.3840
- Shibata Criterion                         (1981) Shibata =     69.3287
- Craven-Wahba Generalized Cross Validation (1979) GCV     =     70.0846
------------------------------------------------------------------------------

==============================================================================
*** Spatial Panel Aautocorrelation Tests
==============================================================================
  Ho: Error has No Spatial AutoCorrelation
  Ha: Error has    Spatial AutoCorrelation

- GLOBAL Moran MI            =   0.0594     P-Value > Z( 0.705)   0.4805
- GLOBAL Geary GC            =   0.8831     P-Value > Z(-0.828)   0.4076
- GLOBAL Getis-Ords GO       =  -0.1698     P-Value > Z(-0.705)   0.4805
------------------------------------------------------------------------------
- Moran MI Error Test        =   0.3779     P-Value > Z(3.505)    0.7055
------------------------------------------------------------------------------
- LM Error (Burridge)        =   0.1647     P-Value > Chi2(1)     0.6849
- LM Error (Robust)          =   0.6335     P-Value > Chi2(1)     0.4261
------------------------------------------------------------------------------
  Ho: Spatial Lagged Dependent Variable has No Spatial AutoCorrelation
  Ha: Spatial Lagged Dependent Variable has    Spatial AutoCorrelation

- LM Lag (Anselin)           =   0.3204     P-Value > Chi2(1)     0.5714
- LM Lag (Robust)            =   0.7891     P-Value > Chi2(1)     0.3744
------------------------------------------------------------------------------
  Ho: No General Spatial AutoCorrelation
  Ha:    General Spatial AutoCorrelation

- LM SAC (LMErr+LMLag_R)     =   0.9539     P-Value > Chi2(2)     0.6207
- LM SAC (LMLag+LMErr_R)     =   0.9539     P-Value > Chi2(2)     0.6207
------------------------------------------------------------------------------

==============================================================================
*** Panel Heteroscedasticity Tests
==============================================================================
  Ho: Panel Homoscedasticity - Ha: Panel Heteroscedasticity

- Engle LM ARCH Test AR(1): E2 = E2_1   =   0.5025   P-Value > Chi2(1)  0.4784
------------------------------------------------------------------------------
- Hall-Pagan LM Test:   E2 = Yh         =   0.0254   P-Value > Chi2(1)  0.8734
- Hall-Pagan LM Test:   E2 = Yh2        =   0.0000   P-Value > Chi2(1)  0.9968
- Hall-Pagan LM Test:   E2 = LYh2       =   0.2283   P-Value > Chi2(1)  0.6328
------------------------------------------------------------------------------
- Harvey LM Test:    LogE2 = X          =   2.4753   P-Value > Chi2(2)  0.2901
- Wald Test:         LogE2 = X          =   6.1075   P-Value > Chi2(1)  0.0135
- Glejser LM Test:     |E| = X          =   8.3688   P-Value > Chi2(2)  0.0152
- Breusch-Godfrey Test:  E = E_1 X      =  10.9753   P-Value > Chi2(1)  0.0009
------------------------------------------------------------------------------
- Machado-Santos-Silva Test: Ev=Yh Yh2  =   0.2531   P-Value > Chi2(2)  0.8811
- Machado-Santos-Silva Test: Ev=X       =   7.2616   P-Value > Chi2(2)  0.0265
------------------------------------------------------------------------------
- White Test - Koenker(R2): E2 = X      =   9.8517   P-Value > Chi2(2)  0.0073
- White Test - B-P-G (SSR): E2 = X      =  14.2397   P-Value > Chi2(2)  0.0008
------------------------------------------------------------------------------
- White Test - Koenker(R2): E2 = X X2   =  11.7997   P-Value > Chi2(4)  0.0189
- White Test - B-P-G (SSR): E2 = X X2   =  17.0553   P-Value > Chi2(4)  0.0019
------------------------------------------------------------------------------
- White Test - Koenker(R2): E2 = X X2 XX=  24.9319   P-Value > Chi2(5)  0.0001
- White Test - B-P-G (SSR): E2 = X X2 XX=  36.0364   P-Value > Chi2(5)  0.0000
------------------------------------------------------------------------------
- Cook-Weisberg LM Test: E2/S2n = Yh    =   0.0367   P-Value > Chi2(1)  0.8481
- Cook-Weisberg LM Test: E2/S2n = X     =  14.2397   P-Value > Chi2(2)  0.0008
------------------------------------------------------------------------------
*** Single Variable Tests (E2/Sig2):
- Cook-Weisberg LM Test: x1                =   4.1504 P-Value > Chi2(1) 0.0416
- Cook-Weisberg LM Test: x2                =   3.0020 P-Value > Chi2(1) 0.0832
------------------------------------------------------------------------------
*** Single Variable Tests:
- King LM Test: x1                         =   0.3196 P-Value > Chi2(1) 0.5718
- King LM Test: x2                         =   2.9761 P-Value > Chi2(1) 0.0845
------------------------------------------------------------------------------

==============================================================================
* Panel Groupwise Heteroscedasticity Tests
==============================================================================
  Ho: Panel Homoscedasticity - Ha: Panel Groupwise Heteroscedasticity

- Lagrange Multiplier LM Test     =   7.3373     P-Value > Chi2(6)   0.2908
- Likelihood Ratio LR Test        =   7.1253     P-Value > Chi2(6)   0.3094
- Wald Test                       =  12.4812     P-Value > Chi2(7)   0.0858
------------------------------------------------------------------------------

==============================================================================
* Panel Non Normality Tests
==============================================================================
Ho: Normality - Ha: Non Normality
------------------------------------------------------------------------------
*** Non Normality Tests:
- Jarque-Bera LM Test                  =   1.8192     P-Value > Chi2(2) 0.4027
- White IM Test                        =  11.9460     P-Value > Chi2(2) 0.0025
- Doornik-Hansen LM Test               =   4.7489     P-Value > Chi2(2) 0.0931
- Geary LM Test                        =  -0.7192     P-Value > Chi2(2) 0.6980
- Anderson-Darling Z Test              =   0.3559     P > Z( 0.087)     0.5346
- D'Agostino-Pearson LM Test           =   2.6169     P-Value > Chi2(2) 0.2702
------------------------------------------------------------------------------
*** Skewness Tests:
- Srivastava LM Skewness Test          =   0.1992     P-Value > Chi2(1) 0.6554
- Small LM Skewness Test               =   0.2464     P-Value > Chi2(1) 0.6196
- Skewness Z Test                      =  -0.4964     P-Value > Chi2(1) 0.6196
------------------------------------------------------------------------------
*** Kurtosis Tests:
- Srivastava  Z Kurtosis Test          =   1.2728     P-Value > Z(0,1)  0.2031
- Small LM Kurtosis Test               =   2.3705     P-Value > Chi2(1) 0.1236
- Kurtosis Z Test                      =   1.5396     P-Value > Chi2(1) 0.1236
------------------------------------------------------------------------------
    Skewness Coefficient = -0.1562     - Standard Deviation =  0.3398
    Kurtosis Coefficient =  3.8908     - Standard Deviation =  0.6681
------------------------------------------------------------------------------
    Runs Test: (23) Runs -  (24) Positives - (25) Negatives
    Standard Deviation Runs Sig(k) =  3.4619 , Mean Runs E(k) = 25.4898
    95% Conf. Interval [E(k)+/- 1.96* Sig(k)] = (18.7045 , 32.2751 )
------------------------------------------------------------------------------

* Marginal Effect - Elasticity: Linear *

+---------------------------------------------------------------------------+
|   Variable | Marginal_Effect(B) |     Elasticity(Es) |               Mean |
|------------+--------------------+--------------------+--------------------|
|         x1 |            -0.2904 |            -0.3178 |            38.4362 |
|         x2 |            -1.3235 |            -0.5416 |            14.3749 |
+---------------------------------------------------------------------------+
Mean of Dependent Variable =     35.1288

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-6-5 14:24:07
蓝色 发表于 2013-6-5 12:07
测试没有问题
太谢谢你了~为什么我回归不出来呢?我只能回归到这里,后面就说找不到矩阵,为什么呢?请帮忙看一下,十分感谢!
clear

. clear all

. sysuse spgmmxt.dta, clear

. spgmmxt y  x1 x2 , nc(7) wmfile(SPWxt) gmm(1) mfx(lin) test

==============================================================================
*** Binary (0/1) Weight Matrix: 49x49 - NC=7 NT=7 (Non Normalized)
==============================================================================
==============================================================================
* Spatial Panel Autoregressive Generalized Method of Moments (SPGMM)
==============================================================================
  y = x1 + x2
------------------------------------------------------------------------------
  Sample Size       =          49   |   Cross Sections Number   =           7
  Wald Test         =     45.3388   |   P-Value > Chi2(2)       =      0.0000
  F-Test            =     22.6694   |   P-Value > F(2 , 40)     =      0.0000
(Buse 1973) R2     =      0.7748   |   Raw Moments R2          =      0.9590
(Buse 1973) R2 Adj =      0.7297   |   Raw Moments R2 Adj      =      0.9509
  Root MSE (Sigma)  =      8.6984   |   Log Likelihood Function =   -170.5500
------------------------------------------------------------------------------
- R2h= 0.5500   R2h Adj= 0.4600  F-Test =   28.11 P-Value > F(2 , 40)  0.0000
- R2v= 0.4508   R2v Adj= 0.3410  F-Test =   18.88 P-Value > F(2 , 40)  0.0000
------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          x1 |  -.2904423   .0941184    -3.09   0.004    -.4806627   -.1002219
          x2 |  -1.323453   .3309552    -4.00   0.000    -1.992338   -.6545673
       _cons |   64.47419   5.091475    12.66   0.000     54.18394    74.76445
------------------------------------------------------------------------------
matrix operation not found
r(501);

. spgmmxt y  x1 x2 , nc(7) wmfile(SPWxt) gmm(1) mfx(lin) test

==============================================================================
*** Binary (0/1) Weight Matrix: 49x49 - NC=7 NT=7 (Non Normalized)
==============================================================================
==============================================================================
* Spatial Panel Autoregressive Generalized Method of Moments (SPGMM)
==============================================================================
  y = x1 + x2
------------------------------------------------------------------------------
  Sample Size       =          49   |   Cross Sections Number   =           7
  Wald Test         =     45.3388   |   P-Value > Chi2(2)       =      0.0000
  F-Test            =     22.6694   |   P-Value > F(2 , 40)     =      0.0000
(Buse 1973) R2     =      0.7748   |   Raw Moments R2          =      0.9590
(Buse 1973) R2 Adj =      0.7297   |   Raw Moments R2 Adj      =      0.9509
  Root MSE (Sigma)  =      8.6984   |   Log Likelihood Function =   -170.5500
------------------------------------------------------------------------------
- R2h= 0.5500   R2h Adj= 0.4600  F-Test =   28.11 P-Value > F(2 , 40)  0.0000
- R2v= 0.4508   R2v Adj= 0.3410  F-Test =   18.88 P-Value > F(2 , 40)  0.0000
------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          x1 |  -.2904423   .0941184    -3.09   0.004    -.4806627   -.1002219
          x2 |  -1.323453   .3309552    -4.00   0.000    -1.992338   -.6545673
       _cons |   64.47419   5.091475    12.66   0.000     54.18394    74.76445
------------------------------------------------------------------------------
matrix operation not found
r(501);
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-6-5 14:32:28
不懂空间计量
只能测试说明命令没有问题

你吧软件都升升级,然后看看吧
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-6-6 17:32:28
蓝色 发表于 2013-6-5 14:32
不懂空间计量
只能测试说明命令没有问题
根据版主你之前的升级帖子将stata升级了一下,可是还是不行,一直显示“matrix operation not found”,请问这是什么意思啊?是不是有什么关于矩阵的命令没有装呢?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群