Date: Mon, 21 Feb 2005 08:45:29 -0500
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Art Kendall <Art@DRKENDALL.ORG>
Organization: Social Research Consultants
Subject: Re: simplifying a series of commands
Content-type: text/plain; charset=ISO-8859-2; format=flowed
I concur with Dr Spousta.
However, I would like to add a couple of suggestions.
When you enter the syntax into the syntax window (either directly of via
<paste> from the GUI), highlight COUNT and click the syntax button to
see what else can be done with COUNT.
In your original syntax you use "=" both as a logical operator and as an
assignment operator. It often results in more readability and hence less
confusion for yourself, your quality assurance reviewer, and those
trying to help you if you use the conventional logical operators EQ GT
GE LE LT OR AND. The symbolic operators are harder to read with most
fonts and lighting conditions. Both approaches are syntactically
correct and will result in the same operations when you have finished
refining the syntax. It make the most difference during the refining
and reviewing phases.
Social Research Consultants
University Park, MD USA
Spousta Jan wrote:
>I would use the COUNT command instead of compute here - it is much easier to produce and read.
>Menu: Transform -> Count.
>COUNT psy = dx1 to dx7 (2, 3, 4).
>From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
>Sent: Monday, February 21, 2005 9:02 AM
>Subject: simplifying a series of commands
>I was asked about a method to compute the frequency of certain values
>across multiple variables (dx1, dx2, dx3, dx4, dx5, dx6, dx7) .
>The following syntax performs the task, however, it will be a lot of work
>to perform this for the remaining values.
>COMPUTE psy = dx1=2 or dx1=3 or dx1=4 or dx2 =2 or dx2=3 or dx2 = 4 or dx3
>=2 or dx3 =3 or dx3=4 or dx4 = 2 or dx3=3 or dx4 =4 or dx5 =2 or dx5 =3 or
>dx5= 4 or dx6 =2 or dx6=3 or dx6 =4 or dx7 =2 or dx7=3 or dx7=4 .
>Any assistance with the above is appreciated,