=========================================================================
Date: Mon, 10 Jul 2006 13:15:15 -0700
Reply-To: Howie Harshaw <harshaw@interchange.ubc.ca>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Howie Harshaw <harshaw@interchange.ubc.ca>
Subject: LOOP Question
In-Reply-To: <002701c6a435$32ac1c40$e900a8c0@NOTEBOOK>
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Hi Folks,
I have to do a series of analyses for six different communities in one
dataset. The communities are coded from 1 to 6. I the past, I have
created six different filters and had lots of code. It dawned on me
that there is a more parsimonious way of doing this, and I thought that
LOOP might work; having never used it before, I tried to adapt an
example form the syntax manual, but to no avail. I have pasted my code
below... what have I done wrong?
LOOP #I - 1 TO 6.
COMPUTE filter_$=(Comm=#I).
VARIABLE LABEL filter_$ '(Comm=#I) (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
FREQUENCIES /*Descriptive statistics for selected variables*/
VARIABLES=sec01_04 Sec02_03 Sec02_06 Sec02_10 Sec02_12 Sec11_04
Sec11_09 @NEP_SCALE
/STATISTICS=STDDEV MINIMUM MAXIMUM SEMEAN MEAN MODE
/ORDER= ANALYSIS .
END LOOP.
Thanks for any help you can provide,
- Howie
_______________________________
Howard Harshaw, Ph.D.
Research Associate
Forest Resource Management
Faculty of Forestry