由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - sas help
相关主题
SQL find distinct values in large table (转载)请教一sas code
sas help, how to manipulating on the format valuesas问题
请教一个proc transpose的问题请教proc sql
recommend several good Data Mining blogsR table问题弱问
问一个统计F value的问题-急!问几题sas adv, 多谢了!
SAS question[合集] 请问个面试 data analyst 的问题 (转载)
unix sas如何防止别人lock自己的data?问一个proc sql的问题,多谢
keep group of values of SQL procedure in one table (转载)问一个SAS DATA 处理的问题,谢谢!
相关话题的讨论汇总
话题: aa话题: sas话题: smallest话题: get话题: do
进入Statistics版参与讨论
1 (共1页)
a********a
发帖数: 346
1
The sas data set like:
id aa
1 2
1 2
1 4
1 5
1 5
1 5
2 3
2 3
2 3
2 10
2 10
2 15
....
How do you get the smallest aa out in each id? I also want to get all the
smallest aa even aa has several same values.
i.e. I want to get
id aa
1 2
1 2
2 3
2 3
2 3
Thanks
f********t
发帖数: 117
2
select t.* from table t, (select id, min(aa) as aamin
from table
group by id ) tmin
where t.aa = tmin.aamin and t.id = tmin.id order by t.id
a********a
发帖数: 346
3
Thanks firstquant, I do not understand the program very well, but it works.
a********a
发帖数: 346
4
Is there any idea how to do this in R?
Thanks
f********t
发帖数: 117
5
Im not a R expert. I guess you have to do it sby step.
first you sort table by id, and aa asc. you loop to keep the first row for
each id.(or here you can keep the all rows with min value, then you dont
need to do anything else) then you merge table with this new table by id
and min.
发信人: acervulina (acervulina), 信区: Statistics
标 题: Re: sas help
发信站: BBS 未名空间站 (Mon May 11 10:07:07 2009)
Is there any idea how to do this in R?
Thanks
1 (共1页)
进入Statistics版参与讨论
相关主题
问一个SAS DATA 处理的问题,谢谢!问一个统计F value的问题-急!
怎么快速将 大的暂时sas data 存为永久sas data?SAS question
请教高手:如何在winbugs里使用max(a,b)function?unix sas如何防止别人lock自己的data?
急 SAS问题keep group of values of SQL procedure in one table (转载)
SQL find distinct values in large table (转载)请教一sas code
sas help, how to manipulating on the format valuesas问题
请教一个proc transpose的问题请教proc sql
recommend several good Data Mining blogsR table问题弱问
相关话题的讨论汇总
话题: aa话题: sas话题: smallest话题: get话题: do