|
Hello,
I am currently working on a project where there is something called an ASID. The ASID consists of eight numbers. For example, 11088284 where 11 represents the month, 08 represents the day and 8284 represents the patient ID. Now, for each patient ID there are at most 6 entries corresponding to the different times that data was collected. I need to transform the sequence of these numbers so that the ASID looks like this, 82841108. In other words, I would need to have the patient ID in the front so that I would be able to cluster all of the patient IDs together so that a repeated measures analysis can be done for each patient. Is there a way for SPSS to do this? There are about 3,000 patients so it will be very time consuming, not to mention a lot of potential errors can occur, if this had to be done by hand. Thanks in advance for any assistance that can be given. Johnita ====================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 |
|
Johnita,
This is the same kind of problem that Mark Palmberg just asked about. You would need to use an adjusted formula of one of the responses to him. I think Richard's version will be clearer in this case as you are not dealing with a date. This is untested, but should be close to what you want. compute #CID=mod(ASID,10000). compute #month=trunc(ASID/100000). compute #day=trunc(mod(ASID,1000000)/100). compute newasid=(#CID*10000)+(#month*100)+#day. Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Byrd Sellers, Johnita Sent: Monday, January 28, 2008 9:29 AM To: [hidden email] Subject: [SPSSX-L] Number order Hello, I am currently working on a project where there is something called an ASID. The ASID consists of eight numbers. For example, 11088284 where 11 represents the month, 08 represents the day and 8284 represents the patient ID. Now, for each patient ID there are at most 6 entries corresponding to the different times that data was collected. I need to transform the sequence of these numbers so that the ASID looks like this, 82841108. In other words, I would need to have the patient ID in the front so that I would be able to cluster all of the patient IDs together so that a repeated measures analysis can be done for each patient. Is there a way for SPSS to do this? There are about 3,000 patients so it will be very time consuming, not to mention a lot of potential errors can occur, if this had to be done by hand. Thanks in advance for any assistance that can be given. Johnita ======= 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 PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for the use of the addressee. If you are not the designated recipient, or an employee or agent authorized to deliver such transmittals to the designated recipient, you are hereby notified that any dissemination, copying or publication of this transmittal is strictly prohibited. If you have received this transmittal in error, please notify us immediately by replying to the sender and delete this copy from your system. You may also call us at (309) 827-6026 for assistance. ===================== 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 Byrd Sellers, Johnita
Here's one way (assuming ASID is numeric, not string):
compute new_asid=mod(asid,10000)*10000 + trunc(asid/10000). -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Byrd Sellers, Johnita Sent: Monday, January 28, 2008 9:29 AM To: [hidden email] Subject: Number order Hello, I am currently working on a project where there is something called an ASID. The ASID consists of eight numbers. For example, 11088284 where 11 represents the month, 08 represents the day and 8284 represents the patient ID. Now, for each patient ID there are at most 6 entries corresponding to the different times that data was collected. I need to transform the sequence of these numbers so that the ASID looks like this, 82841108. In other words, I would need to have the patient ID in the front so that I would be able to cluster all of the patient IDs together so that a repeated measures analysis can be done for each patient. Is there a way for SPSS to do this? There are about 3,000 patients so it will be very time consuming, not to mention a lot of potential errors can occur, if this had to be done by hand. Thanks in advance for any assistance that can be given. Johnita ======= 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 |
|
In reply to this post by Byrd Sellers, Johnita
Thanks all for your help. Your suggestions worked perfectly!! Have a
great day... Johnita ====================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 |
