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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1087 views
  • 1 like
  • 2 in conversation