creating a variable

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

creating a variable

E. Bernardo
Hi all,

  A variable W is created based on the values of the other three variable X, Y and Z.  For example, W=1 if X=0, Y=1 and Z=1.  How to do this in spss?

  Thanks.
  Eins


---------------------------------
  HOTMAIL, GMAIL, ….ACCOUNTS?
Invite your friends from Hotmail, Gmail to Yahoo! Messenger today!

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: creating a variable

Adam Martin-7
Hi Eins

Use the following syntax.

IF (X=0 & Y=1 & Z=1) W = 1 .
EXECUTE .

Adam

2009/1/24 Eins Bernardo <[hidden email]>

> Hi all,
>
>  A variable W is created based on the values of the other three variable X,
> Y and Z.  For example, W=1 if X=0, Y=1 and Z=1.  How to do this in spss?
>
>  Thanks.
>  Eins
>
>
> ---------------------------------
>  HOTMAIL, GMAIL, ….ACCOUNTS?
> Invite your friends from Hotmail, Gmail to Yahoo! Messenger today!
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (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
>



--
Cell: +27 84 777 1801
Website: http://www.sigmasurveys.co.za
Blog: http://www.sigmasurveys.co.za/resources

====================To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: creating a variable

Albert-Jan Roskam
In reply to this post by E. Bernardo
Hi Eins,

compute w = 999.
if (x = 0 and y = 1 and z = 1) w = 1.
... etc etc.
If all combinations have been defined, w = 999 should not occur. Be careful when x, y or z have system missing values.

Cheers!!
Albert-Jan



----- Original Message ----
From: Eins Bernardo <[hidden email]>
To: [hidden email]
Sent: Saturday, January 24, 2009 4:24:59 AM
Subject: creating a variable

Hi all,

  A variable W is created based on the values of the other three variable X, Y and Z.  For example, W=1 if X=0, Y=1 and Z=1.  How to do this in spss?

  Thanks.
  Eins


---------------------------------
  HOTMAIL, GMAIL, ….ACCOUNTS?
Invite your friends from Hotmail, Gmail to Yahoo! Messenger today!

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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