I am trying to create some indicator variables in SPSS using a loop.
I want to create 17 new variables ABA(1-17) that take a value of 1 if BA(1-17) equals 1. I was trying something like:
VECTOR ABA(17).
LOOP #i = 1 to 17.
IF(BA(#i)=1) ABA(#i) = 1.
END LOOP.
EXECUTE.
This, unfortunately, just creates variables with missing values. Does the above code just need a small tweak or is their a more efficient way to accomplish creating the variables?