全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1827 1
2015-01-20
我在做分年分行业回归时代码如下:

egen yindr2=group(year indcode)

su yindr2

loc n=r(max)

g e=.

forval i=1/'n'{

reg DISEXP_TA _TA SALES_1_TA if yindr=='i'

predict r if e(sample), r

replace e=r if e(sample)

drop r

}

但是提示出错了,如下:

invalid syntax
r(198);

请问是什么问题呢?

二维码

扫码加我 拉你入群

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

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

全部回复
2015-1-20 00:17:45
补充代码有一点点小错误,纠正如下:
egen yindr2=group(year indcode)
su yindr2
loc n=r(max)
g e=.
forval i=1/'n'{
reg DISEXP_TA _TA SALES_1_TA if yindr2=='i'
predict r if e(sample), r
replace e=r if e(sample)
drop r
}
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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