请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
throndon 发表于 2015-7-6 12:56 你可以这样:gen v2=v1 duplicates report duplicates drop v2
throndon 发表于 2015-7-6 14:36 错了,应该是bysort v2: egen v3=count(v1)
andystata 发表于 2015-7-6 14:51 现在又是type mismatch了。。
throndon 发表于 2015-7-6 15:13 那你将V1变量变成string字符串类型,命令为:tostring v1,replace
throndon 发表于 2015-7-6 16:25 egen v3=count(v1) if v1=="a" replace v3=count(v1) if v1=="b" replace v3=count(v1) if v1=="c"
andystata 发表于 2015-7-7 00:11 又是type mismatch了。。
hanlinxian246 发表于 2016-4-8 17:10 我晕!
andystata 发表于 2015-7-6 12:40 举个例子 v1=(a a a b b b b c c c c c c) 那么生成的v2应该等于v2=(a b c),v3应该等于(3 4 6). 我用了dup ...
banxian0216 发表于 2016-7-26 20:42 原谅我挖个坟,标记数据重复数的方法应该是duplicates tag [var] , generate(newvar)。楼主也许看不到了, ...