Date: Thu, 11 Dec 2003 13:28:43 -0500
Reply-To: "Richard J. Reeves" <rr223@cornell.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Richard J. Reeves" <rr223@cornell.edu>
Subject: Re: Duplicates
In-Reply-To: <5.1.0.14.2.20031211121043.00abbad0@agar0040.email.umn.edu>
Content-Type: text/plain; charset="us-ascii"; format=flowed
I know some on the list don't like the casestovars command but it will work
for you in this application. You can use the counter variable in
conjunction with a vectors commmand too if need be. This will make your
file such that you have 1 record per person with more variables. You could
also use a lag command to find duplicates: if (id=lag(id,1)) Dup=1.
rich
SORT CASES BY
id (A) .
CASESTOVARS
/ID=ID
/COUNT=COUNTER.
USE ALL.
COMPUTE filter_$=(counter>1).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
At 12:14 PM 12/11/2003 -0600, Shuchita Agarwal wrote:
>Hi!
>
>Does anyone know how to select cases that have duplicate values in a file?
>
>If I have two duplicate IDs # 1 then I want to select both of those
>records. The reason for doing this is to manually figure out which is the
>record that should be kept in the final file.
>
>ID Value
>1 30
>1 40
>2 40
>2 50
>3 50
>4 50
>
>I want to keep both records of ID 1 and 2 in the final file.
>
>I am using SPSS v. 10.
>
>Thanks much,
>Shuchita
>
>********************************************************************
>Shuchita Agarwal
>Doctoral Candidate
>University of Minnesota
>Department of Pharmaceutical Care and Health Systems
>College of Pharmacy
>308 Harvard Street S.E.
>7-158 Weaver Densford Hall
>Minneapolis, MN 55455
>
>Phone: 612-626-3641
>Fax: 612-625-9931
>*********************************************************************
*************************************************************************
Richard J. Reeves rr223@cornell.edu
Senior Research & Planning Associate Phone: 607-255-9642
Cornell University Fax: 607-255-2990
Ithaca, NY. 14853-2801
*************************************************************************