LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 2 Mar 2005 08:29:37 +0100
Reply-To:     Spousta Jan <JSpousta@CSAS.CZ>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Spousta Jan <JSpousta@CSAS.CZ>
Subject:      Re: SUBSCRIBE SPSSX-L Russell Deighton
Comments: To: Russell Deighton <russell.deighton@MEDIZIN.UNI-ULM.DE>
Content-Type: text/plain; charset="iso-8859-2"

Hi Russel, Reconsider the properties of your loop cycle. If you are starting with #cnt = 1, then in the following command, the element v(#cnt/3) = v(0.333333333...) is called - which is impossible because vector indices can be numbers 1, 2, 3,... only. Therefore SPSS gives an error and interrupts the task. HTH Jan

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of Russell Deighton Sent: Tuesday, March 01, 2005 6:20 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: SUBSCRIBE SPSSX-L Russell Deighton

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


Back to: Top of message | Previous page | Main SPSSX-L page