全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1037 1
2017-05-07
悬赏 11 个论坛币 未解决
各位老师,我想按行业和年份分组回归求残差,应该是使用循环语句,但是我编的程序不对
gen resid = .
forvalues indus=1/21 {
forvalues year=2003/2012 {
        reg var1 var2 if year == `year' & indus == `indus'
        capture drop resid
        predict resid if e(sample), r
        su resid
        replace resid= r(sd) if year == `year' & indus == `indus'
}
}

请问应该怎么修改?
二维码

扫码加我 拉你入群

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

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

全部回复
2017-5-11 23:51:02
试试
复制代码
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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