全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
3966 7
2007-09-24
<P><STRONG><FONT face=Verdana color=#000000>按arlionn说的控制个体效果的操作,</FONT></STRONG></P>
<P>tsset province year</P>
<P>xtreg y x1-x7,fe</P>
<P>xtdata y x1-x7 year,fe clear</P>
<P>abar, lags(3) (发现存在一阶自相关)</P>
<P>xtgls y x1 x2 x3 x4 x5 x6 x7, panels(correlated) corr(ar1)Cross-sectional time-series FGLS regression</P>
<P>Coefficients:  generalized least squares<BR>Panels:        heteroskedastic with cross-sectional correlation<BR>Correlation:   common AR(1) coefficient for all panels  (0.0441)</P>
<P>Estimated covariances      =        66          Number of obs      =        99<BR>Estimated autocorrelations =         1          Number of groups   =        11<BR>Estimated coefficients     =         8          Time periods       =         9<BR>                                                Wald chi2(7)       =  1.81e+07<BR>                                                Prob > chi2        =    0.0000</P>
<P>------------------------------------------------------------------------------<BR>           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]<BR>-------------+----------------------------------------------------------------<BR>          x1 |   3.407846   .0361053    94.39   0.000     3.337081    3.478611<BR>          x2 |  -.0825687   .0001589  -519.69   0.000    -.0828801   -.0822573<BR>          x3 |   .1726899    .000246   702.00   0.000     .1722077     .173172<BR>          x4 |   .1446033   .0002017   716.93   0.000      .144208    .1449986<BR>          x5 |    .244987    .000687   356.62   0.000     .2436406    .2463334<BR>          x6 |   1.392012   .0089145   156.15   0.000      1.37454    1.409485<BR>          x7 |  -.1784017   .0006139  -290.61   0.000    -.1796049   -.1771985<BR>       _cons |  -30.99539   .3388195   -91.48   0.000    -31.65947   -30.33132<BR>------------------------------------------------------------------------------<BR>为什么z检验值异常的大呢?<STRONG><FONT face=Verdana>arlionn能帮忙解释一下这个结果是否正确么?其他达人如知道也请指点!多谢了!</FONT></STRONG></P>
二维码

扫码加我 拉你入群

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

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

全部回复
2007-9-24 15:30:00

能否提供数据,我做一下,看看问题出在哪里?

二维码

扫码加我 拉你入群

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

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

2007-9-24 15:46:00
好的,我发到你邮箱里,多谢!
二维码

扫码加我 拉你入群

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

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

2007-9-25 20:08:00

Chi2也很离奇啊

Wald chi2(7) = 1.81e+07

我的估计结果也是这样,什么原因呢


二维码

扫码加我 拉你入群

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

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

2007-9-25 21:07:00
arlionn忙么?给你发的数据收到了了么?顺祝大家中秋快乐!
二维码

扫码加我 拉你入群

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

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

2007-9-26 10:17:00
以下是引用shaoshuai521在2007-9-25 21:07:00的发言:
arlionn忙么?给你发的数据收到了了么?顺祝大家中秋快乐!

十分抱歉,这两天较忙,所以现在才回复你的帖子。下面是我的答复:

* 该文件的目的在于说明,shaoshuai521 采用我建议的两种方法之所以得到了不同的结果
* 是因为没有注意到 xtgls 命令背后的基本假设,即,如果选择 p(c) 选项,则必须满足 T>=N.
* 在对数据进行简单处理,并满足该假设后,我建议的两种方法是等价的。

[-下载数据和清晰版结果-]

158024.rar
大小:(9.57 KB)

 马上下载

在线查看结果方法:点击压缩包,进入,打开 shao_hlog.html 文件即可。

* =================stata codes======================

cd D:\stata9\ado\personal\others
cap log close
log using shao, text replace
use "D:\stata9\ado\personal\others\shao.dta", clear

tsset p year
qui tab p, gen(dump)
drop dump1

*===============Part I=========shaoshuai521's results========
*-> shaoshuai521's original results
* here, T<N, so it not feasible to use the option `panels(c)'
* we can see that three province dummies are dropped
* this leads to the difference between the two methods.
qui xtgls y x1-x7 dump*, panels(correlated) corr(ar1)
est store gls

preserve
xtdata, fe clear
list p year y x1 in 1/10
qui xtgls y x1-x7, panels(correlated) corr(ar1)
est store xtdata_gls
restore
est table *gls, b(%6.3f) se(%6.4f)
* Comment: the fact that T<N make the differnece between these two methods


*===============Part II========Arlion's results=========
* now, we drop three provinces, so that T>=N
preserve
drop if province <4
drop dump2-dump4

* method_1-revisit
qui xtgls y x1-x7 dump*, panels(correlated) corr(ar1)
est store gls_a
* method_2-revisit
xtdata, fe clear
list p year y x1 in 1/10
qui xtgls y x1-x7, panels(correlated) corr(ar1)
est store xtdata_gls_a
est table *gls_a, b(%6.3f) se(%6.4f)
restore
* Comment: now, the same results got from these two methods.


*===============Part III========The correct way to estimate shaoshuai521's model=========
qui xtscc y x1-x7,fe
est store xtscc
qui xtreg y x1-x7,fe
est store fe
qui xtreg y x1-x7,fe robust
est store fe_r
qui xtgls y x1-x7, p(h) corr(ar1)
est store gls_h_ar
est table xtscc fe fe_r gls_h_ar, b(%6.3f) se(%6.4f)
* Comment:
* (1) the results got from xtgls is seriouly different from those got form xtreg or xtscc
* (2) xtreg,fe robust consider only het
* (3) xtscc,fe consider both het, ar, and cross-scetional correlation.

* Moreover, I sugguset you to drop x1, because x1 is seriouly correlated to other regressors
pwcorr y x*, star(0.01)
* we can see that, x1 is correlated with x2-x6 at 1% significant level.

log close

* ====================results=======================

----------------------------------------------------------------------------------------------------------
log: D:\stata9\ado\personal\others\shao.log
log type: text
opened on: 26 Sep 2007, 09:58:31

. use "D:\stata9\ado\personal\others\shao.dta", clear

.
. tsset p year
panel variable: province (strongly balanced)
time variable: year, 1997 to 2005

. qui tab p, gen(dump)

. drop dump1

.


. *===============Part I=========shaoshuai521's results========
. *-> shaoshuai521's original results
. * here, T<N, so it not feasible to use the option `panels(c)'
. * we can see that three province dummies are dropped
. * this leads to the difference between the two methods.
. qui xtgls y x1-x7 dump*, panels(correlated) corr(ar1)

. est store gls

.
. preserve

. xtdata, fe clear

. list p year y x1 in 1/10

+---------------------------------------+
| province year y x1 |
|---------------------------------------|
1. | 1 1997 5.523884 8.105545 |
2. | 1 1998 5.423883 8.216499 |
3. | 1 1999 3.723884 8.298578 |
4. | 1 2000 5.823884 8.37939 |
5. | 1 2001 6.023884 8.483179 |
|---------------------------------------|
6. | 1 2002 8.723884 8.58737 |
7. | 1 2003 13.62388 8.710558 |
8. | 1 2004 16.12388 8.917546 |
9. | 1 2005 19.32388 9.157933 |
10. | 2 1997 7.468328 8.256061 |
+---------------------------------------+

. qui xtgls y x1-x7, panels(correlated) corr(ar1)

. est store xtdata_gls

. restore

. est table *gls, b(%6.3f) se(%6.4f)

----------------------------------
Variable | gls xtdat~s
-------------+--------------------
x1 | 2.542 3.408
| 0.8199 0.0361
x2 | -0.046 -0.083
| 0.0296 0.0002
x3 | 0.174 0.173
| 0.0158 0.0002
x4 | 0.147 0.145
| 0.0416 0.0002
x5 | 0.266 0.245
| 0.0675 0.0007
x6 | 0.766 1.392
| 0.5391 0.0089
x7 | -0.235 -0.178
| 0.1038 0.0006
dump2 | 0.000
| 0.0000
dump3 | 0.000
| 0.0000
dump4 | -2.703
| 0.9691
dump5 | -3.749
| 1.2713
dump6 | -6.226
| 1.0935
dump7 | 0.000
| 0.0000
dump8 | -3.690
| 1.0020
dump9 | -5.869
| 1.0228
dump10 | -7.953
| 1.2604
dump11 | -8.050
| 1.2656
_cons | -19.136 -30.995
| 6.1864 0.3388
----------------------------------
legend: b/se

. * Comment: the fact that T<N make the differnece between these two methods
.
.
. *===============Part II========Arlion's results=========
. * now, we drop three provinces, so that T>=N
. preserve

. drop if province <4
(27 observations deleted)

. drop dump2-dump4

.
. * method_1-revisit
. qui xtgls y x1-x7 dump*, panels(correlated) corr(ar1)

. est store gls_a

. * method_2-revisit
. xtdata, fe clear

. list p year y x1 in 1/10

+---------------------------------------+
| province year y x1 |
|---------------------------------------|
1. | 4 1997 10.04606 8.137411 |
2. | 4 1998 7.846379 8.264727 |
3. | 4 1999 6.175583 8.327683 |
4. | 4 2000 8.844497 8.383391 |
5. | 4 2001 7.008513 8.471063 |
|---------------------------------------|
6. | 4 2002 8.620567 8.552408 |
7. | 4 2003 9.793627 8.64372 |
8. | 4 2004 11.18905 8.761012 |
9. | 4 2005 10.48378 8.936693 |
10. | 5 1997 7.785256 8.184393 |
+---------------------------------------+

. qui xtgls y x1-x7, panels(correlated) corr(ar1)

. est store xtdata_gls_a

. est table *gls_a, b(%6.3f) se(%6.4f)

----------------------------------
Variable | gls_a xtdat~a
-------------+--------------------
x1 | 2.411 2.411
| 0.6115 0.6115
x2 | -0.040 -0.040
| 0.0173 0.0173
x3 | 0.108 0.108
| 0.0105 0.0105
x4 | 0.183 0.183
| 0.0284 0.0284
x5 | 0.230 0.230
| 0.0471 0.0471
x6 | -0.000 -0.000
| 0.3401 0.3401
x7 | -0.197 -0.197
| 0.0803 0.0803
dump5 | -0.659
| 0.7207
dump6 | -3.398
| 0.3251
dump7 | -0.531
| 0.4686
dump8 | -0.771
| 0.9007
dump9 | -2.071
| 0.7331
dump10 | -4.077
| 0.7243
dump11 | -5.178
| 0.8516
_cons | -17.213 -19.298
| 4.2625 3.9856
----------------------------------
legend: b/se

. restore

. * Comment: now, the same results got from these two methods.
.
.
. *===============Part III========The correct way to estimate shaoshuai521's model=========
. qui xtscc y x1-x7,fe

. est store xtscc

. qui xtreg y x1-x7,fe

. est store fe

. qui xtreg y x1-x7,fe robust

. est store fe_r

. qui xtgls y x1-x7, p(h) corr(ar1)

. est store gls_h_ar

. est table xtscc fe fe_r gls_h_ar, b(%6.3f) se(%6.4f)

------------------------------------------------------
Variable | xtscc fe fe_r gls_h~r
-------------+----------------------------------------
x1 | 3.681 3.681 3.681 1.849
| 0.7265 1.8696 1.5566 0.8573
x2 | -0.087 -0.087 -0.087 -0.053
| 0.0223 0.0547 0.0461 0.0222
x3 | 0.172 0.172 0.172 0.077
| 0.0249 0.0369 0.0398 0.0269
x4 | 0.138 0.138 0.138 0.134
| 0.0709 0.0799 0.0730 0.0622
x5 | 0.237 0.237 0.237 0.221
| 0.0687 0.1688 0.2120 0.1087
x6 | 1.513 1.513 1.513 -1.179
| 0.3490 1.0874 1.0292 0.7675
x7 | -0.200 -0.200 -0.200 0.064
| 0.1168 0.1952 0.2166 0.1379
_cons | -33.034 -33.034 -33.034 -11.886
| 4.4667 13.7273 11.0145 7.2353
------------------------------------------------------
legend: b/se

. * Comment:
. * (1) the results got from xtgls is seriouly different from those got form xtreg or xtscc
. * (2) xtreg,fe robust consider only het
. * (3) xtscc,fe consider both het, ar, and cross-scetional correlation.
.
. * Moreover, I sugguset you to drop x1, because x1 is seriouly correlated to other regressors
. pwcorr y x*, star(0.01)

| y x1 x2 x3 x4 x5 x6
-------------+---------------------------------------------------------------
y | 1.0000
x1 | 0.5370* 1.0000
x2 | 0.0250 0.3916* 1.0000
x3 | 0.3652* 0.5073* 0.4936* 1.0000
x4 | 0.1633 0.6048* 0.4015* 0.1519 1.0000
x5 | -0.3231* -0.4265* -0.1435 -0.5044* -0.0787 1.0000
x6 | -0.4580* -0.5588* -0.3567* -0.5632* -0.1109 0.4269* 1.0000
x7 | 0.0363 -0.2149 -0.5626* 0.0404 -0.3338* 0.1966 0.0181

| x7
-------------+---------
x7 | 1.0000

. * we can see that, x1 is correlated with x2-x6 at 1% significant level.
.
. log close
log: D:\stata9\ado\personal\others\shao.log
log type: text
closed on: 26 Sep 2007, 09:58:32
----------------------------------------------------------------------------------------------------------


[此贴子已经被作者于2007-9-26 10:21:04编辑过]

二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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