|Date: ||Thu, 10 Apr 2008 23:46:04 -0400|
|Reply-To: ||Richard Ristow <email@example.com>|
|Sender: ||"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>|
|From: ||Richard Ristow <firstname.lastname@example.org>|
|Subject: ||Re: Help with Loop|
|Content-Type: ||text/plain; charset="us-ascii"; format=flowed|
Ah, this helps a lot. At 09:16 PM 4/10/2008, Michael Kruger wrote:
>I have frequency data in two rows ('select if row_no EQ 1 OR row_no
>EQ 477 to start with). The row 1 has the control frequencies and row
>477 the treatment frequencies. I am running my statistical procedure
>on these two rows and then need to increment my syntax statemtn to
>read 'row 2 OR row 478', then run the analysis; and so on until I
>end with 'select if row_no eq 476 aOR row_no eq 952'.
OK: you're running the same procedure on multiple sets of *cases*.
The most efficient way to do that is with SPLIT FILES, which can run
the same procedure over a set of subsets of the cases, in one data
pass. (You could also use a macro loop, but it would be MUCH harder
to write, and much less efficient.)
This isn't tested, but I think it's in the right direction:
NUMERIC ExptGrp (F5)
CaseCtrl 1 'Control' 2 'Treatment'.
DO IF row_no LE 476 /* Control lines */.
. COMPUTE ExptGrp = row_no.
. COMPUTE CaseCtrl = 1.
ELSE /* Treatment lines */.
. COMPUTE ExptGrp = row_no - 476.
. COMPUTE CaseCtrl = 2.
SORT CASES BY ExptGrp CaseCtrl.
SPLIT FILE BY ExptGrp.
<<run statistical procedure>>
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
For a list of commands to manage subscriptions, send the command