全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
2154 1
2016-11-24
match.dta
大小:(196.02 KB)

 马上下载


样本公司的哑变量sp为1,需要从哑变量sp为0的公司的寻找配对样本,条件是年份year相同,行业ind相同。
我运行了前辈给的程序
bys year ind sp (stkcd):g exp=_n if sp
bys year ind :egen s=max(exp)
drop if s==.
expandcl s if !sp,cl(year stkcd) gen(g)
bys year stkcd:replace exp=_n if !sp
bys year ind exp:egen r=sum(asset*sp)
g q=abs(asset-r) if !sp

sort q stkcd
count if q<.
loc m=r(N)
forv i=1/`m'{
loc v=stkcd[`i']
replace q=. if stkcd==`v'&_n>`i'&!sp
}
drop if q==.&!sp

bys year ind exp:egen u=min(q) if !sp
drop if u!=q&!sp
egen mat=group(year ind exp)
drop exp-u
sort mat sp


但是样本量太大,一直跑不出结果来,真心求问还有什么解决办法。
附件列表

bbb待配对1121.dta

大小:313.09 KB

 马上下载

二维码

扫码加我 拉你入群

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

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

全部回复
2016-11-24 14:54:58
我也遇到过这种问题...一直不知道如何解决,好像除了减少样本量  或者换其他分析软件外,并无他法
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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