| 所在主题: | |
| 文件名: 新建文件夹.zip | |
| 资料下载链接地址: https://bbs.pinggu.org/a-1020489.html | |
| 附件大小: | |
|
各位大侠,大家好!
我在.dta数据中做配对,配对标准是:同年度、同行业、资产+-20%,ROA最为接近 引用了https://bbs.pinggu.org/thread-696047-1-1.html中voodoo编写的程序(修改后如下), 执行时,但是总是出现“C not found” 我很困惑究竟问题出在哪里? 敬请各位大侠帮助解开我的困惑,不胜感激! before_match.dta在附件里。 下面是程序: capture postclose match postfile match group id year dmatch using matchsample.dta, replace local total = _N local j = 0 forval i = 1/`total' { preserve local lid = id[`i'] local lyear = year[`i'] local lindus = indus[`i'] local lROA = ROA[`i'] local la001000000 = a001000000[`i'] //资产 quietly drop in `i' // 删除自身 quietly keep if indus == `lindus' quietly keep if year == `lyear' gen assetratio = abs(a001000000 / `la001000000' - 1) quietly keep if assetratio <= 0.2// 将条件分成四句keep if ,有助于加快程序 if _N < 1 { //若没有一个公司满足条件,则直接进入下一循环 restore continue } sort ROA // 对ROA排序 local mid = id[1]//若有多个公司满足条件,则用ROA最接近的公司 local j = `j' + 1 post match (`j') (`lid') (`lyear') (0) post match (`j') (`mid') (`lyear') (1) restore } postclose match use matchsample, clear sort id year merge id year using befor_match keep if _merge == 3 drop _merge sort group dmatch label define ldmatch 0 "初始样本" 1 "配对样本" label value dmatch ldmatch list in 1/30 |
|
熟悉论坛请点击新手指南
|
|
| 下载说明 | |
|
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。 2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。 3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。 (如有侵权,欢迎举报) |
|
京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明