Tips – create idnumber equal to row number

 In Tips & Tricks

One important thing after you have collected your data is to idenify every case with a uniqe number (if you haven’t). Look at this data file:

We don’t have any id number (key) for the cases here, so if I sort the file I will have problem to know who is who. Many user I have met thinks that the blue column in the left part of the window is the same as idnumber, but that is the ROW NUMBER. The row number will just be the order of the row and will stay exactly the same, also when you sort the data.

What you can do is to create a new variable that is like the row number, in SPSS the blue column to the left is saved as a system variable called $CASENUM.

Go to the menu: Transform – Compute

and fill in following:

Then the new data file will look like this:

If you sort the data, in this case I sort the salary. You will see that the idnr will follow the individ. The blue column with the row number will stay as it is.

Thanks for the visit!

Gunilla

error: Content is protected !!