Syntax for recoding multiple values at once

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

StatsNewbie
Posts: 15
Joined: Wed Jan 07, 2009 9:14 pm

Syntax for recoding multiple values at once

Postby StatsNewbie » Sat Feb 04, 2012 10:41 pm

Hello.

Can anyone suggest some syntax that let me recode several value labels all at once into a new variable. I have given different countries in the world various value labels, such as 1= UK, 10=Germany, 25=Italy, etc. Ideally I would like to recode 1 & 10 & 25 into a new variable called "regions" in which the new value label 1=Western Europe (UK, Germany, Italy). I would like to something similar to group other countries into the new variable regions where value label 2=The Americas, 3=Asia, 4=Africa.

Any ideas?

Thanks.

Al
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Syntax for recoding multiple values at once

Postby GerineL » Tue Feb 07, 2012 1:00 pm

It is just a simple recode.

so it would be something like:

recode country (1=1) (10 = 1) (25 = 1) into regions.
execute.


but with more (1 = 1) stuff probably

Who is online

Users browsing this forum: No registered users and 2 guests

cron