BookmarkSubscribeRSS Feed
simonqin
Fluorite | Level 6

Hello,

I am doing a polypharmacy study want to identify the number of drugs used during the observational study. The study design like this in Word document and the wanted dataset is the one that i need it.

 

This is the sample dataset:

 


data drugsaa;
infile datalines;
input id:$1. regimen:$7. start:MMDDYY10. end:MMDDYY10.;
format start MMDDYY10. end day MMDDYY10.;
do day = start to end;
output;
end;
datalines;
A a 6/1/2010 11/15/2010
A b 6/1/2010 9/1/2010
A c 8/1/2010 9/1/2010
A d 8/1/2010 12/15/2010
A e 8/1/2010 11/15/2010
B a 1/1/2012 9/1/2012
B b 3/1/2012 7/1/2012
C a 1/1/2011 4/1/2011
C b 1/1/2011 9/1/2011
C d 6/1/2011 7/1/2011
D a 8/1/2012 10/1/2012
D b 8/3/2012 10/1/2012
D c 8/3/2012 12/15/2012
D d 10/15/2012 12/1/2012
E a 5/1/2011 3/1/2012
E b 5/15/2011 3/1/2012
E c 5/15/2011 5/1/2012
E e 8/1/2011 9/1/2011
;;;
run;

 

thanks for all your help . 

 

4 REPLIES 4
simonqin
Fluorite | Level 6

The study design like this 

 

Picture1.png

Reeza
Super User
Whats the metric, the number of people? Do you care about duration? Is it a person time measure?
Assuming it's overlap per day so someone could be overlapped with A+B for 60 days and A+B+C for 30 days etc.
simonqin
Fluorite | Level 6
Hi,
I do not care about the duration. I just want a dataset with the start date of like a+b and the end date of a+b. And the start date of a+b+c and the end date of a+b+c. And with the columns for description of the drug combinations. Like a+b.
simonqin
Fluorite | Level 6
Like the dataset below:

ID. Start End. Drug
1. 06/01/2011. 31/07/2011. a+b
1. 08/01/2011.01/09/2011 a+b+c
…..

Regards

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1104 views
  • 0 likes
  • 2 in conversation