Variable Name Index (VARSTOCASES command)
A variable name index works like the simple numeric
index, except that it lists the name of the original FROM
variable instead of a sequential number.
- The basic specification is
/INDEX=ivar (make variable name)
, where ivar is the name for the new index variable and make variable name is the name of a variable on theMAKE
subcommand from which the index is to be constructed. - The new index variable is a string that lists the
name of the
FROM
variable from which the new row was created.
Example
VARSTOCASES
/MAKE newvar FROM var1 TO var4
/INDEX=ivar (newvar).
caseid ivar newvar
001 VAR1 .00
001 VAR2 .05
001 VAR3 5.00
001 VAR4 3.00
002 VAR1 7.00
002 VAR2 1.00
002 VAR3 5.00
002 VAR4 4.00
003 VAR1 6.00
003 VAR2 3.00
003 VAR3 6.00
003 VAR4 2.00