Could anyone help me out with a coding shortcut? I've got a number of variables that I'm trying to recode into one variable, and so far have syntax that looks a bit like this: (this is just an example, it goes on to account for all the permutations - basically if any of the variables = 1 then the completev must = 1)
DATASET ACTIVATE DataSet1.
COMPUTE NEW_VAR = CompleteV.
IF (v1 = 0 AND v2 = 0 AND v3 = 0 AND v4 = 0) CompleteV = 0 .
IF (v1 = 1 AND v2 = 1 AND v3 = 1 AND v4 = 1) CompleteV = 1 .
IF (v1 = 1 AND v2 = 1 AND v3 = 1 AND v4 = 0) CompleteV = 1 .
However, this doesn't account for missing cells in the data. When I run the syntax, unsurprisingly the completev is empty if any of the cells in the other variables are missing. I'd be really grateful if someone could let me know exactly what to do to avoid this.