全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
11039 2
2012-02-13

我需要预测回归的残差和拟合值,根据连老师和Sungmoo编的程序, 加入下几道程序(下面黑体部分),但系统提示:h  already define. 请问高人怎办?用该程序如何得到拟合值?非常感谢!



egen g=group( year ind  )

su g

loc n=r(max)

g e=.

g c=.

forv i=1/`n'{

reg  sales MB  cfo  invest  if g==`i'

predict r if e(sample),r

predict h if e(sample), hat

replace e=r if e(sample)

replace c=h  if e(sample)

drop r  c

}

drop g

二维码

扫码加我 拉你入群

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

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

全部回复
2012-2-13 07:27:09
drop r h
二维码

扫码加我 拉你入群

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

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

2012-2-13 11:17:35
sungmoo,再次非常感谢!请问如果系统提示“insufficient observations”,该怎么办? 删除样本不足是否结果会好? 但我删除样本的行业后,得到的残差更少,该怎么解决呢?
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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