Re: Duplicates

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Duplicates

Wakhungu, Phoebe Khasiala
Hi all,
Whenever I merge my files this is the message I get:

Warning # 5132

Duplicate key in a file. The BY variables do not uniquely identify each case on the indicated file. Please check the results carefully.

Does anyone know how I should deal with this?

Thanks.

Phoebe.
Reply | Threaded
Open this post in threaded view
|

Re: Duplicates

Oliver, Richard
Unlike database joins, SPSS will merge two files with duplicate key values, but the manner in which it matches cases with duplicate key values is based on their file order, which may or may not be correct. Hence the warning that you should "check the results carefully".

A simple example:

data list  list /ID_key var1.
begin data
1 11
2 12
3 13
5 152
5 151
end data.
sort cases by ID_key.
dataset name one.
data list list /ID_key var2.
begin data
1 21
2 22
3 23
4 24
5 251
5 252
end data.
sort cases by ID_key.
dataset name two.
match files file=one /file=two /by ID_key.
execute. /*to see the result immediately.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Wakhungu, Phoebe Khasiala
Sent: Monday, February 19, 2007 9:51 AM
To: [hidden email]
Subject: Re: Duplicates

Hi all,
Whenever I merge my files this is the message I get:

Warning # 5132

Duplicate key in a file. The BY variables do not uniquely identify each case on the indicated file. Please check the results carefully.

Does anyone know how I should deal with this?

Thanks.

Phoebe.