BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lillymaginta
Lapis Lazuli | Level 10
Patient_id  Medication_name Dispensing_Date  days_supply
1  a             1/1/2003   30
1  a             4/4/2004   60
1  b             3/4/2004   90
2  a             1/1/2003  30
2  a             4/4/2004   60
2  b             3/4/2004   90
2  c             3/15/2004  90
2  a             1/1/2002   60
2  d             1/1/2002   60
3 a              1/1/2005   30
3 b              2/2/2010    30
4  b             2/3/2009    60
4 g              4/4/2005    60
4  c             1/1/2006    60
4 e               1/1/2006   60
4  a              1/1/2004   90
4  b              1/28/2004  60
4  t               1/28/2004  60
4 o               1/15/2004  90
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

As far as I can see the only difference is 60 versus 30 days and you should be able to adjust the code for that. Have you tried replacing 30 with 60? 

https://communities.sas.com/t5/Base-SAS-Programming/frequency-of-multiple-observations-hapenning-at-...

 

I'm also assuming mono means single usage not the disease? 

 

 

Regarding the last 4 qs use either a double proc freq or proc SQl with count distinct. 

 

Proc freq data=have;

table id*drug/out = drugs_per_id;

run;

 

proc freq data=drugs_per_id;

table id/ out=distinct_coumt;

run;

 

You can then transpose this table to generate your output. 

 

Though it does appear this one was answered as well here :

https://communities.sas.com/t5/SAS-Procedures/assessing-dual-drug-use/m-p/265554#M57898

View solution in original post

3 REPLIES 3
Reeza
Super User

Didn't you ask this question a while back?

lillymaginta
Lapis Lazuli | Level 10

Hi Reeza, the other question has different assumptions. 

Reeza
Super User

As far as I can see the only difference is 60 versus 30 days and you should be able to adjust the code for that. Have you tried replacing 30 with 60? 

https://communities.sas.com/t5/Base-SAS-Programming/frequency-of-multiple-observations-hapenning-at-...

 

I'm also assuming mono means single usage not the disease? 

 

 

Regarding the last 4 qs use either a double proc freq or proc SQl with count distinct. 

 

Proc freq data=have;

table id*drug/out = drugs_per_id;

run;

 

proc freq data=drugs_per_id;

table id/ out=distinct_coumt;

run;

 

You can then transpose this table to generate your output. 

 

Though it does appear this one was answered as well here :

https://communities.sas.com/t5/SAS-Procedures/assessing-dual-drug-use/m-p/265554#M57898

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 3 replies
  • 1066 views
  • 1 like
  • 2 in conversation