egen group=group(country industry)
sum group
local n=r(max)
gen e=.
forvalue i=1/`n' {
reg y x1 x2 x3 x4 if g==`i'
est store m_`i'
predict r if e(sample), res
replace e=r if e(sample)
drop r
}
drop g
|
楼主: louleilei
|
1768
2
[回归分析求助] 每个公司同时分行业分国家回归,求每个公司的残差。代码怎么写? |
|
已卖:1份资源 大专生 33%
-
|
60论坛币
最佳答案 | |
|
|
| ||
加好友,备注jltj京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


