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
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.