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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 382 views
  • 0 likes
  • 2 in conversation