Date: Thu, 16 Apr 1998 16:37:38 -0500
Reply-To: "Nichols, David" <nichols@SPSS.COM>
Sender: "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From: "Nichols, David" <nichols@SPSS.COM>
Subject: Re: Grouping cases
My suggestion would be to use AGGREGATE, breaking on the patient ID, saving
the minimum and maximum values of the date variable and the number of cases
value. That gives you a new file with all the information you need. Just
COMPUTE the difference between the dates, then compute any summaries using
the number of cases as the grouping factor.
Principal Support Statistician and
Manager of Statistical Support
From: Milad Elhadri [SMTP:elhadri@JUNO.COM]
Sent: Thursday, April 16, 1998 4:05 PM
Subject: Grouping cases
Each patient has multiple records; one record for admission, one for
discharge and one or more for other measurements taken between admission
(adm) and discharge (disch).
I want to calculate the length of stay (using compute & lag function) by
each group of patients, where groups should be formed as follows:
Group1: Patients with adm and disch records only (no measurement taken
between adm and disch)
Group2: Patients with adm and disch and one more measurement between
Group3: Patients with adm and disch and two measurements between adm &
How do you write syntax to create those groups? My data looks like
ID date type score1 score2 ....
1 1/1/98 adm 12 14
1 1/5/98 time1 13 15
1 1/12/98 disch 16 20
2 2/1/98 adm 19 17
2 2/15/98 time1 21 19
2 2/18/98 time2 22 21
2 2/25/98 disch 24 23
3 3/1/98 adm 32 26
3 3/7/98 time1 34 28
Your assistance is appreciated. Thanks in advance.
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]