Stata xtoverid命令错误

时间:2018-04-13 05:30:43

标签: stata

我有面板数据,我的回归形式如下:

s_roa1 = s_roa + c_roa

我是Stata的新手,我正在尝试使用xtoverid命令robust hausman test来帮助我在固定或随机效果模型之间进行选择:

xtoverid s_roa1 s_roa c_roa, fe i (year)

但是,我收到以下错误:

varlist not allowed

任何人都可以帮我理解这意味着什么吗?

1 个答案:

答案 0 :(得分:3)

首先,xtoverid是一个社区贡献的命令,您无法在问题中明确这一点。从一开始就提供这些信息是习惯和有用的,因此其他人知道您没有参考官方的内置命令。

其次,这是一个估计后命令,这意味着您在使用xtregxtivreg估算模型后直接运行 xtivreg2xthtaylor

作者提供的帮助文件提供了一个启发性的例子:

 . webuse nlswork
(National Longitudinal Survey.  Young Women 14-26 years of age in 1968)

 . tsset idcode year
   panel variable:  idcode (unbalanced)
    time variable:  year, 68 to 88, but with gaps
            delta:  1 unit

 . 
 . gen age2=age^2
(24 missing values generated)

 . gen black=(race==2)

 . 
 . xtivreg ln_wage age (tenure = union south), fe i(idcode)

 Fixed-effects (within) IV regression            Number of obs     =     19,007
 Group variable: idcode                          Number of groups  =      4,134

 R-sq:                                           Obs per group:
 within  =      .                                         min =          1
 between = 0.1261                                         avg =        4.6
 overall = 0.0869                                         max =         12

                                            Wald chi2(2)      =  142054.65
corr(u_i, Xb)  = -0.6875                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
 ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  tenure |   .2450528   .0382041     6.41   0.000     .1701741    .3199314
     age |  -.0650873   .0126167    -5.16   0.000    -.0898156    -.040359
   _cons |   2.826672   .2451883    11.53   0.000     2.346112    3.307232
-------------+----------------------------------------------------------------
 sigma_u |  .71990151
 sigma_e |  .64315554
     rho |  .55612637   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F  test that all u_i=0:     F(4133,14871) =     1.53      Prob > F    = 0.0000
------------------------------------------------------------------------------
Instrumented:   tenure
Instruments:    age union south
------------------------------------------------------------------------------

 . 
 . xtoverid

 Test of overidentifying restrictions: 
 Cross-section time-series model: xtivreg fe   
 Sargan-Hansen statistic   0.965  Chi-sq(1)    P-value = 0.3259

 . xtoverid, robust

 Test of overidentifying restrictions: 
 Cross-section time-series model: xtivreg fe  robust 
 Sargan-Hansen statistic   0.960  Chi-sq(1)    P-value = 0.3271

 . xtoverid, cluster(idcode)

 Test of overidentifying restrictions: 
 Cross-section time-series model: xtivreg fe  robust cluster(idcode)
 Sargan-Hansen statistic   0.495  Chi-sq(1)    P-value = 0.4818

从Stata的命令提示符处,键入help xtoverid以获取更多详细信息。