Assigning a number to string values

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

erosenzweig
Posts: 5
Joined: Wed Aug 01, 2012 6:44 pm

Assigning a number to string values

Postby erosenzweig » Wed Aug 01, 2012 6:56 pm

Hi All -

I have a dataset with student test score data from students from 364 schools -- there are many students in each school, so the file has about 65000 records. Unfortunately, the school identifier variable is a string variable, of the form Number-Number-Letter-Number-Number-Number.

I need to include school as a random factor in my analysis, and so need a way to get SPSS to create a new variable that assigns a different number to each school -- but I don't care what the number it assigns is. I'm trying to figure out the easiest way to do this.

Any thoughts?
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

Re: Assigning a number to string values

Postby Penguin_Knight » Wed Aug 01, 2012 8:07 pm

Go to Transform > Automatic Recode.
erosenzweig
Posts: 5
Joined: Wed Aug 01, 2012 6:44 pm

Re: Assigning a number to string values

Postby erosenzweig » Wed Aug 01, 2012 8:09 pm

Wow! I feel like a dummy -- had no idea that function existed. Thanks so much Penguin_Knight!
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

Re: Assigning a number to string values

Postby Penguin_Knight » Wed Aug 01, 2012 8:27 pm

Wow, very nice of you to come back and update us. Usually people just left. :lol:

Who is online

Users browsing this forum: No registered users and 1 guest

cron