BookmarkSubscribeRSS Feed
hjjijkkl
Pyrite | Level 9

I have a big data and I am trying to find total number of patient given one or combination of drugs given at the same day. The table i have below is just an example. Please help on how to approach analyzing this data. Thanks!

Studyid

Medication

Med_date

1

rti

5/2/2022

1

levo

5/2/2022

3

emb

4/6/2022

4

rti

5/15/2022

4

clr

5/15/2022

4

levo

5/15/2022

7

clr

5/9/2022

7

sst

5/9/2022

1

llt

7/12/2022

1

rti

7/12/2022

2

Llt, rti

7/12/2022

8

emb

4/6/2022

 

Below is the outcome I am trying to analyze 

All drug combos given on the same day for same patient

Number of patient

Rti, levo

1

emb

2

Rti, clr, levo

1

Clr, sst

1

Llt, rti

2

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Hello, @hjjijkkl we have asked you in the past to provide data in a usable form, specifically work SAS data step code. In your other threads, people have provided examples. Please provide the data in that form from now on; and please do not provide data in any other form.

--
Paige Miller
ballardw
Super User

Spelling counts. Your "want" shows "Rti, levo" and "Rti, clr, levo". You data shows exactly zero examples of "Rti" in the data. "rti" yes. You also show wanting different cases of Rti and Clr depending on where it appears (apparently). We do not have your data or understanding of anything other than what you provide. So from the provided example I would not presume to create that "want" as the values shown are different.

 

One of the things that is going to be needed is to address order and the way your data is currently there is going to be some difficulty telling if ''rti, lit" and "lit, rti" are supposed to be the same or note. Personally first step is to get ONE observation per "patient", date, medication. I.e. fix this so it is two observations, and similarly for any other combinations.

2

Llt, rti

7/12/2022

Also, do we have to guess the studyid supposedly identifies a "patient"?

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 426 views
  • 0 likes
  • 3 in conversation