楼主: Les_mauvais
2610 4

[回归分析求助] 关于FGLS求助各位同学 [推广有奖]

  • 0关注
  • 0粉丝

大专生

45%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
383 点
帖子
21
精华
0
在线时间
61 小时
注册时间
2011-10-16
最后登录
2020-1-2

楼主
Les_mauvais 发表于 2013-1-6 07:54:50 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
y是消费,x是收入
这是老师给代码, 其中关于一句命令 gen w=1/(exp(0.5*f)) 完全看不懂,比如为什么是0.5,请各位同学解答一下,谢谢
reg y x
estat hettest x, fstat
predict e, residuals
gen e2=e^2
reg e2 x
reg y x, robust

gen le2=ln(e2)
predict xb, xb
gen xb2=xb^2
reg le2 xb xb2
predict f, xb
gen w=1/(exp(0.5*f))
gen ys=y*w
gen xs=x*w
reg ys xs w, noconstant robust
more


二维码

扫码加我 拉你入群

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

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

关键词:FGLS noconstant Residuals Residual constant

沙发
fgleric 发表于 2013-1-6 09:40:23
reg y x
estat hettest x, fstat //White test
predict e, residuals //get ols residule
gen e2=e^2  //gen residule square
reg e2 x
reg y x, robust

gen le2=ln(e2)
predict xb, xb
gen xb2=xb^2  
reg le2 xb xb2  //regress ols residule square on fitted values
predict f, xb //get the "true" error terms square
gen w=1/(exp(0.5*f)) //get the weight for GLS
gen ys=y*w
gen xs=x*w
reg ys xs w, noconstant robust
more


/*the logic see below
e2 is not qualified for OLS regression because it includes some information caused by x;
thus according to woodbridge,
e2=omega*exp(X), or take log to estimate:
ln(e2)=const+ xb+xb2+error or ln(e2)=const+ xb+error;
you can get ln(e2)hat, which is the weight*/

藤椅
Les_mauvais 发表于 2013-1-7 21:30:44
fgleric 发表于 2013-1-6 09:40
reg y x
estat hettest x, fstat //White test
predict e, residuals //get ols residule
thank u for the nice reply, but I still cant understand why there is a 0.5, why not 0.6 or and so on, according to your word, it is  from woodbridge, could u paraphrase it for me, it will be perfect. thanks a lot.

板凳
fgleric 发表于 2013-1-7 23:36:46
Les_mauvais 发表于 2013-1-7 21:30
thank u for the nice reply, but I still cant understand why there is a 0.5, why not 0.6 or and so  ...
sorry the book is not at hand now.
0.5 is for sq root, remember that f is predicted e^2; and theoretically var(e|x)=omega^2*pi while pi can writted as p'p=inv(pi).

This is why your prof use 0.5 to get sq root value of f (predicted e^2).
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
Les_mauvais + 1 + 1 + 1 精彩帖子

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

报纸
Les_mauvais 发表于 2013-1-10 08:44:30
fgleric 发表于 2013-1-7 23:36
sorry the book is not at hand now.
0.5 is for sq root, remember that f is predicted e^2; and theo ...
thanks a lot, this is quite useful!

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-6 08:10