Date: Tue, 20 Apr 2004 08:33:15 +0200
Reply-To: Spousta Jan <JSpousta@CSAS.cz>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Spousta Jan <JSpousta@CSAS.cz>
Subject: Re: Combining Existing Variables to Create a New Variable
Content-Type: text/plain; charset="iso-8859-1"
string newvar (A1).
compute newvar = qb.
if (qa = 'Y') newvar = 'Y'.
provided you have variables qa and qb as strings (syntax not tested, but I hope it will run). Execute command is not needed if you run another commants after that.
From: Glenys Lafrance [mailto:email@example.com]
Sent: Tuesday, April 20, 2004 7:23 AM
Subject: Combining Existing Variables to Create a New Variable
Hi. I am a graduate student working on a research project. If my questions are too elementary for your group, please redirect me to other more appropriate sources.
I want to create a new variable from 2 existing ones. If the response to Question A = Y, then New Variable = Y, otherwise use the response for Question B. Can I use the Recode or Compute functions do achieve this? If so, how? Or do I have to program it?
I can do it using Excel and copy the results into the SPSS data table but it seems inefficient.