|
I have a file with pledge information for individuals on my database,
arranged thusly: ID DATE AMT PAID DUE 1 ## ## ## ## 1 ## ## ## ## 2 ## ## ## ## 3 ## ## ## ## 4 ## ## ## ## 4 ## ## ## ## I'd like to create a file that splits out the pledges for each individual into separate variables (DATE DATE1 AMT AMT1 PAID PAID1 DUE DUE1...), but CASESTOVARS has -- as you know -- the restriction that I can't have duplicate values in any of my INDEX fields. Some of these individuals made identical pledges on the same day to different areas. So CASESTOVARS /ID=ID /INDEX=DATE AMT PAID DUE. returns The INDEX values for case 34 have occurred before in the cases with the same ID values. I used AGGREGATE to create new summed variables for AMT, PAID, and DUE, which is great, but there's stuff I'd like to look at with individual pledges and their relationships to some of the other variables in my other files, and it seems like this would be simpler (given my SPSS skill level) were they split out. Am I looking for a different command, or is there a subcommand that'll get around this whose name doesn't obviously reflect its function? Thank you! Mark ====================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 |
|
If you calculate a counter variable for each id (numerically counting
the pledges) (called idcnt below). Format it to have no decimals Then if you use FORMAT idcnt (f1.0). */or (F2.0) if there are >10 pledges per person. CASESTOVARS /ID = id /INDEX = idcnt /separator="" /autofix=no /GROUPBY = VARIABLE . You will end up with a dataset with the following variables...(more if there are 3+ pledges/client) ID amt1 amt2 date1 date2 paid1 paid2 due1 due2 Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Palmberg Sent: Wednesday, February 20, 2008 4:35 PM To: [hidden email] Subject: [SPSSX-L] CASESTOVARS with identical INDEX values I have a file with pledge information for individuals on my database, arranged thusly: ID DATE AMT PAID DUE 1 ## ## ## ## 1 ## ## ## ## 2 ## ## ## ## 3 ## ## ## ## 4 ## ## ## ## 4 ## ## ## ## I'd like to create a file that splits out the pledges for each individual into separate variables (DATE DATE1 AMT AMT1 PAID PAID1 DUE DUE1...), but CASESTOVARS has -- as you know -- the restriction that I can't have duplicate values in any of my INDEX fields. Some of these individuals made identical pledges on the same day to different areas. So CASESTOVARS /ID=ID /INDEX=DATE AMT PAID DUE. returns The INDEX values for case 34 have occurred before in the cases with the same ID values. I used AGGREGATE to create new summed variables for AMT, PAID, and DUE, which is great, but there's stuff I'd like to look at with individual pledges and their relationships to some of the other variables in my other files, and it seems like this would be simpler (given my SPSS skill level) were they split out. Am I looking for a different command, or is there a subcommand that'll get around this whose name doesn't obviously reflect its function? Thank you! Mark ======= 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 |
|
At 05:57 PM 2/20/2008, Melissa Ives wrote:
>If you calculate a counter variable for each id (numerically >counting the pledges) (called idcnt below). >Then if you use > >CASESTOVARS > /ID = id > /INDEX = idcnt > /separator="" > /autofix=no > /GROUPBY = VARIABLE . Exactly. But not using '/INDEX' at all gives the same effect. ===================== 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 Melissa Ives
Thanks, Melissa. How do I go about creating the counter variable? My
experiments with COUNT have only ended up with an IDENT variable containing the value 1 for every case (record) in my file. I guess I haven't done the right experiments yet. Thanks! Mark -----Original Message----- From: Melissa Ives [mailto:[hidden email]] Sent: Wednesday, February 20, 2008 4:57 PM To: Mark Palmberg; [hidden email] Subject: RE: [SPSSX-L] CASESTOVARS with identical INDEX values If you calculate a counter variable for each id (numerically counting the pledges) (called idcnt below). Format it to have no decimals Then if you use FORMAT idcnt (f1.0). */or (F2.0) if there are >10 pledges per person. CASESTOVARS /ID = id /INDEX = idcnt /separator="" /autofix=no /GROUPBY = VARIABLE . You will end up with a dataset with the following variables...(more if there are 3+ pledges/client) ID amt1 amt2 date1 date2 paid1 paid2 due1 due2 Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Palmberg Sent: Wednesday, February 20, 2008 4:35 PM To: [hidden email] Subject: [SPSSX-L] CASESTOVARS with identical INDEX values I have a file with pledge information for individuals on my database, arranged thusly: ID DATE AMT PAID DUE 1 ## ## ## ## 1 ## ## ## ## 2 ## ## ## ## 3 ## ## ## ## 4 ## ## ## ## 4 ## ## ## ## I'd like to create a file that splits out the pledges for each individual into separate variables (DATE DATE1 AMT AMT1 PAID PAID1 DUE DUE1...), but CASESTOVARS has -- as you know -- the restriction that I can't have duplicate values in any of my INDEX fields. Some of these individuals made identical pledges on the same day to different areas. So CASESTOVARS /ID=ID /INDEX=DATE AMT PAID DUE. returns The INDEX values for case 34 have occurred before in the cases with the same ID values. I used AGGREGATE to create new summed variables for AMT, PAID, and DUE, which is great, but there's stuff I'd like to look at with individual pledges and their relationships to some of the other variables in my other files, and it seems like this would be simpler (given my SPSS skill level) were they split out. Am I looking for a different command, or is there a subcommand that'll get around this whose name doesn't obviously reflect its function? Thank you! Mark ======= 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 Mark Palmberg-2
compute idcnt=1.
if (ID=lag(ID)) idcnt=lag(idcnt)+1. Melissa -----Original Message----- From: Mark Palmberg [mailto:[hidden email]] Sent: Thursday, February 21, 2008 8:13 AM To: Melissa Ives; [hidden email] Subject: RE: [SPSSX-L] CASESTOVARS with identical INDEX values Thanks, Melissa. How do I go about creating the counter variable? My experiments with COUNT have only ended up with an IDENT variable containing the value 1 for every case (record) in my file. I guess I haven't done the right experiments yet. Thanks! Mark -----Original Message----- From: Melissa Ives [mailto:[hidden email]] Sent: Wednesday, February 20, 2008 4:57 PM To: Mark Palmberg; [hidden email] Subject: RE: [SPSSX-L] CASESTOVARS with identical INDEX values If you calculate a counter variable for each id (numerically counting the pledges) (called idcnt below). Format it to have no decimals Then if you use FORMAT idcnt (f1.0). */or (F2.0) if there are >10 pledges per person. CASESTOVARS /ID = id /INDEX = idcnt /separator="" /autofix=no /GROUPBY = VARIABLE . You will end up with a dataset with the following variables...(more if there are 3+ pledges/client) ID amt1 amt2 date1 date2 paid1 paid2 due1 due2 Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Palmberg Sent: Wednesday, February 20, 2008 4:35 PM To: [hidden email] Subject: [SPSSX-L] CASESTOVARS with identical INDEX values I have a file with pledge information for individuals on my database, arranged thusly: ID DATE AMT PAID DUE 1 ## ## ## ## 1 ## ## ## ## 2 ## ## ## ## 3 ## ## ## ## 4 ## ## ## ## 4 ## ## ## ## I'd like to create a file that splits out the pledges for each individual into separate variables (DATE DATE1 AMT AMT1 PAID PAID1 DUE DUE1...), but CASESTOVARS has -- as you know -- the restriction that I can't have duplicate values in any of my INDEX fields. Some of these individuals made identical pledges on the same day to different areas. So CASESTOVARS /ID=ID /INDEX=DATE AMT PAID DUE. returns The INDEX values for case 34 have occurred before in the cases with the same ID values. I used AGGREGATE to create new summed variables for AMT, PAID, and DUE, which is great, but there's stuff I'd like to look at with individual pledges and their relationships to some of the other variables in my other files, and it seems like this would be simpler (given my SPSS skill level) were they split out. Am I looking for a different command, or is there a subcommand that'll get around this whose name doesn't obviously reflect its function? Thank you! Mark ======= 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 |
|
Thank you, Melissa. Very much. After a little futzing around, it works
great! Obviously I need to read up on defining complex files. Processing Statistics Cases In 26926 Cases Out 13767 Cases In/Cases Out 2.0 Variables In 6 Variables Out 557 Index Values 139 -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Melissa Ives Sent: Thursday, February 21, 2008 9:33 AM To: [hidden email] Subject: Re: CASESTOVARS with identical INDEX values compute idcnt=1. if (ID=lag(ID)) idcnt=lag(idcnt)+1. Melissa -----Original Message----- From: Mark Palmberg [mailto:[hidden email]] Sent: Thursday, February 21, 2008 8:13 AM To: Melissa Ives; [hidden email] Subject: RE: [SPSSX-L] CASESTOVARS with identical INDEX values Thanks, Melissa. How do I go about creating the counter variable? My experiments with COUNT have only ended up with an IDENT variable containing the value 1 for every case (record) in my file. I guess I haven't done the right experiments yet. Thanks! Mark -----Original Message----- From: Melissa Ives [mailto:[hidden email]] Sent: Wednesday, February 20, 2008 4:57 PM To: Mark Palmberg; [hidden email] Subject: RE: [SPSSX-L] CASESTOVARS with identical INDEX values If you calculate a counter variable for each id (numerically counting the pledges) (called idcnt below). Format it to have no decimals Then if you use FORMAT idcnt (f1.0). */or (F2.0) if there are >10 pledges per person. CASESTOVARS /ID = id /INDEX = idcnt /separator="" /autofix=no /GROUPBY = VARIABLE . You will end up with a dataset with the following variables...(more if there are 3+ pledges/client) ID amt1 amt2 date1 date2 paid1 paid2 due1 due2 Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Palmberg Sent: Wednesday, February 20, 2008 4:35 PM To: [hidden email] Subject: [SPSSX-L] CASESTOVARS with identical INDEX values I have a file with pledge information for individuals on my database, arranged thusly: ID DATE AMT PAID DUE 1 ## ## ## ## 1 ## ## ## ## 2 ## ## ## ## 3 ## ## ## ## 4 ## ## ## ## 4 ## ## ## ## I'd like to create a file that splits out the pledges for each individual into separate variables (DATE DATE1 AMT AMT1 PAID PAID1 DUE DUE1...), but CASESTOVARS has -- as you know -- the restriction that I can't have duplicate values in any of my INDEX fields. Some of these individuals made identical pledges on the same day to different areas. So CASESTOVARS /ID=ID /INDEX=DATE AMT PAID DUE. returns The INDEX values for case 34 have occurred before in the cases with the same ID values. I used AGGREGATE to create new summed variables for AMT, PAID, and DUE, which is great, but there's stuff I'd like to look at with individual pledges and their relationships to some of the other variables in my other files, and it seems like this would be simpler (given my SPSS skill level) were they split out. Am I looking for a different command, or is there a subcommand that'll get around this whose name doesn't obviously reflect its function? Thank you! Mark ======= 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 ===================== 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 |
