Examining Data |
Sometimes you want to find observations that share some characteristic. For example, you might want to find all the baseball players who primarily played first base. To do so, follow these steps. The figures in this section are based on the NAME variable appearing as the first variable. If you just completed the previous two sections on moving variables and sorting observations, move the SALARY variable to the last position and sort the observations on NAME. Make sure no variables are selected.
Choose Edit:Observations:Find. |
Figure 3.16: Finding Observations
This displays the Find Observations dialog.
Figure 3.17: Find Observations Dialog
Select the POSITION variable. |
Scroll the list of variables at the left to see the POSITION variable. Then point and click to select POSITION. Notice that the list of values at the right now contains all the unique values of the POSITION variable. By default, the equal (=) test and the first value are selected.
Figure 3.18: Selecting POSITION
Select the values 13, 1B, and 1O. |
On most hosts, you can either Shift-click or CTRL-click to select these values. The players selected primarily played first base. Note that players with POSITION = O1 also played some first base, but they played primarily in the outfield.
Click the Apply button to find the data. |
This selects observations without closing the Find Observations dialog. Clicking the OK button closes the Find Observations dialog after selecting the observations.
Figure 3.19: Selecting First Basemen
Now all observations where POSITION is 13, 1B, or 1O are highlighted.
Figure 3.20: First Basemen Found
Choose Find Next from the data pop-up menu. |
The data window scrolls so the next observation with POSITION = 13, 1B, or 1O is at the top.
Figure 3.21: Finding the Next Observation
Choose Move to First from the data pop-up menu. |
This enables you to see all the selected observations in one place, in this case at the top of the data window.
Figure 3.22: Collecting the Selected Observations
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.