Techniques for Exploring Data |
Subsetting Data
This section describes how to copy selected observations or
variables to a new data table.
The new data table is not
dynamically linked to the original data. The original data are not changed.
You can copy selected data by selecting
File New Data Set from Selected Data
from the main menu, as shown in Figure 11.1.
Figure 11.1: Creating a New Data Table from Selected Data
When you select File New Data Set from
Selected Data, Stat Studio performs one of the following actions:
- If no variables or observations are selected,
the Choose Variables dialog box (Figure 11.2) opens and
prompts you to select one
or more variables. When you click OK, the selected variables are
copied to a new data table. The variables are copied in the
order in which they appear in the original data table.
Figure 11.2: The Choose Variables Dialog Box
If no variables are selected, but there are selected observations, the
selected observations (for all variables) are copied to a new
data table. You can use this technique to copy data that satisfy
certain conditions.
If variables are selected, but there are no selected observations, the
selected variables are copied to a new
data table. The variables are copied in the order in which they
were selected. You can use this technique to reorder variables.
If both variables and observations are selected, the selected
observations for the selected variables are copied to a new data
table. The variables are copied in the order in which they were
selected. For example, in Figure 11.3 the variables were
selected in the order longitude, latitude, and
category. (Note that the column headings display numbers that indicate
the order in which you selected the variables.) If you copy the data
to a new data table, the new data table will contain 12 observations
for the longitude, latitude, and category variables,
in that order.
Figure 11.3: Selected Variables and Observations
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.