BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
littlewho
Fluorite | Level 6

Hello,

I am trying to rank a dataset's variable using 3 groups, but I want the groups to be distributed as following:

- rank 0 -> 0 to 10% of observations

- rank 1 -> 10% to 20% of observations

- rank 2 -> the rest up to 100%

 

I know that by default "proc rank groups = 3" would split the dataset into 3 equal groups. Could anyone point me into the right direction?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
proc rank groups = 10
NEW_GROUP
- rank 0 -> 0 to 10% of observations if rank=0 then new_group=1;
- rank 1 -> 10% to 20% of observations else if rank=1 then new_group=2;
- rank > 2 -> the rest up to 100% else new_group=3 ;

View solution in original post

1 REPLY 1
Ksharp
Super User
proc rank groups = 10
NEW_GROUP
- rank 0 -> 0 to 10% of observations if rank=0 then new_group=1;
- rank 1 -> 10% to 20% of observations else if rank=1 then new_group=2;
- rank > 2 -> the rest up to 100% else new_group=3 ;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 489 views
  • 1 like
  • 2 in conversation