Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Handling pharmacy data with multiple entries per subject


From   "Doernberg, Sarah" <Sarah.Doernberg@ucsf.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Handling pharmacy data with multiple entries per subject
Date   Fri, 10 Jun 2011 12:59:24 -0700

Hi all:

I have a dataset from our pharmacy with prescriptions for antibiotics in hospitalized patients. Each time a patient was transferred (from the emergency department to the ward or the ward to the ICU, for instance), a new prescription (and thus, a new row) was generated. This is compounded by the fact that some people received intermittent dosing (each start date with it's own row).

Because this is a very large set of data, I am trying to figure out how to have Stata combine the rows. Ideally, I would like to have one entry per person with consecutive courses of antibiotics represented by start and stop days (for example, someone who received an antibiotic from 6/1-6/3 and 6/7-6/9 would have start_date_1 = 6/1, stop_date_1=6/3 and start_date_2=6/7 and stop_date_2=6/9).

I have tried doing this with the collapse command but the best I can do is to get total days on antibiotic in a given month. Converting from long to wide also is not ideal because consecutive courses are not combined due to the multiple prescriptions based on location.

Does anyone have ideas or experience about how to handle this in Stata?

Thank you in advance for your help.

Best,

Sarah

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index