LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (July 2008)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 2 Jul 2008 08:50:29 -0700
Reply-To:     Dennis Deck <>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Dennis Deck <>
Subject:      Re: Loops
Comments: To: Khaleel Hussaini <>
Content-Type: text/plain; charset="us-ascii"

From your brief description the simplest way would be:

COMPUTE GenAge = Gender*10 + Age .

This creates a combined variable with values 11, 12, 21, 22. (Note that your example suggests that age is categorical [1=1 to 14, 2=15 to 17].) Only downside is that there are gaps in the values.

Dennis Deck, PhD RMC Research Corporation 111 SW Columbia Street, Suite 1200 Portland, Oregon 97201-5843 voice: 503-223-8248 x715 voice: 800-788-1887 x715 fax: 503-223-8248

-----Original Message----- From: Khaleel Hussaini [] Sent: Tuesday, July 01, 2008 4:51 PM Subject: Loops

Hi Listers! I have a simple query that requires me to go through 22 statements to create a new variable. Here is where I need help. Age (11 categories) and Gender (2 categories). I want to have a new variable called Gen_Age which combines information from these two variables. Females (1 to 14), Males (1 to 14), Females (15 to 17) Males (15 to 17) etc. Can we use a vector and/or a loop function to create new variable with 22 categories? Mind you I don't want dummy variables. Best, SKH.

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

Back to: Top of message | Previous page | Main SPSSX-L page