Sorting Observations

This section describes how to sort a data table by one or more variables.

To open the Sort dialog box, you can select EditVariablesSort from the main menu. Alternatively, you can right-click a variable heading to display the Variables menu (shown in Figure 4.2), and then select Sort. The Sort dialog box is shown in Figure 4.4.

The first time the Sort dialog box is created, any variables that are selected are automatically placed in the Sort by list. Subsequently, the Sort dialog box remembers the Sort by list from the last sort.

Figure 4.4: The Sort Dialog Box

The Sort Dialog Box


The following list describes each item in the Sort dialog box.

Variables

lists the variables in the data set that are not yet in the Sort by list. Select variables in this list to transfer them to the Sort by list.

$\bm {\ggg }$

transfers the selected variables from the Variables list to the Sort by list.

$\bm {\lll }$

removes selected variables from the Sort by list.

Sort by

lists the variables to sort by.

Up

moves a selected variable up one space in the Sort by list.

Down

moves a selected variable down one space in the Sort by list.

Ascending

marks the selected variables in the Sort by list to be sorted in ascending order.

Descending

marks the selected variables in the Sort by list to be sorted in descending order.

To carry out the sort operation, click OK.

As described in the section The Variables Menu, a nominal variable can be ordered in different ways. If a variable has an ordering different from the standard ordering, then the sort dialog box indicates that fact by marking the variable name with an asterisk.