FAQ/restwb - CBU statistics Wiki

Revision 1 as of 2010-01-26 16:10:49

Clear message
location: FAQ / restwb

The VARSTOCASES command

The below can also be performed using the RESTRUCTURE command under the DATA menu in SPSS. For the example below we wish to stack columns x and y to make a single column called time. This is particularly useful for converting data from a format suitable for repeated measures to one suitable for multilevel modelling in SPSS.

DATA LIST FREE / idno x y . 
BEGIN DATA 
001 34 56 
001 23 45 
001 39 41 
002 33 11 
002 87 57 
002 99 36 
END DATA. 

SORT CASES BY IDNO.
VARSTOCASES 
 /MAKE time FROM x y
 /INDEX = newfact "new var label" (time) 
 /KEEP = idno.