Re: Create new variables from others (If Condistional or recode)

2017-10-23 Thread Alan Mead
Let's assume you have variables X1, x2, x3, etc. and you wish to create a new variable cond with values like 1, 2, 3, etc. then do one of these: if( x1 = 1 or x2 = 3) cond = 1. if( (x2 = 1 and x4=1) or x3 = 1) cond = 2. etc execute. OR, do this: do if( x1 = 1 or x2 = 3).   compute cond = 1.

Re: Create new variables from others (If Condistional or recode)

2017-10-23 Thread Alan Mead
And if John's explanation is insufficient, please explain what you are trying to do. A recode statement (if your conditions depend on values of one variable) or compute statements in IF or DO IF blocks (otherwise) may be necessary to accomplish what you want. -Alan On 10/23/2017 12:00 PM, John Da

Re: Create new variables from others (If Condistional or recode)

2017-10-23 Thread John Darrington
In PSPP, the simplest way to create a new variable, and assign values to it derived from existing variables is using the COMPUTE command. For example if you have existing variables v1, v2 and v3, you could create a new variable as follows: compute newVar = v1 or v2 or v3. (don't forget the . at t

Create new variables from others (If Condistional or recode)

2017-10-23 Thread Betsabé Cohen
Hi everyone: I'm a recent user of PSPP and i'm trying to create a new variable from three other variables using a conditional. In Excel i would use IF and OR functions but i don't know what should i used in pspp sintaxys: The idea is to create a new variable as follows: NEW Variable "Condicion_A