SPSS - does anyone know how to create repetition loops and how do these loops create new variables in a dataset?

0

Does anyone know how to create repeating loops and that this loops create new variables in a dataset? if possible using SPSS Syntax or some other function of the software.

    
asked by anonymous 23.05.2016 / 21:07

1 answer

0

Oops, you have to vectorize your table and then associate the loop with the vectors:

Example:

* Programs to construct a SET of difference scores and sum scores . 

VECTOR X(4) / Y(4) . 
DO REPEAT V= V1 TO V4 / W = W1 TO W4 / X = X1 TO X4 / Y = Y1 TO Y4. 
COMPUTE X = V + W. 
COMPUTE Y = V - W. 
END REPEAT . 

VECTOR V = V1 TO V4 / W = W1 TO W4 / X(4) / Y(4) . 
LOOP I = 1 to 4 . 
COMPUTE X(I) = V(I) + W(I) . 
COMPUTE Y(I) = V(I) - W(I) . 
END LOOP . 

link to this and other examples: link

    
19.09.2016 / 18:13