Stata xtoverid命令错误
我有面板数据,我的回归形式如下:Stata xtoverid命令错误,stata,Stata,我有面板数据,我的回归形式如下: s_roa1 = s_roa + c_roa 我是Stata的新手,我正在尝试使用xtoverid命令进行鲁棒hausman测试,以帮助我在固定或随机效应模型之间进行选择: xtoverid s_roa1 s_roa c_roa, fe i (year) 但是,我得到以下错误: varlist not allowed 有人能帮我理解这意味着什么吗?首先,xtoverid是一个社区贡献的命令,您在问题中没有明确说明这一点。通常情况下,从一开始就提供此信息是非
s_roa1 = s_roa + c_roa
我是Stata的新手,我正在尝试使用xtoverid
命令进行鲁棒hausman测试
,以帮助我在固定或随机效应模型之间进行选择:
xtoverid s_roa1 s_roa c_roa, fe i (year)
但是,我得到以下错误:
varlist not allowed
有人能帮我理解这意味着什么吗?首先,
xtoverid
是一个社区贡献的命令,您在问题中没有明确说明这一点。通常情况下,从一开始就提供此信息是非常有用的,这样其他人就知道您没有引用正式的内置命令
其次,这是一个后估计命令,这意味着您在使用xtreg
、xtivreg
、xtivreg2
或xthtaylor
估计模型后直接运行它
作者提供的帮助文件提供了一个启发性的例子:
. 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
以了解更多详细信息。表示它的意思。您不需要再次指定回归变量。语法是xtoverid[,robustcluster(varlist)]
,因此最简单的方法就是使用xtoverid
进行回归。再看一下帮助:没有例子在逗号前包含变量名。事实上,选项fe i(year)
也不属于它们。我认为您混淆了不同的命令。@NickCox感谢您的澄清和帮助!非常感谢您的详细回复和帮助!将使问题更清楚,并在将来仔细阅读帮助文件。StataCorp现在使用社区贡献的表达式,而不是用户编写的表达式。