Hey everyone,
I'm working with a large dataset that has multiple variables I'd like to combine/split into 3 diff cohorts/ new variable to compare. The variables I'd like to separate are Var1, Var2, Var3, Var4, etc. End goal: Create a new variable with the cases identified as either CohortA, CohortB, or CohortC.
Cohort A : (Var1= bus1 or Var1 = bus2), but doesn't include (Var2=toy1 or Var3=toy1 or Var4...)
Cohort B: (Var1 = bus1 or Var1=bus2) and includes (Var2=toy1 or Var3=toy1 or Var4...)
Cohort C: Var1 = toy1 or Var1 = toy2
Here is the syntax I'm using:
Select if ((VAR1 = '49560' OR VAR1 = '49561' OR VAR1 = '49565' OR VAR1 = '49566' OR VAR1 = '49568') AND VAR2 <> '15830' OR VAR2 <> '15847' OR VAR3 <> '15830' OR VAR3 <> '15847' OR VAR4 <> '15830' OR VAR4 <> '15847' OR VAR5 <> '15830' OR VAR5 <> '15847' OR VAR6 <> '15830' OR VAR6 <> '15847' OR VAR7 <> '15830' OR VAR7 <> '15847' OR VAR8 <> '15830' OR VAR8 <> '15847' OR VAR9 <> '15830' OR VAR9 <> '15847' OR VAR10 <> '15830' OR VAR10 <> '15847' OR VAR11 <> '15830' OR VAR11 <> '15847').
Getting error code: Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command
I know my variable name is correct. I have quadrupled checked. And they are not longer than 64 characters. I am guessing it is a problem with an operator I'm using. Please help :)
------------------------------
Cindy Gombaut
------------------------------
#SPSSStatistics