悬赏 2 个论坛币 已解决
数据结构中,industry ,roe ,现在想分行业,对roe 里的数据大小进行排序,生成新的变量rroe ,rroe 里面存储 不同行业下,roe的大小排名。
处理代码如下:
egen rroe=rank( roe) if industry=="LED" ————第一步通过,正常
replace rroe=rank( roe) if industry=="氨纶" ——————第二步错误,显示 rank not found
求助,应该怎么改写代码?
最佳答案
蓝色 查看完整内容
sort industry roe
by industry: gen rroe=_n