selective analysis

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

selective analysis

Moon Kid
I think I answered the question for myself but want to know if you see
some problems or possibilities to improve with that syntax.
The following code is derived by myself from code generated with a
gui-clicking orgie.

COMPUTE filter_$=(v46c = 5).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES VARIABLES=v46s
   /ORDER=ANALYSIS.

FILTER OFF.
USE ALL.
EXECUTE.
DELETE VARIABLE filter_$.

As I see there is no way to FILTER without creating a new variable
inside my beautiful and clean dataset? :D

Is there a special meaning of the $ at the end of the variable?

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: selective analysis

Jignesh Sutar
Make use of the TEMPORARY command:

temp.
select if (v46c = 5).
freq v46s.




On 1 April 2014 12:05, Moon Kid <[hidden email]> wrote:
v46c = 5


Reply | Threaded
Open this post in threaded view
|

Re: selective analysis

Andy W
In reply to this post by Moon Kid
Yes I do not think there is any way around creating a new variable for the FILTER. Also see MATCH FILES and the DROP subcommand to get rid of variables in addition to DELETE VARIABLE.

FILTER is better if you are generating multiple tables, but if you only need to create one frequency table you could use TEMPORARY and SELECT IF. Example below.

TEMPORARY.
SELECT IF (v46c = 5).
FREQUENCIES VARIABLES=v46s
   /ORDER=ANALYSIS.

And that would accomplish the same thing as your listed code (you also do not need the USE ALL command). But this only works for one table at a time - as the TEMPORARY command only works for one pass of the data.
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: selective analysis

Jon K Peck
In reply to this post by Moon Kid
You can simplify this by using
temporary.
select if ...
frequencies ...




Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Moon Kid <[hidden email]>
To:        [hidden email],
Date:        04/01/2014 05:07 AM
Subject:        [SPSSX-L] selective analysis
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I think I answered the question for myself but want to know if you see
some problems or possibilities to improve with that syntax.
The following code is derived by myself from code generated with a
gui-clicking orgie.

COMPUTE filter_$=(v46c = 5).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES VARIABLES=v46s
  /ORDER=ANALYSIS.

FILTER OFF.
USE ALL.
EXECUTE.
DELETE VARIABLE filter_$.

As I see there is no way to FILTER without creating a new variable
inside my beautiful and clean dataset? :D

Is there a special meaning of the $ at the end of the variable?

=====================
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


Reply | Threaded
Open this post in threaded view
|

Re: selective analysis

Art Kendall
In reply to this post by Moon Kid
You might also want to consider SPLIT FILE  CROSSTABS  some other ways of looking at the 2 or more ways of breaking out data.

Art Kendall
Social Research Consultants
On 4/1/2014 7:14 AM, Moon Kid [via SPSSX Discussion] wrote:
I think I answered the question for myself but want to know if you see
some problems or possibilities to improve with that syntax.
The following code is derived by myself from code generated with a
gui-clicking orgie.

COMPUTE filter_$=(v46c = 5).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES VARIABLES=v46s
   /ORDER=ANALYSIS.

FILTER OFF.
USE ALL.
EXECUTE.
DELETE VARIABLE filter_$.

As I see there is no way to FILTER without creating a new variable
inside my beautiful and clean dataset? :D

Is there a special meaning of the $ at the end of the variable?

=====================
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



If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/selective-analysis-tp5725138.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants