Case Selection Conditions

The clickable Sel: Off (or Sel: On) field of the status bar displays the current status of the Spreadsheet Case Selection Conditions, that is, optional user-defined conditions (or "filters") that can be used to select a particular subset of cases for an analysis.

Normally, all cases encountered in the data file are processed (as long as they do not have missing data). However, you can define temporary subsets of data and temporarily limit an analysis to those subsets only (e.g., only females older than 60 who either have a high cholesterol level or high blood pressure). The Sel: Off (or Sel: On) field also acts as a button: by clicking it, you can display the Spreadsheet Case Selection Conditions dialog, which shows the currently specified conditions (if any were defined). This is only available if the current input spreadsheet is selected. Note that case selection conditions can also be displayed using the Tools menu.

Note: unless you are at the beginning of an analysis or graph, a warning message is displayed asking if you want to start a new analysis or graph because changing selection conditions in the middle of an analysis or graph can lead to inconsistent results (i.e., different stages of computations would be based on different subsets of data). However, if you click this status bar field at any point when the conditions can be adjusted (e.g., before an analysis is started), the Spreadsheet Case Selection Conditions dialog is displayed allowing you to enter or edit the text of the conditions.

The syntax of those conditions is very simple (note the examples in the help area of the dialog). You can refer to variables by their numbers (e.g., v1, v2, v3, ...; note that v0 is the case number) or names (e.g., Income, Profit). Thus, for example, the expression:

Include cases: v0<101 and v1=1

will include in the analysis only cases from the first 100 (i.e., case number has to be less than 101) and where the value of variable number 1 (i.e., v1) is 1. Note that if the name of variable number 1 was Gender, and for this particular variable, 1 was equivalent to the text value MALE, the same case selection condition could be alternatively entered as:

Include cases: v0<101 and GENDER = 'MALE'

The syntax of the expressions supports a wide selection of functions and operators, and allows you to specify case selection conditions of practically unlimited complexity. For further details, see What syntax can be used to create case selection/verification/recode conditions?.

The specified conditions can be preserved even if you turn off the computer (when you exit the program, STATISTICA will prompt you to save the changes to the current data file. If you click the Yes button, the selection conditions will be saved with the data file).

Note: case selection conditions can also be specified for only the current analysis or graph (and, hence, not be tied to the current data file) by clicking the  button to display the Analysis/Graph Case Selection Conditions dialog. This button is included on all Startup Panels and all analysis or graph definition dialogs that are displayed before the data processing begins.

The other tabs on this dialog are used to select a cell display format that will be used to mark selected cases and to create a new subset of the current spreadsheet either by case selection conditions or random sampling techniques.