Hello Trying to transform a datafile with the command CASESTOVARS works fine, when I have just one variable to identify the cases. MATCH FILES / FILE * / KEEP IDCourse Coursegroup course name familyname City. SORT CASES BY familyname. CASESTOVARS/ID=familyname. In order to identify the unique cases – there are different people with the same familyname – I should compare familyname, name and city. These three variables alltogether are defining a unique case. How can I do that ? Thanks Tom |
Tom, Just use the three variables as the ID. CASESTOVARS [/ID = varlist] SORT CASES BY familyname name city CASESTOVARS/ID=familyname name city. From: SPSSX(r) Discussion [mailto:[hidden email]]
On Behalf Of Balmer, Thomas Hello Trying to transform a datafile with the command CASESTOVARS works fine, when I have just one variable to identify the cases. MATCH FILES / FILE * / KEEP IDCourse Coursegroup course name familyname City. SORT CASES BY familyname. CASESTOVARS/ID=familyname. In order to identify the unique cases – there are different people with the same familyname – I should compare familyname, name and city. These three variables alltogether are defining a unique case. How can I do that ? Thanks Tom 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. |
Administrator
|
In reply to this post by Tom
Build an ID which is based on the three variables. ;-)
-- SORT CASES BY familyname name city. DO IF $CASENUM=1. + COMPUTE combID=1. ELSE. + COMPUTE combID=LAG(combID). + IF familyname NE LAG(familyname)|name NE LAG(name)|city NE LAG(city) combID= combID+1. END IF. Then use combID as case Identifier in CASESTOVARS . I will leave that part to you.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Administrator
|
In reply to this post by Melissa Ives
Ah, silly me! ;-)
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Free forum by Nabble | Edit this page |