Date: Fri, 14 Jan 2011 16:55:18 -0500
Reply-To: "Roberts, Michael" <Michael.Roberts@ahca.myflorida.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Roberts, Michael" <Michael.Roberts@ahca.myflorida.com>
Subject: How to identify blocks of consecutive cases in SPSS?
Content-Type: multipart/alternative;
Good Afternoon All,
I'm hoping someone in here would have a solution for a data manipulation problem I am facing, and one which eludes me:
I have cases, some of which are consecutive in time and the only indicator I have is the month - so for a given case, I have an Identifier, and the month (plus other data which are no help!) The problem is that for a given identifier, there are breaks between continuous periods, and I need to be able to measure the length of time any given contiguous period - somewhat like a length of stay in a hospital. I have done something like this in the past with regular dates, but cannot for the life of me remember how I did so, and would appreciate some advice. Data may look like this:
ID Month
1a 3
1a 6
1a 7
1a 8
1a 11
1a 12
2a 9
2a 11
2a 12
2a 15
2a 16
2a 17
3a 1
3a 3
3a 4
3a 7
3a 8
3a 9
So, 1a has two spans of 3 consecutive months and 2 months, 2a has 1 span of 2 consecutive months, etc.
TIA
Mike
[text/html]
|