Is it possible to nest conditional statements in SPSS?
The following did not work for me:
DO IF (t = resultcodeid)
DO IF t = 1
COMPUTE hits = r.
END IF.
DO IF t = 2
COMPUTE misses = r.
END IF.
END IF.
DO IF can certainly be nested. Note that each statement needs to be terminated by a period.
Also, since the inner ones are alternatives, it would be cleaner to write that as
do if t = 1.
…
else if t = 2.
…
end if.
HTH,
Jon Peck