全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
2007-8-20 19:30:00
找到了,用findit xtserial搜一下就行了
二维码

扫码加我 拉你入群

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

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

2007-8-21 13:59:00

excellent questions asked. the following codes which is I used in my research provide those two tests for panel data. hope it helps


1. /*****wooldridge test for first order autocorrelation****/
tsset county year, yearly
findit xtserial
net sj 3-2 st0039
net install st0039
xtserial y x1 x2 x3 x4 x5


2. /**** LR test for heteroscedasticity ******/
xtgls y x1 x2 x3 x4 x5, i(country) t(year) igls panels(heteroskedastic)
estimates store hetero
xtgls y x1 x2 x3 x4 x5, i(country) t(year)
estimates store nohetero
local df=e(N_g)-1
lrtest hetero nohetero , df(`df')

二维码

扫码加我 拉你入群

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

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

2007-8-22 05:24:00

谢谢蜻蜓点水!!有个疑问,如果检验得知有异方差及自相关,应该如何纠正?理论上说是要用feasible generalized least squares (FGLS) ,就是用你提供的命令xtgls和igsl么?

而且在这个命令xtgls y x1 x2 x3 x4 x5, i(country) t(year) igls panels(heteroskedastic)中的i(country) 和t(year)要提供数据么?举例我有10个国家,6年数据,我要在i(美国,英国,法国等等)t(92 93 94 95 96 97)么?谢谢!

二维码

扫码加我 拉你入群

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

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

2007-8-22 14:40:00

Change your country to numbers first. The following is an example. Your data should look like the following sample. Once you found the problems of heteroscedasticity and autocorrelation using the tests provided, then it will be proper to use FGLS using the following STATA command:


iis country
tis year
xtgls y x1 x2 x3, i(country) t(year) panels(correlated) corr(psar1)

This code corrects for heteroscedasticity across sections (or countries), it corrects for autocorrelation within countries (serial correlation) and contemporaneous correlation (spatial correlation) between countries as well. It is similar (but not exactly same) to Parks’ method in SAS.

Data format

Country year x1 x2 x3
1 1 x x x
1 2 x x x
2 1 x x x
2 2 x x x
3 1 x x x
3 2 x x x

[此贴子已经被作者于2007-8-22 15:29:55编辑过]

二维码

扫码加我 拉你入群

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

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

2007-8-23 04:48:00

奇怪,state总提示我这个问题,

"year is not regularly spaced or does not have intervals of 1 -- use
the force option to treat the intervals as though they were regular"

我数据的形式跟你给的是一样的呀,只是我作回归的时候,多了industry specific time trend (dummy variables)

二维码

扫码加我 拉你入群

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

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

2007-8-23 05:11:00
i dont know at this point. you may need reexamine your panel (say, sorted your data by country first and then year and then use force option). Again. not sure.
二维码

扫码加我 拉你入群

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

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

2007-8-23 13:19:00
Anyway, thanks again
二维码

扫码加我 拉你入群

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

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

2007-8-28 18:16:00

请问各位牛人大大

如果有自相关和异方差的话,用什么命令纠正呢?

谢谢

二维码

扫码加我 拉你入群

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

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

2007-8-29 02:27:00
"xtgls y x1 x2 x3, i(country) t(year) panels(correlated) corr(psar1)

This code corrects for heteroscedasticity across sections (or countries), it corrects for autocorrelation within countries (serial correlation) and contemporaneous correlation (spatial correlation) between countries as well. It is similar (but not exactly same) to Parks’ method in SAS."

二维码

扫码加我 拉你入群

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

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

2007-8-29 02:38:00

谢谢楼上!我的数据是panel data,我只用fixed effect model.

我测试过了,我的模型里面没有自相关的问题

但是存在异方差的问题。

现在的问题是,用xtreg估计后,测试结果有异方差,想纠正的话,用xtgls命令就可以了么?

二维码

扫码加我 拉你入群

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

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

2007-8-29 02:59:00

XTGLS is a random effects model estimation method, in your case, you can use xtreg with vce(robust) option to correct for heteoscedasticity which uses Huber-White (1980) method.

二维码

扫码加我 拉你入群

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

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

2007-8-29 03:36:00

谢谢楼上大大,我再继续学习,如果有问题还会继续请教!

[此贴子已经被作者于2007-8-29 3:44:10编辑过]

二维码

扫码加我 拉你入群

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

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

2007-8-29 03:54:00

请问 "XTGLS is a random effects model estimation method"

的出處在那個資料裡面?謝謝!

二维码

扫码加我 拉你入群

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

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

2007-8-29 04:24:00

xtgls produces generalized least squares estimates for models of the form

yit = xitβ + it

where you may specify the variance structure of it. If you specify that it is independent for all i and

t, xtgls produces the same results as regress up to a small-sample degrees-of-freedom correction

applied by regress but not by xtgls.

You may choose among three variance structures concerning i and three concerning t, producing

a total of nine different models. Assumptions concerning i deal with heteroskedasticity and crosssectional

correlation. Assumptions concerning t deal with autocorrelation and, more specifically, AR(1)

serial correlation.

是這一段麼 ?

另外,vce(robust) option 給我的結果是一個很大的矩陣...

看了很多資料 ,都沒有進展.或許應該忽視異方差的檢驗?

二维码

扫码加我 拉你入群

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

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

2007-9-2 00:33:00
请问针对fixed effect模型,能否就用xttest3命令进行异方差的检验,用xtserial命令进行自相关的检验?谢谢。
二维码

扫码加我 拉你入群

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

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

2007-9-25 21:33:00
以下是引用蜻蜓点水在2007-8-29 2:27:00的发言:
"xtgls y x1 x2 x3, i(country) t(year) panels(correlated) corr(psar1)

This code corrects for heteroscedasticity across sections (or countries), it corrects for autocorrelation within countries (serial correlation) and contemporaneous correlation (spatial correlation) between countries as well. It is similar (but not exactly same) to Parks’ method in SAS."

请问蜻蜓点水:

我用xtgls y x1 x2 x3估计结果很多变量都不显著,但Wald chi2不大

但若我用xtgls y x1 x2 x3,p(h) c(p)估计结果使得刚才不显著的变量都在1%水平显著,Wald Chi2达到几十万。这如何解释呢?

谢谢

二维码

扫码加我 拉你入群

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

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

2007-9-26 08:21:00

xtgls 的理论解释可以参考Greene(2000,4th,chp15);

个人认为它比较适合“大T小N”或N和T相当的面板数据,而对于使用最为广泛的“大N小T”型面板该命令并不适用。可以考虑使用 xtscc 命令得到异方差、序列相关、截面相关稳健型标准误。

fintit xtscc

命令的说明参考 stata journal, 2007, vol3. 在论坛中可以搜索得到该文档。

二维码

扫码加我 拉你入群

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

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

2008-3-19 12:03:00

同意47楼观点。xtgls 主要适合大T小N,不适合大N小T。xtscc 不能用作randon effect. 

 xtscc produces Driscoll and Kraay (1998) standard errors for coefficients estimated by pooled OLS/WLS or
    fixed-effects (within) regression. depvar is the dependent variable and varlist is an (optional) list of
    explanatory variables.

    The error structure is assumed to be heteroskedastic, autocorrelated up to some lag, and possibly correlated
    between the groups (panels). These standard errors are robust to very general forms of cross-sectional
    ("spatial") and temporal dependence when the time dimension becomes large. However, because this
    nonparametric technique of estimating standard errors does not place any restrictions on the limiting
    behavior of the number of panels, the size of the cross-sectional dimension in finite samples does not
    constitute a constraint on feasibility - even if the number of panels is much larger than T.  Nevertheless,
    because the estimator is based on an asymptotic theory one should be somewhat cautious with applying this
    estimator to panel datasets with a large number of groups that have only a short number of observations.

二维码

扫码加我 拉你入群

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

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

2008-5-5 10:46:00
学习了!那如果是大N小T的,应该用什么命令纠正异方差和自相关呢?

二维码

扫码加我 拉你入群

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

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

2008-5-6 09:09:00
xtscc 可以。 
二维码

扫码加我 拉你入群

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

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

2008-5-6 12:34:00
XTSCC可以用在随机效应中吗?
二维码

扫码加我 拉你入群

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

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

2008-5-6 20:40:00
可以。option里面加fe才是固定效应。你可以help xtscc
二维码

扫码加我 拉你入群

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

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

2008-5-9 10:45:00

xtscc不能做re的吧

[此贴子已经被作者于2008-5-9 12:34:04编辑过]

二维码

扫码加我 拉你入群

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

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

2009-5-17 10:01:00
消除异方差的时候它提示说panels must be balanced。。。怎么解决?谢谢
二维码

扫码加我 拉你入群

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

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

2009-11-24 08:29:59
学到不少东西,留个贴做记号
二维码

扫码加我 拉你入群

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

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

2009-11-29 11:48:40
1# nkzhh

大大解答的真好

但是stata 10說
xtserial y x

unrecognized command:
請問大大們為何會這樣子呢
二维码

扫码加我 拉你入群

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

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

2009-11-29 13:11:17
57# chrit13

那如果用

xtscc y x1 x2 x3

xtscc y x1 x2 x3,fe

我們要怎麼去比較 上述二條模型何者較佳呢?

而且我也試著用
xtreg y x1 x2 x3,re 用hausman test去與 xtscc y x1 x2 x3 比較那個模型合式,這樣子的方式是對的嗎
請大家幫忙,萬分謝謝
二维码

扫码加我 拉你入群

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

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

2009-11-29 14:08:11
2. /**** LR test for heteroscedasticity ******/
xtgls y x1 x2 x3 x4 x5, i(country) t(year) igls panels(heteroskedastic)
estimates store hetero
xtgls y x1 x2 x3 x4 x5, i(country) t(year)
estimates store nohetero
local df=e(N_g)-1
lrtest hetero nohetero , df(`df')

請問用LR test for heteroscedasticity
那他的HO與H1怎設
謝謝回答
二维码

扫码加我 拉你入群

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

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

2009-12-2 20:06:41
当然需要检验
二维码

扫码加我 拉你入群

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

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

2009-12-6 10:57:29
xtgls 一般用来检验随即效应异方差,而xtscc用来检验固定效应异方差,建议多看看help xtgls ,help xtscc。
二维码

扫码加我 拉你入群

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

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

栏目导航
热门文章
推荐文章

说点什么

分享

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