|Date: ||Thu, 13 Oct 2005 19:31:48 -0400|
|Reply-To: ||Raynald Levesque <email@example.com>|
|Sender: ||"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>|
|From: ||Raynald Levesque <firstname.lastname@example.org>|
|Subject: ||Re: Compare two files|
|Content-type: ||text/plain; charset=us-ascii|
For examples see
- Files 2 and 3 in http://www.spsstools.net/SampleSyntax.htm#Matching
- File 24 of http://www.spsstools.net/SampleSyntax.htm#WorkingWithManyFiles
Raynald Levesque Raynald@spsstools.net
Visit my SPSS site: http://www.spsstools.net
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Sent: October 13, 2005 12:08 PM
Subject: Re: Comapre two file
I think the newest or newer versions 13 or 14 have or will have some sort
of 'function' for doing this. One old way is this
If you haven't done this already, make sure each file has a 'file source'
tag. Something like a variable called file with values of 1 for file 1 (an
arbitrary designation) and 2 for file 2. If you recorded data entry
id--always a good idea--you could use that, provided exactly one person did
first entry and exactly one different person did second entry.
Add the files and sort by id and your file source variable, call it 'file'.
* This assumes that user missing values may have been set and there might
be sysmis values.
Do repeat x=v1 to v500.
+ Do if (id eq lag(id)).
+ Do if (missing(x) eq lag(missing(x))).
+ Compute errs=errs+0.
+ Compute errs=errs+1.
+ End if.
+ End if.
* You need to pull both records for examination. So you have to sort the
records and pull the data from one record to another so that both records
in a pair have the same value for the err variable.
sort cases by id (a) file (d).
Do if (id eq lag(id)).
+ Compute errs=lag(errs).
Improvements. One improvement is to use a vector to record the variable
number--not the name--with the error. There are other improvements that
could be done just depends on how much time you have. Check Raynalds