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 (February 2012)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 17 Feb 2012 12:16:25 -0500
Reply-To:   Matt Kretschmer <matthmann@YAHOO.COM>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Matt Kretschmer <matthmann@YAHOO.COM>
Subject:   Re: New variables as mean of others

Thanks Bruce

This does work - I get the right results but I get an error message

Below is the adjusted script I use for a 12 months trailing period. I assume I can use v(#-1) and simply go backwards:

vector v = S_201007 to S_201112 / a = S_T12M_201007 to S_T12M_201112 . loop # = 1 to 18 . - compute a(#) = MEAN(v(#), v(#-1), v(#-2), v(#-3), v(#-4), v(#-5), v(#-6), v(#-7), v(#-8), v(#-9), v(#-10), v(#-11) ). end loop. execute.

The error message says >Warning # 513 >The subscript in a vector reference is missing or otherwise invalid. The >subscript must be a positive integer and must not be greater than the length >of the vector. The result has been set to the system-missing value.

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


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