Re: do repeat
Posted by
Art Kendall on
URL: http://spssx-discussion.165.s1.nabble.com/do-repeat-tp5719707p5719708.html
it
seems you need to have two lists of variables either 2 vectors or 2 list
in do repeat.
try this untested approach
do repeat
newvar =
bOdd1_WIN_p.1 to bOdd1_WIN_p.48/
oldvar = bOdd1_WIN.1 to bOdd1_WIN.48.
compute newvar= 1/oldvar.
end repeat.
Art Kendall
Social Research Consultants
On 4/25/2013 8:17 AM, drfg2008 [via SPSSX Discussion] wrote:
I would like simply to copy the reciprocal of a set of variable
into another set of variables like that:
COMPUTE bOdd1_WIN_p.1 = 1/ bOdd1_WIN.1 .
COMPUTE bOdd1_WIN_p.2 = 1/ bOdd1_WIN.2 .
COMPUTE bOdd1_WIN_p.3 = 1/ bOdd1_WIN.3 .
COMPUTE bOdd1_WIN_p.4 = 1/ bOdd1_WIN.4 .
COMPUTE bOdd1_WIN_p.5 = 1/ bOdd1_WIN.5 .
but this won't work:
VECTOR bOdd1_WIN_p.(48).
DO REPEAT #i = 1 to 48.
COMPUTE bOdd1_WIN_p.(#i) = 1/bOdd1_WIN.(#i).
END REPEAT.
EXECUTE.
Dr. Frank
Gaeth
FU-Berlin
Art Kendall
Social Research Consultants