BookmarkSubscribeRSS Feed
Kunko
Obsidian | Level 7

Dear SAS Community experts,

 

I am SPSS user and currently using SAS to analyze data for my PhD study. As a new user of SAS I am unable to calculate the length of time duration in days between drug supply for patients receiving certain drugs every few weeks or few months. 

 

newStudyCode                 Date of supply                                        Drug

1                                         25AUG2014:00:00:00                              A   

1                                         22SEP2014:00:00:00                            A 

1                                         27OCT2014:00:00:00                             A                                     

1                                         28NOV2014:00:00:00                          A     

1                                         23DEC2014:00:00:00                           A 

2                                         30JUN2016:00:00:00                            B

2                                         10AUG2016:00:00:00                            B

2                                         08SEP2016:00:00:00                               B

2                                         11OCT2016:00:00:00                                B

2                                         01NOV2016:00:00:00                                C                           

2                                         19DEC2016:00:00:00                                 C

2                                          11JAN2017:00:00:00                                 C

2                                          13FEB2017:00:00:00                                  C

 

I do have about 189 drugs taken by patients for five years with recurrent dates of supply for each patient. For instance, a patient could take a single drug or combination of drugs over a time. I have modified my post below and also edited on your website support page. I want to know the time intervals between each supply and the average of the intervals for each drug. 

 

1 REPLY 1

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