Date: Tue, 1 Mar 2005 18:19:44 +0100
Reply-To: Russell Deighton <russell.deighton@MEDIZIN.UNI-ULM.DE>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Russell Deighton <russell.deighton@MEDIZIN.UNI-ULM.DE>
Subject: SUBSCRIBE SPSSX-L Russell Deighton
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
SUBSCRIBE SPSSX-L Russell Deighton
Dear Listservx-l,
I was told that it was pssible to ask questions about SPSS syntax here,
is that right?
Anyway, here's my question. It's about restructuring data:
*I'm trying to restructure data from this form (in groups of 3 variables):
v1 v2 v3 v4 v5 v6 ... v230
88 0 1 54 1 3
to this form:
v1 v2 v3 v4 v5 v6 ... order88 time88 place88 ... order54
time54 place54
88 0 1 54 1 3 ... 1 0 1 ...
2 1 3
(the "order" variable should describe where the group of three variables
is situated in the variable list)
*I tried to first define variable list "order", but it didn't let me
because I hadn't defined a working file.
DO REPEAT order=order1 TO order100.
compute order = 0.
END REPEAT.
EXECUTE.
*and then I could do the following .
VECTOR v=v1 TO v300.
VECTOR order=order1 TO order100.
LOOP #cnt= 1 TO 300 BY 3.
compute order(v(#cnt/3)) = (#cnt/3).
compute time(#cnt/3) = v(#cnt +1).
compute place(#cnt/3) = v(#cnt +2).
END LOOP.
execute.
* but got the following error message:
>Warning # 525
>An attempt was made to store a value into an element of a vector the
>subscript of which was missing or otherwise invalid. The subscript
must be
>a positive integer and must not be greater than the length of the vector.
>No store can occur.
Can anyone help me with this?
Thanks,
Rusell Deighton