SPSS changing data in fields

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

SPSS changing data in fields

Janice Chang
I've been working with large data files consisting of over 500
individual cases. For the past several weeks, SPSS has been replacing
some cases with others. For example, rather than having cases 1, 2, 3,
4, 5, 6, 7, 8...., I'll end up with 1, 2, 3, 4, 5, 2, 3, 8...
The first variable is the case number. Sorting by the case number lists
the cases as 1, 2, 2, 3, 3, 4, 5, 8 which tells me that my data is being
deleted and replaced rather than being rearranged. I have tried
re-entering those cases and inserting new case fields in the event that
those fields have been corrupted in some way. Eventually, it always
reverts back. Any ideas on what SPSS is doing or what I'm doing wrong?

Thanks in advance.
~janice

--


~~~~~~~~~~~~~~~~~~~~~~~~~~~
Janice Chang
MESS Research Associate

Center for Informal Science Education
Florida Museum of Natural History
Powell Hall
University of Florida
P.O. Box 112710
Gainesville, FL 32611-2710

Phone: (352) 846-2000 x 268
Fax:   (352) 846-0253

[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: SPSS changing data in fields

Dennis Deck
I think it highly unlikely that SPSS is changing any data, though your
program might be doing something other than what you intended.

The system variable $casenum should not be used as a case identifier -
its value changes when you manipulate the data - it is not intended for
this purpose.  You should always assign a case identifier when entering
your data.  However, if you did not you can create one with syntax as
follows:   COMPUTE ID = $Casenum .
The new ID variable will uniquely identify each record, it will be
preserved with any modifications, and it can be used to restore the
original sort order of the data.

As a rule, you should *never* make modifications of your raw data
directly. Always use syntax to read and manipulate the raw data.  You
can save the modifications (.SAV format) or reconstruct it from the raw
data whenever you need it. (Even with files far larger than yours
[thousands or millions of records], it is often fast to build it when
you need it and this avoids proliferation of multiple versions.) Either
way you can always recreate an updated analysis file if you a) correct a
coding mistake, b) learn more about the data, or c) add new data.

For good tips on file handling I suggest looking at Levesque's SPSS
Programming and Data Management which is included as a PDF on the
distribution disk.


Dennis Deck, PhD
RMC Research Corporation
[hidden email]

-----Original Message-----
From: Janice Chang [mailto:[hidden email]]
Sent: Friday, July 14, 2006 9:04 AM
Subject: SPSS changing data in fields

I've been working with large data files consisting of over 500
individual cases. For the past several weeks, SPSS has been replacing
some cases with others. For example, rather than having cases 1, 2, 3,
4, 5, 6, 7, 8...., I'll end up with 1, 2, 3, 4, 5, 2, 3, 8...
The first variable is the case number. Sorting by the case number lists
the cases as 1, 2, 2, 3, 3, 4, 5, 8 which tells me that my data is being
deleted and replaced rather than being rearranged. I have tried
re-entering those cases and inserting new case fields in the event that
those fields have been corrupted in some way. Eventually, it always
reverts back. Any ideas on what SPSS is doing or what I'm doing wrong?

Thanks in advance.
~janice

--


~~~~~~~~~~~~~~~~~~~~~~~~~~~
Janice Chang
MESS Research Associate

Center for Informal Science Education
Florida Museum of Natural History
Powell Hall
University of Florida
P.O. Box 112710
Gainesville, FL 32611-2710

Phone: (352) 846-2000 x 268
Fax:   (352) 846-0253

[hidden email]