楼主: sqzdk
27727 34

[面板数据求助] 用stata对付异方差&自相关in panel data? [推广有奖]

  • 0关注
  • 0粉丝

VIP

硕士生

94%

还不是VIP/贵宾

-

威望
0
论坛币
738 个
通用积分
0.0387
学术水平
2 点
热心指数
2 点
信用等级
1 点
经验
2368 点
帖子
142
精华
0
在线时间
124 小时
注册时间
2006-3-27
最后登录
2021-5-22

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
<P><BR>有没有人知道如何对付  both 异方差and 自相关 with panel data in Stata? </P>
<P>I'm confused about how to use standard test (white's, durbin-watson, etc.) with panel data. </P>
<P>Thx a lot!!!</P>
二维码

扫码加我 拉你入群

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

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

关键词:panel data Panel Stata Data pane standard about white 如何

沙发
canopus 发表于 2007-5-8 17:42:00 |只看作者 |坛友微信交流群

我也有同样问题。看过一些材料以后,发现以下几点,大家交流以下。

1.对于异方差可以使用white test, 方法如下:

regress y x1 x2

predict residus

gen residus2=residus^2

regress residus2 x1 x2 x1*x2 x1^2 x2^2

我在一个材料中发现,panel有专门的一个命令可以实现以上过程,好像是xttest3,or xttest2,但是我使用以后发现stata8.0 无法辨识这个命令,不知道为什么?敬请高手指点!

2. 对于自相关,Stata也有同样的test 验证自相关的存在。

当发现存在有异方差和自相关存在时,在stata中可以使用xtgls实现,具体方法可以使用help xtgls 了解。

使用道具

藤椅
hgz2373294 发表于 2007-5-9 07:57:00 |只看作者 |坛友微信交流群
搜索我要论坛的文章
大数据晓(小)众商!

使用道具

板凳
sqzdk 发表于 2007-5-10 00:45:00 |只看作者 |坛友微信交流群

输入命令 findit whitetst 可以下载到一个 white test 和 Breusch-Pagan test的module

使用道具

报纸
蕭博文 发表于 2007-5-11 01:12:00 |只看作者 |坛友微信交流群

you can use xttest3 to test homo

but you should download xttest3 first

the Ho:homo ;H1:heme

or you can see hlep xttest3, you can find more information

I hope that can hlep you

by the way who can teach me how to test AR

使用道具

地板
littlebone 发表于 2007-5-14 03:06:00 |只看作者 |坛友微信交流群

(1)The potential heteroskedasticity across panels can be tested using an LR test:

To conduct LR test we need estimate the model both with panel-level heteroskedasticity and without heteroskedasticity, that is, the model under H0 (with restriction) and under H1 (without restriction).We need also tell Stata how many constraints we have implied. So, for example, we can type

xtgls depvar indepvars, igls panels(heteroskedastic) estimates store heterotest xtgls depvar indepvars

local df = e(N_g) - 1
lrtest heterotest . , df(`df')

(2) Wooldridge (2002, pp.282–283) derives a simple test for autocorrelation in panel-data models, which is written by David Drukker as a user-written program in Stata called xtserial. You can type simply

xtserial depvar indepvars

I hope that would be helpful.

使用道具

7
littlebone 发表于 2007-5-14 03:24:00 |只看作者 |坛友微信交流群

刚才发的部分句子排列有些乱,重发一遍异方差检验的Stata命令:

(1)

xtgls depvar indepvars, igls panels (heteroskedastic)

estimates store heterotest

xtgls depvar indepvars

local df = e(N_g) - 1

lrtest heterotest . , df(`df')

使用道具

8
minixi 发表于 2007-5-15 05:54:00 |只看作者 |坛友微信交流群

. xtgls lny lnK lnH lnh, igls
Iteration 1: tolerance = 0


Cross-sectional time-series FGLS regression

Coefficients: generalized least squares
Panels: homoskedastic
Correlation: no autocorrelation

Estimated covariances = 1 Number of obs = 580
Estimated autocorrelations = 0 Number of groups = 29
Estimated coefficients = 4 Time periods = 20
Wald chi2(3) = 41817.64
Log likelihood = 297.2711 Prob > chi2 = 0.0000

------------------------------------------------------------------------------
lny | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lnK | .8342499 .0110449 75.53 0.000 .8126023 .8558975
lnH | .2598012 .011067 23.48 0.000 .2381104 .2814921
lnh | .1848715 .0507405 3.64 0.000 .0854221 .284321
_cons | -.8035356 .1137101 -7.07 0.000 -1.026403 -.5806678
------------------------------------------------------------------------------

.
. estimates store heterotest

.
. xtgls lny lnK lnH lnh

Cross-sectional time-series FGLS regression

Coefficients: generalized least squares
Panels: homoskedastic
Correlation: no autocorrelation

Estimated covariances = 1 Number of obs = 580
Estimated autocorrelations = 0 Number of groups = 29
Estimated coefficients = 4 Time periods = 20
Wald chi2(3) = 41817.64
Log likelihood = 297.2711 Prob > chi2 = 0.0000

------------------------------------------------------------------------------
lny | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lnK | .8342499 .0110449 75.53 0.000 .8126023 .8558975
lnH | .2598012 .011067 23.48 0.000 .2381104 .2814921
lnh | .1848715 .0507405 3.64 0.000 .0854221 .284321
_cons | -.8035356 .1137101 -7.07 0.000 -1.026403 -.5806678
------------------------------------------------------------------------------

. local df = e(N_g) - 1

.
. lrtest heterotest . , df(`df')

Likelihood-ratio test LR chi2(28) = 0.00
(Assumption: . nested in heterotest) Prob > chi2 = 1.0000



[此贴子已经被作者于2007-5-15 6:00:14编辑过]

使用道具

9
蕭博文 发表于 2007-5-15 21:25:00 |只看作者 |坛友微信交流群

minixi 是用LR test

xttest3是用wald test

您可以用二者分別檢定,看結果是否有一致

使用道具

10
minixi 发表于 2007-5-17 02:12:00 |只看作者 |坛友微信交流群

. xtgls lny lnK lnH lnh ,panels(he) corr(psar1)

Cross-sectional time-series FGLS regression

Coefficients: generalized least squares
Panels: heteroskedastic
Correlation: panel-specific AR(1)

Estimated covariances = 29 Number of obs = 580
Estimated autocorrelations = 29 Number of groups = 29
Estimated coefficients = 4 Time periods = 20
Wald chi2(3) = 15191.74
Log likelihood = 754.5655 Prob > chi2 = 0.0000

------------------------------------------------------------------------------
lny | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lnK | .7206795 .0154327 46.70 0.000 .690432 .750927
lnH | .317322 .0191238 16.59 0.000 .2798401 .354804
lnh | .7383365 .0941736 7.84 0.000 .5537596 .9229134
_cons | -1.639296 .1981074 -8.27 0.000 -2.02758 -1.251013
------------------------------------------------------------------------------

. xttest3

Modified Wald test for groupwise heteroskedasticity
in cross-sectional time-series FGLS regression model

H0: sigma(i)^2 = sigma^2 for all i

chi2 (29) = 2602.54
Prob>chi2 = 0.0000


. xtgls lny lnK lnH lnh

Cross-sectional time-series FGLS regression

Coefficients: generalized least squares
Panels: homoskedastic
Correlation: no autocorrelation

Estimated covariances = 1 Number of obs = 580
Estimated autocorrelations = 0 Number of groups = 29
Estimated coefficients = 4 Time periods = 20
Wald chi2(3) = 41817.64
Log likelihood = 297.2711 Prob > chi2 = 0.0000

------------------------------------------------------------------------------
lny | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lnK | .8342499 .0110449 75.53 0.000 .8126023 .8558975
lnH | .2598012 .011067 23.48 0.000 .2381104 .2814921
lnh | .1848715 .0507405 3.64 0.000 .0854221 .284321
_cons | -.8035356 .1137101 -7.07 0.000 -1.026403 -.5806678
------------------------------------------------------------------------------

. xttest3

Modified Wald test for groupwise heteroskedasticity
in cross-sectional time-series FGLS regression model

H0: sigma(i)^2 = sigma^2 for all i

chi2 (29) = 533.27
Prob>chi2 = 0.0000

请比较?

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-24 04:21