Hi,
In Python, it's simply:
import spss
for i in range(1, 16):
spss.Submit("COMPUTE X%sR=(X1_98-X%s_97)/Y." % (i, i))
Cheers!!
Albert-Jan
--- On Fri, 5/1/09, jing zhang <
[hidden email]> wrote:
> From: jing zhang <
[hidden email]>
> Subject: Macro to create ratio variables
> To:
[hidden email]
> Date: Friday, May 1, 2009, 5:43 PM
> Hello, I am trying
> to create� 15 ratio variables.
>
> I will highly
> appreciate any ideas to use MACRO (or loop) command to do
> this job in SPSS!
>
> Thanks,
> Jing
> Zhang
> economist at
> NCUA
> *****************************************
>
> COMPUTE X1R=
> (X1_98-X1_97)/Y .
> COMPUTE X2R=
> (X2_98-X2_97)/Y .
> …
> COMPUTE X15R=
> (X15_98-X15_97)/Y .
> �
> �
>
=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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