楼主: suly
4777 7

[原创博文] 关于排序分组 [推广有奖]

  • 0关注
  • 0粉丝

博士生

19%

还不是VIP/贵宾

-

威望
0
论坛币
996 个
通用积分
0.0700
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
4210 点
帖子
157
精华
0
在线时间
209 小时
注册时间
2007-12-20
最后登录
2020-5-3

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
56   proc rank data=match2 out=match3 groups=10;
57       by year1;
58       var msmvttl;
59       ranks yeargroup;
60   run;
ERROR: Data set WORK.MATCH2 is not sorted in ascending sequence. The current by-group has year1 =
       2009 and the next by-group has year1 = 1997.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 146 observations read from the data set WORK.MATCH2.
谁能告诉我这种错误是什么意思啊?多谢
二维码

扫码加我 拉你入群

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

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

关键词:observations observation Processing sequence observat sequence because current stopped groups

回帖推荐

yongyitian 发表于2楼  查看完整内容

1. proc sort data=match2 out=match3; by year1; run; 2. proc rank data = match3 out=match4 groups=10; by year1; var msmvttl; ranks yeargroup; run;

本帖被以下文库推荐

沙发
yongyitian 发表于 2010-7-29 23:04:22 |只看作者 |坛友微信交流群
1. proc sort data=match2 out=match3;
    by year1;
    run;

2. proc rank data = match3 out=match4 groups=10;
    by year1;
    var msmvttl;
    ranks yeargroup;
    run;
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

总评分: 经验 + 3  论坛币 + 3   查看全部评分

使用道具

藤椅
BraveMadMan 发表于 2010-7-29 23:54:03 |只看作者 |坛友微信交流群
正如楼上所说的,分组前要先排序。
Don't get lost in technical details. What is the big picture?

使用道具

板凳
suly 发表于 2010-7-30 13:13:34 |只看作者 |坛友微信交流群
当然了,我已经排过序了.我取的数据是199704----201004.算得是今年5月到下年5月的return.
data match2;
        set match1;
        if month<5 then year1=year-1;
        else year1=year+0;
        run;
主要是这个error: The current by-group has year1 =
       2009 and the next by-group has year1 = 1997.不知道怎么回事.

使用道具

报纸
suly 发表于 2010-7-30 13:47:11 |只看作者 |坛友微信交流群
另外我分组的时候想分为1到10组,结果出来后是,0到9组.这怎么回事啊

使用道具

地板
BraveMadMan 发表于 2010-7-30 20:28:40 |只看作者 |坛友微信交流群
suly 发表于 2010-7-30 13:13
当然了,我已经排过序了.我取的数据是199704----201004.算得是今年5月到下年5月的return.
data match2;
        set match1;
        if month
发点样本数据和你排序的程序上来。
Don't get lost in technical details. What is the big picture?

使用道具

7
BraveMadMan 发表于 2010-7-30 20:31:05 |只看作者 |坛友微信交流群
suly 发表于 2010-7-30 13:47
另外我分组的时候想分为1到10组,结果出来后是,0到9组.这怎么回事啊
proc rank的结果是从0组开始。你可以把它改为从1(或任何数字)开始:

  1. proc match3; set match3;
  2.   yeargroup=yeargroup+1;
  3. run;
复制代码
已有 1 人评分热心指数 收起 理由
crackman + 1 热心解答

总评分: 热心指数 + 1   查看全部评分

Don't get lost in technical details. What is the big picture?

使用道具

8
suly 发表于 2010-7-30 21:45:13 |只看作者 |坛友微信交流群
7# BraveMadMan
谢谢你这个解答. 我重新做了一遍程序没有任何改变,又没有错误提示了.很奇怪.帮我看看另一个merge问题把

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-19 23:37