simple question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

simple question

Muir Houston
Sorry to bother you with a simple question - I used to be able to do
this more elegantly but cannot find my relevant syntax file
what I want to do is select a number of categories of a numeric variable
along with two other select if statements
this works, but I think it could be neater
USE ALL.

COMPUTE filter_$=(F_INSTID = 9 & F_XQMODE01 = 1 & F_XJACS201 ~= (1 ) &
F_XJACS201 ~= (2) & F_XJACS201 ~= (7)).

VARIABLE LABEL filter_$ 'F_INSTID = 9 & F_XQMODE01 = 1 & F_XJACS201 ~=
(1 ) & F_XJACS201 ~= (2) & F_XJACS201 ~= (7) (FILTER)'.

VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.

FORMAT filter_$ (f1.0).

FILTER BY filter_$.

EXECUTE .

thanks in advance

Muir

 
 
 
 

--
The University of Stirling is a university established in Scotland by
charter at Stirling, FK9 4LA.  Privileged/Confidential Information may
be contained in this message.  If you are not the addressee indicated
in this message (or responsible for delivery of the message to such
person), you may not disclose, copy or deliver this message to anyone
and any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful.  In such case, you should destroy this
message and kindly notify the sender by reply email.  Please advise
immediately if you or your employer do not consent to Internet email
for messages of this kind.
Reply | Threaded
Open this post in threaded view
|

Re: simple question

ViAnn Beadle
I'm not sure what motivates you to look for a more elegant solution--this is
shorter, and produces the same results.

COMPUTE filter_$$=(F_INSTID = 9 & F_XQMODE01 = 1 AND NOT(ANY(F_XJACS201, 1,
2, 7))).

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Muir Houston
Sent: Thursday, July 12, 2007 9:05 AM
To: [hidden email]
Subject: simple question

Sorry to bother you with a simple question - I used to be able to do
this more elegantly but cannot find my relevant syntax file
what I want to do is select a number of categories of a numeric variable
along with two other select if statements
this works, but I think it could be neater
USE ALL.

COMPUTE filter_$=(F_INSTID = 9 & F_XQMODE01 = 1 & F_XJACS201 ~= (1 ) &
F_XJACS201 ~= (2) & F_XJACS201 ~= (7)).

VARIABLE LABEL filter_$ 'F_INSTID = 9 & F_XQMODE01 = 1 & F_XJACS201 ~=
(1 ) & F_XJACS201 ~= (2) & F_XJACS201 ~= (7) (FILTER)'.

VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.

FORMAT filter_$ (f1.0).

FILTER BY filter_$.

EXECUTE .

thanks in advance

Muir






--
The University of Stirling is a university established in Scotland by
charter at Stirling, FK9 4LA.  Privileged/Confidential Information may
be contained in this message.  If you are not the addressee indicated
in this message (or responsible for delivery of the message to such
person), you may not disclose, copy or deliver this message to anyone
and any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful.  In such case, you should destroy this
message and kindly notify the sender by reply email.  Please advise
immediately if you or your employer do not consent to Internet email
for messages of this kind.