Morning,
I've run a proc summary which has produced a count of values by different groups.
What I would like to do now is take this dataset and output the highest number obs for each group. The issue I'm having is trying to output the top obs per group when there are more than one highest in a group.
For instance there could be only 1 for one group but 3 for another. Any ideas how best to overcome this?
Thanks,
Sean
4 ways to find the k smallest and largest data values in SAS
By Rick Wicklin on The DO Loop January 26, 2022
https://blogs.sas.com/content/iml/2022/01/26/k-smallest-largest-data.html
In CASL code ... you can use the action simple.topK, which selects the top K and bottom K values for variables in a data set, based on a user-specified ranking order.
Just don't forget to perform all your analyses by-group based !
Koen
4 ways to find the k smallest and largest data values in SAS
By Rick Wicklin on The DO Loop January 26, 2022
https://blogs.sas.com/content/iml/2022/01/26/k-smallest-largest-data.html
In CASL code ... you can use the action simple.topK, which selects the top K and bottom K values for variables in a data set, based on a user-specified ranking order.
Just don't forget to perform all your analyses by-group based !
Koen
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.