Creating ID-Variable for equal Areas

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

Julian1981
Posts: 1
Joined: Thu Jul 18, 2013 4:24 pm

Creating ID-Variable for equal Areas

Postby Julian1981 » Thu Jul 18, 2013 4:36 pm

Hi SPSS-forum,
I have a question regarding the creation of ID-variables for equal areas.

Preamble:
I use a Windows7 PC with SPSS20.

Here are more details of my syntax-problem:
I need to create a dataset which in the end will be used for multilevel analysis. Hence, I need ID-variables to built my datasets for the HLM software. The hierachy is people in zipcodes-areas. Since we have a a data security issue we are not allowed to combine the people-data with the zipcodes. So we recoded the zipcodes into HashCodes, which are string variables.

I know how to create ID with the

Code: Select all

compute ID=$casenum 
command, but than the same hashcodes/zipcodes have different ID.

Here is my question: is there a way to tell SPSS to create the same ID conditioned for another variable?

So, person 1,2,3, who life in zipcode x, will have the same ID xx,
and person 4,5,6 who life in zipcode y, will have the same ID yx, etc.

Thanks for your help.
albert_sun
Posts: 2
Joined: Thu Jul 18, 2013 1:12 am

Re: Creating ID-Variable for equal Areas

Postby albert_sun » Fri Jul 19, 2013 12:45 am

From your description, you want IDs to be like:

Person ZipCode ID
A 1234 1
B 1234 1
C 5678 2
D 5678 2

To do this, you can first aggregate your data by zipcode, and you will get a zipcode list, and then use

Code: Select all

 compute ID=$casenum 
to compute id, and then use the original data to look up this zipcode list.

it will do.

Who is online

Users browsing this forum: No registered users and 1 guest

cron