IBM Support

Using Select Cases Properly

Troubleshooting


Problem

You are using Statistics with the Select Cases function in which you want to select 2 out of 4 values for a particular variable. You go to Data->Select Cases->and Click on 'If condition is satisfied' You then click on the 'IF' push button, highlight my variable, and click on the middle arrow to bring it over to the Expression box. You then specify 'var=1' AND 'var=2'. When you do so, all the cases become unselected. What you are doing wrong?

Resolving The Problem

The 'AND' function in the Select Cases within SPSS is used to specify a condition for 2 or more separate variables. If you would like to specify a condition for just one variable in which you want to select cases based on two or more values within that variable, you need to use the 'OR' function or use the 'ANY' function. For example, if your variable were called 'v1' and you wanted to select cases for which 'v1'='1' and 'v1' = '2,' your Expression box within Select Cases should indicate, 'v1=1 OR v1=2.' The 'ANY' function also accomplishes the same result. You would click on the 'ANY' function in the function box within the 'If condition is satisfied' box within Select cases and replace the first question mark with your variable name and then replace the next two question marks with your two values. If you have more than two values, you can specify those values by specifying a comma after each value. For example, if you just wanted to select cases in which your variable 'v1' contained the values of '1,' '2,' or '3,' your Expression box should look something like, 'ANY(v1,1,2,3).' If you prefer to use command syntax, the same rules above hold true

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Statistics Server","Platform":[{"code":"PF014","label":"iOS"},{"code":"PF033","label":"Windows"}],"Version":"18.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

19568

Document Information

Modified date:
16 April 2020

UID

swg21476704