If I have the following syntax:
IF (any(1, v1 to v10)) vnew = 1.
SPSS returns a 1 for every case, where there is a 1 between v1 and v10.
However, if I want a 1 returned for every 1, 2, 3 or 4 between v1 and v10 I have to write that line four times for it to work.
Because this does not work:
IF (any(range(1, 4), v1 to v10)) vnew = 1.
Is there a way to do this? Similarly with for example "<1" as the first value or a range of variables, for example something like:
IF (any((<1), v1 to v10)) vnew = 0
or
IF (any((v1 to v10), 1 to 4)) vnew = 1.
does not work.
I tried with the range function as well, but I can't seem to find a way to combine or nest functions.
#SPSSStatistics#Support#SupportMigration