|
Hi everyone,
I have a large dataset where I have many service dates for each case and I want to be able to assign each service date with a corresponding number so that I can look at the first three service dates for my analysis, but I canât figure out how to do this. Here is a small example of my data and the new variable I want. From looking at past posts it seems I need to use a LAG function, but I just donât know how to really do this. Also the dates I'm using are pure-no time part within the date. Any help will be GREATLY appreciated, Tracy Case No. service date *New Variable* 1 10/5/2007 1 1 10/7/2007 2 1 11/2/2007 3 2 7/1/2007 1 2 7/5/2007 2 3 12/4/2007 1 3 12/9/2007 2 3 12/13/2007 3 3 12/22/2007 4 ===================== 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 |
|
rank variables=servicedate by caseno /rank into newvariable.
where servicedate is service date, caseno is case number, and newvariable is the new variable. ________________________________ From: SPSSX(r) Discussion on behalf of Tracy Hazelton Sent: Thu 4/17/2008 12:43 PM To: [hidden email] Subject: counting dates within cases Hi everyone, I have a large dataset where I have many service dates for each case and I want to be able to assign each service date with a corresponding number so that I can look at the first three service dates for my analysis, but I canâEUR(tm)t figure out how to do this. Here is a small example of my data and the new variable I want. From looking at past posts it seems I need to use a LAG function, but I just donâEUR(tm)t know how to really do this. Also the dates I'm using are pure-no time part within the date. Any help will be GREATLY appreciated, Tracy Case No. service date *New Variable* 1 10/5/2007 1 1 10/7/2007 2 1 11/2/2007 3 2 7/1/2007 1 2 7/5/2007 2 3 12/4/2007 1 3 12/9/2007 2 3 12/13/2007 3 3 12/22/2007 4 ===================== 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 |
| Free forum by Nabble | Edit this page |
