Hi, i'm trying to sort sort in descending freq of soc_term, and pt_term within soc_term, and then do alphabetical for ties for each level. i have included a data set.
This is what the data looks like:
soc_term pt_term aesevn count infestation overall 0 3 (15.0) infestation overall 1 2 infestation overall 2 1 infestation overall 3 0 infestation cough 0 2 (10.0) infestation cough 1 1 infestation cough 2 1 infestation cough 3 0 infestation fever 0 1 (5.0) infestation fever 1 1 infestation fever 2 0 infestation fever 3 0 infestation sweats 0 0 infestation sweats 1 0 infestation sweats 2 0 infestation sweats 3 0 bodiy injury overall 0 5 (25.0) bodily injury overall 1 1 bodily injury overall 2 0 bodily injury overall 3 3 bodily injury laceration 0 2 (10.0) bodily injury laceration 1 1 bodily injury laceration 2 0 bodily injury laceration 3 1 bodily injury contusion 0 3 (15.0) bodily injury contusion 1 0 bodily injury contusion 2 0 bodily injury contusion 3 2 chronic pain overall 0 5 (25.0) chronic pain overall 1 2 chronic pain overall 2 2 chronic pain overall 3 1 chronic pain back 0 3 chronic pain back 1 2 chronic pain back 2 1 chronic pain back 3 0 chronic pain neck 0 2 chronic pain neck 1 0 chronic pain neck 2 1 chronic pain neck 3 1
aesevn represents both an overall variable and severity level.
0= total number of subjects per soc_term, pt_term
1=mild
2=moderate
3= severe
I'm having a hard time keeping all the groups together when i try to sort. Does anybody have a solution?
thanks in advance
proc import datafile = "your import path"
DBMS = xlsx out = have1 replace ;
run;
i'm trying to sort sort in descending freq of soc_term, and pt_term within soc_term, and then do alphabetical for ties for each level. i have included a data set.
Show us the desired output. I'm not sure I understand from the words exactly what you want.
Also, many of us will not download Excel files, as these can be security threats. The proper way to provide data is via working SAS data step code.
Thanks, PaigeMiller, for your response. I will keep that in mind in the future for when i present data. I figured since it was large, i mind as well attach it as an excel sheet.
I have figured a solution for my issue, so i know longer need help with this.
Thanks
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!
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.