Deleting duplicate cases

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

nemomonkey
Posts: 1
Joined: Tue May 15, 2012 8:23 pm

Deleting duplicate cases

Postby nemomonkey » Tue Jun 12, 2012 9:33 pm

Hello,

I'm working with a dataset where I have county level information and an index for all tracts within each county:

County Tract Index
1 1 0.4
1 2 0.4
1 3 0.4
1 4 0.4
1 5 0.4
2 1 0.6
2 2 0.6
2 3 0.6

So, I had to use tract level data to calculate the index, but as you can see the index value is same for each tract within one county.

I would like to learn how to leave one unique value per county, like the following:

County Tract Index
1 1 0.4
1 2
1 3
1 4
1 5
2 1 0.6
2 2
2 3

If anyone can show me how to do this using the SPSS options (not write-in code), much appreciated!
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

Re: Deleting duplicate cases

Postby Penguin_Knight » Wed Jun 13, 2012 2:40 am

I know you don't want code, but here is the code:

Code: Select all

IF track = 1 NewIndex = index .
EXECUTE .
In the Transform > Compute function, you can replicate this command as well. Compute a new variable that is the same as "index". Then, at the bottom, look for the "If" slot and put in the condition "track = 1".

This only works if all of your counties have track #1. If there are exceptions, let us know.

Who is online

Users browsing this forum: No registered users and 1 guest

cron