I am attempting to recode about eight variables into one variable.
As it stands I have a syntax that is as follows:
IF VAR1=1 NewVar=1.
IF VAR2=1 NewVar=2.
IF VAR3=1 NewVar=3.
IF VAR4=1 NewVar=4.
IF VAR5=1 NewVar=5.
IF VAR6=1 NewVar=6.
IF VAR7=1 NewVar=7.
IF VAR8=1 NewVar=8.
ADD VALUE LABELS NewVar 1 '1Label' 2 '2Label' 3 '3Label' 4 '4Label' 5 '5Label' 6 '6Label' 7 '7Label' 8 '8Label'.
However, this does not account for multiple active variables - each variable is a 1 or 0 answer, but each variable could have a 1 in, which is where I'm struggling as I am after a line of code that suggests if there are multiple 1s between the 8 variables that it would recode into a 9th variable called 'Mixed'
Any help would be greatly appreciated
Software/Hardware used:
SPSS 20
ASKED:
September 4, 2012 11:56 AM
so if you had:
10000000, you want 1 0 0 0 0 0 0 0 plus an additional “mixed” variable of 0
10001000, you want 1 0 0 0 1 0 0 0 plus an additional “mixed” variable of 1
and in what language do you want this in?
An example would also help to understand the problem.