COLOP and ROWOP Keywords (GRAPH command)
The COLOP
and ROWOP
keywords specify
the paneling method for the column and row variables, respectively.
These keywords have no effect on the chart if there is only one variable
in the rows and/or columns. They also have no effect if the data are
not nested.
CROSS. Cross variables in the rows or columns. When the variables are crossed, a panel is created for every combination of categories in the variables. For example, if the categories in one variable are A and B and the categories in another variable are 1 and 2, the resulting chart will display a panel for the combinations of A and 1, A and 2, B and 1, and B and 2. A panel can be empty if the categories in that panel do not cross (for example, if there are no cases in the B category and the 1 category). This is the default.
NEST. Nest variables
in the rows or columns. When the variables are nested,
a panel is created for each category that is nested in the parent
category. For example, if the data contain variables for states and
cities, a panel is created for each city and the relevant state. However,
panels are not created for cities that are not in certain states,
as would happen with CROSS
.
When nesting, make sure that the variables specified for ROWVAR
or COLVAR
are in the correct order. Parent variables precede child variables.
Example
Assume you have the following data:
State | City | Temperature |
---|---|---|
NJ | Springfield | 70 |
MA | Springfield | 60 |
IL | Springfield | 50 |
NJ | Trenton | 70 |
MA | Boston | 60 |
You can create a paneled chart from these data with the following syntax:
GRAPH
/HISTOGRAM=temperature
/PANEL COLVAR=state city COLOP=CROSS.
The command crosses every variable value to create the panels. Because not every state contains every city, the resulting paneled chart will contain blank panels. For example, there will be a blank panel for Springfield and New Jersey. In this dataset, the city variable is really nested in the state variable. To nest the variables in the panels and eliminate any blank panels, use the following syntax:
GRAPH
/HISTOGRAM=temperature
/PANEL COLVAR=state city COLOP=NEST.