Many thanks for the COMPUTE suggestion and example - how is this
implemented in the Windows/GUI version ? I've tried various codings
but with no success (and can't trace any other examples).
----- Original Message -----
Sent: Wednesday, August 20, 2008 9:26
Subject: Re: PSPP Windows - Recode
Multiple Variables ?
David Purdy wrote:
Is it possible to recode multiple sets of field values into a single
new field ?, e.g. newfield = 1 where field1 = 5 or field2 =
Yes it is.
And if so, how ? TIA. (I've checked the
Let's say I have a data set that looks like
this: (sorry about the sloppy formatting)
I would like to have a
variable that tells me which of these are boys (gender = 1) AND over the age
of 10. Looking at the list we can easily see that mike is the only case that
meets these criteria. But, how can we figure it out?
test1 = 0 .
IF (gender = 1) & (age > 10) test1 = 1 .
This will create a new variable that I've named test1, for lack
of a better name (it's an example). Obviously, we need a TRUE / FALSE type
variable, so the first line creates our variable AND sets it's value equal to
0 (FALSE). The second line looks for those cases where the conditions are met
and sets test1 = 1 (TRUE). In the end, our new dataset looks
Andrew Choens, MSW
Research Policy Analyst
Hornby Zeller Associates, Inc.
(518) 273 - 1614