I need to calculate the length of time between discharge and readmission to a facility. I have several cases showing begin and end dates of service, and can calculate length of stay for each admission, but I am unsure how to accomplish the other readmission question. My file looks like this: Client A 9/2/07 9/7/07 5 days Client A 8/1/07 8/3/07 2 days Client A 7/3/07 7/9/07 6 days How can I query SPSS to compute that client A was readmitted 23 days after discharge on 7/9 (7/9-8/1), and 30 days after discharge on 8/3(8/3-9/2)? Thanks so much for your input..
Vicki L. Stirkey Program Analyst 3 OMHSAS Office of Mental Health and Substance Abuse Services Division of Systems Management 717-705-8198 Fax: 717-772-6737
|
Vicki, Here’s how I handle it with
psychiatric rehospitalizations. Assuming that your fields are sorted in
ascending order by admission and discharge date (right now yours are sorted in
descending order) and in order are: ID, AdmissionDate, DischargeDate: do if
id=lag(id) . compute
rehosp=(admissiondate-lag(dischargedate))/86400 . end if . execute. Brian From: SPSSX(r)
Discussion [mailto:[hidden email]] On
Behalf Of Stirkey, Vicki I need to calculate the length of time between discharge and
readmission to a facility. I have several cases showing begin and end dates of
service, and can calculate length of stay for each admission, but I am unsure
how to accomplish the other readmission question. My file looks like this: Client
A 9/2/07 9/7/07 5 days Client
A 8/1/07 8/3/07 2 days Client
A 7/3/07 7/9/07 6 days How can I query SPSS to compute that client A was readmitted
23 days after discharge on 7/9 (7/9-8/1), and 30 days after discharge on
8/3(8/3-9/2)? Thanks so much for your input.. Vicki L. Stirkey Program Analyst 3 OMHSAS Office of Mental Health and Substance Abuse Services Division of Systems Management 717-705-8198 Fax: 717-772-6737 |
In reply to this post by Stirkey, Vicki
Hi!
You could use CASESTOTVARS if your dataset doesn't have too many admissions (if it does, the file will become very wide). Below is a test syntax. I hope i didn't get confused my MDY vs. DMY differences. Cheers!! Albert-Jan data list free / client (a8) admission (adate10) discharge (adate10). begin data ClientA 9/2/07 9/7/07 ClientA 8/1/07 8/3/07 ClientA 7/3/07 7/9/07 ClientB 9/9/07 9/15/07 ClientB 9/20/07 9/30/07 end data. sort cases by client admission discharge. casestovars / id = client. compute diff1 = datediff(discharge.1, admission.1 , "days"). compute diff2 = datediff(discharge.2, admission.2, "days"). compute diff3 = datediff(discharge.3, admission.3, "days"). compute total_duration = sum (diff1 to diff3). compute interval = datediff(max(discharge.1 to discharge.3), min(admission.1 to admission.3), "days"). --- On Tue, 5/26/09, Stirkey, Vicki <[hidden email]> wrote: > From: Stirkey, Vicki <[hidden email]> > Subject: readmission calculations > To: [hidden email] > Date: Tuesday, May 26, 2009, 8:30 PM > > > > > > > > > > > > > > > > > I need to > calculate the length of time between discharge and > readmission to a facility. I have several cases showing > begin and end dates of > service, and can calculate length of stay for each > admission, but I am unsure > how to accomplish the other readmission question. My file > looks like this: > > Client > A > 9/2/07 9/7/07 5 > days > > Client > A > 8/1/07 > 8/3/07 2 days > > Client > A > 7/3/07 > 7/9/07 6 days > > How can I query > SPSS to compute that client A was readmitted > 23 days after discharge on 7/9 (7/9-8/1), and 30 days after > discharge on 8/3(8/3-9/2)? > > Thanks so much > for your input.. > > > > Vicki L. > Stirkey > > Program Analyst > 3 > > OMHSAS > > Office of Mental Health and Substance > Abuse Services > > Division of Systems > Management > > 717-705-8198 > > Fax: > 717-772-6737 > > > > > > > > > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
In reply to this post by Stirkey, Vicki
Vicki,
I've just recently done this for hospital readmissions. I actually went one step further and counted how many primary or specialty office visits they had between discharge and readmission. Of course, the first thing is to select only hospital data, and you have to be sure that you have only one line of data per date. My data typically has a line of data for each hospital SERVICE. Make sure each member facility and date combination only occurs once. You can use the point-and-click 'identify duplicate cases function' for this. 1. If you're looking at claims data you would use place of service code 21 (inpatient). 2. Next sort by facility, then member. Both ascending. If you have a numeric member id sort by that, or else last name, first name, MI. 3. Lastly, sort date ascending. Would look something like: sort cases by facility(A) member(A) date(A). do if lag(facility) eq facility. do if lag(member) eq member. compute readmit_time = datediff(startdate, lag(enddate), "days"). end if. end if. Doing this type of thing with raw claims data takes some more feneighling, but it looks like you've dodged that bullet. HTH, Matt Email: [hidden email] From: "Stirkey, Vicki" <[hidden email]> To: [hidden email] Sent: Tuesday, May 26, 2009 11:30:30 AM Subject: readmission calculations I need to calculate the length of time between discharge and readmission to a facility. I have several cases showing begin and end dates of service, and can calculate length of stay for each admission, but I am unsure how to accomplish the other readmission question. My file looks like this: Client A 9/2/07 9/7/07 5 days Client A 8/1/07 8/3/07 2 days Client A 7/3/07 7/9/07 6 days How can I query SPSS to compute that client A was readmitted 23 days after discharge on 7/9 (7/9-8/1), and 30 days after discharge on 8/3(8/3-9/2)? Thanks so much for your input..
Vicki L. Stirkey Program Analyst 3 OMHSAS Office of Mental Health and Substance Abuse Services Division of Systems Management 717-705-8198 Fax: 717-772-6737
|
In reply to this post by Stirkey, Vicki
I am very very green in the use of SPSS and I was thrilled to find these posts on calculating discharge readmission rates. I am using SPSS version 20 and have tried to follow these instructions with some difficulty. Can anyone give me more specifics on how to do these calculations for someone who is learning to use these software without any classes and using a book. How do I set up the CASESTOTVARS and the lag function?
Thanks for any help you can provide to me. Ann |
I wrote a tutorial on LAG that progresses from very basic and simple to more challenging with real-world examples (such as the one that started the thread).
It's here: http://www.spss-tutorials.com/lag/. I hope you find it helpful. Feedback always appreciated since it's hard for me to estimate whether it's not too detailed or too easy or whatever. Not sure about CASESTOVARS and VARSTOCASES but you can always try and run the examples from the CSR. Best, Ruben |
Ruben has written a nice tutorial and maybe that will be enough for you to do what you want. If not, please post a specific problem with some example data, the desired outcome and the syntax you are now using.
Gene Maguin -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Ruben Geert van den Berg Sent: Tuesday, July 15, 2014 1:57 AM To: [hidden email] Subject: Re: readmission calculations I wrote a tutorial on LAG that progresses from very basic and simple to more challenging with real-world examples (such as the one that started the thread). It's here: http://www.spss-tutorials.com/lag/. I hope you find it helpful. Feedback always appreciated since it's hard for me to estimate whether it's not too detailed or too easy or whatever. Not sure about CASESTOVARS and VARSTOCASES but you can always try and run the examples from the CSR. Best, Ruben -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/readmission-calculations-tp1088667p5726709.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Thank you. I am going to give it a try. Ann Mazuroski From: Maguin, Eugene [via SPSSX Discussion] [mailto:[hidden email]] Ruben has written a nice tutorial and maybe that will be enough for you to do what you want. If not, please post a specific problem with some example data, the desired outcome and the syntax you are now using. If you reply to this email, your message will be added to the discussion below: http://spssx-discussion.1045642.n5.nabble.com/readmission-calculations-tp1088667p5726715.html To unsubscribe from readmission calculations, click here.
smime.p7s (13K) Download Attachment |
In reply to this post by Ruben Geert van den Berg
Thank you. I will give this a try. Looks like a nice tutorial. Ann Mazuroski From: Ruben Geert van den Berg [via SPSSX Discussion] [mailto:[hidden email]] I wrote a tutorial on LAG that progresses from very basic and simple to more challenging with real-world examples (such as the one that started the thread). If you reply to this email, your message will be added to the discussion below: http://spssx-discussion.1045642.n5.nabble.com/readmission-calculations-tp1088667p5726709.html To unsubscribe from readmission calculations, click here.
smime.p7s (13K) Download Attachment |
Free forum by Nabble | Edit this page |