Selection Statement Dialog

Using the controls described below, create selection statements to define criteria on the Selection tab, groupings in a merged variable, or cause of death in a Survival session.

To use a variable in a selection statement, work from left to right through the boxes at the top of the dialog. First, highlight the variable to select it. Then highlight an operator. Finally, specify the values for this variable.


Each line of a selection statement defines selection criteria for one variable. The variables in the database are listed in categories displayed as folders in this box.

To expand a category, double-click the folder label or click the plus sign (+) next to it. This reveals the individual variables contained in the category.

If you are having trouble locating a variable using the list of categories, click Find to access the Find Variable dialog.

Click on the variable you want to use to highlight it, then move to the Operator box.

If you choose a merged variable, it will be converted to its underlying selection statements when you click OK. Note that in Rate and LD Prevalence sessions, merged variables can only be used in a selection statement if all of their underlying variables have the same data source (i.e., appear in the same one of the three boxes on those sessions' Selection tabs).


Two operators, "is = to" and "is not = to", are available when defining selection criteria on the Selection tab.

In the selection statement, the "is = to" operator is represented by "=", and the "is not = to" operator is represented by "!=".

Click on the operator you want to use to highlight it, then move to the Values box.


There are two formats used for the Values box, a list format and a range format. For some variables, you will see a list of all values for that variable; that is, all groupings defined for the variable. Some variables have so many values that it is not practical to list them all; for these variables, the range of all possible values will be shown.

When selecting values from a list, you may select one or more values. Simply click on a variable to select it; it will become highlighted. The standard methods used in Windows for selecting multiple items from a list can be used here, including:

If you want to specify a range of values for a variable, use a hyphen to define the range and use commas to separate multiple values or ranges (e.g. "1-5,8-19"). In range format, the valid values for the variable are shown just above the Values box.

Note that some variables can have both the range and list formats.

New Line

Each line of a selection statement defines selection criteria for one variable. When you have finished defining a line -- by choosing a variable, an operator, and one or more values -- highlighting a different variable in the Variables box will automatically begin a new line.

If you need to force SEER*Stat to begin a new line -- for example, if the next line of your selection statement will use the same variable as the current line -- you can do so by clicking New Line.

The line you are currently editing is always highlighted in the Selection Statement box. To edit a different line, click on it to highlight it.

The Modify checkbox indicates whether you are editing an existing line or creating a new one, and you can change its status if you want to do one or the other. After editing a previously existing line, clear the checkbox to begin a new line. If you are creating a new line, and want to change the variable you're using without starting another new line, mark the checkbox first.


Each line of a selection statement after the first is joined to the line preceding it with a Boolean conjunction. SEER*Stat uses the conjunction "AND" by default, but you can change this using the Conjunction drop-down list.

The "Or" operator will evaluate the pair of lines as true if the record being considered matches either or both of the lines. The "And" operator will evaluate the pair of lines as true only if the record being considered matches both lines.

Operators are evaluated in a standard order of precedence. Pairs of lines that have already been evaluated form a logical block that is considered as a single true or false statement when being evaluated in conjunction with the remaining lines or logical blocks in the statement. You can alter the order of precedence and define your own logical blocks using parentheses (see below to learn how to use parentheses in a selection statement).

You may also use this drop-down list to choose whether to add a Boolean "Not" operator after your conjunction. A "Not" applies to the logical block that follows it, inverting the truth or falsehood of that block. The "Not" operator is not available when you are creating a merged variable grouping.

Add (...), Delete (...), and Del All (...)

These buttons allow you to add parentheses to or remove them from your selection statement. Parentheses around a group of lines tell SEER*Stat to evaluate those lines first when processing the selection statement. Click and drag the mouse pointer to highlight the lines you want to work with, then:


It is possible to use multiple and nested sets of parentheses in the same selection statement. SEER*Stat checks the selection statement to prevent you from adding or deleting parentheses in a way that would upset the logical structure established by any existing parentheses. These buttons will be disabled if you have not highlighted lines on which you can safely use them.

Moving and Copying Lines

To move a line or group of lines within your selection statement, click the line to highlight it (or hold CTRL while clicking to highlight multiple lines), then click Up or Down.

Click Delete to remove the highlighted line(s) from the selection statement.

To duplicate lines, highlight them and click Copy. The lines will be copied to the Windows clipboard. Highlight another line, then click Paste. SEER*Stat will prompt you to choose where you want put the copied lines. Click Yes to insert them after the highlighted lines, No to insert them in place of the highlighted lines, or Cancel if you decide not to insert them. If you click Paste with no lines highlighted, the lines will be pasted at the end of your selection statement.

You can paste lines that you have copied from your selection statement into other Windows applications. You can also copy selection statements from other applications and Paste them into SEER*Stat, as long as they have the correct syntax. If you paste in lines that refer to nonexistent variables, you will have to delete or correct them before you save your selection statement. If you paste lines that refer to invalid variable values, SEER*Stat will delete those values automatically.

Selection Statement

As you build your selection statement, it will be displayed in the box at the bottom of the dialog. The following is an example of a finished selection statement:

{Race, Sex, Year Dx, Registry, County.Year of diagnosis} = '1973','1974','1975','1976','1977','1978','1979'
AND {Race, Sex, Year Dx, Registry, County.Sex} = '  Male'

The syntax used in selection statements is as follows:

See Using Correct Full Boolean Logic to Build a Selection Statement to learn more about the logic used in selection statements.