请问我有二笔资料,母文件和子档。我想以子文件为索引,在母文件中找寻sale成绩与最近的对手,
最接近的对手定义= min abs(psale-ssale)但不能为本身。
之前在sas做是用sql的left join加where去做,但stata好像沒有完整的sql。
感觉好像要在子档写loop,以子档的条件下,找寻销售额差异最小,并返回
对应的公司…
感谢大家。
数据链路:http://pan.baidu.com/s/1nuAJyad
资料:
母檔=
com year group psale
apple 1998 1 8
lg 1998 1 42
acer 1998 1 9
asus 1998 1 25
hp 1998 1 57
samsung 1998 1 13
htc 1998 1 94
ms 1998 1 2
lemax 1998 2 20
.
.
子檔=
com year group ssale closeone
lg 1998 1 42 hp
samsung 1998 1 13
vivo 1998 2 37


雷达卡





京公网安备 11010802022788号







