Examples Showing Results Generated at Different Levels

When you use the hierarchical view of the data, you can define the level at which each table is generated. The level that you choose affects the figures that are shown in the cells of the table. The level you use to generate your results will depend on the level of detail you are interested in. For example, in the Household sample data set, when you generate a table at the top level, each case corresponds to a household and therefore the counts show numbers of households; when you generate the table at the person level, each case corresponds to a person and therefore the counts show numbers of people; when you generate a table at the trip level, each case is an overseas trip and the counts show numbers of trips, etc.

This topic uses the Household sample data set to illustrate how data is generated at different levels. For details of the structure of the Household sample, see The Household Sample.

Notes on generating the tables

All tables in this topic have a single cell item, Counts, and are set up to hide rows and columns where the base count is zero. (to change these properties, press F4 to display the Table Properties tab and set the properties in the Cell Contents and Hide tabs).

Table 1: Top-level variables tabulated at the top level

The first table crosstabulates two top-level variables (housetype and region) and generates results at the top level. The counts in the cells refer to households because in this survey the top-level questions refer to households.

To create this table, add the housetype variable to the side of the table and the region variable to the top. Use the default level setting (Top).

The cell in the top left corner of the table shows that there are 10 households in the sample.

Table 2: Person-level variables tabulated at the person level

This table crosstabulates two person-level variables (occupation and gender) and results are generated at the person level. Each cell shows the number of people of a given occupation and gender.

To create this table, expand the Person loop and then add the occupation variable to the side of the table and the gender variable to the top. Use the person level setting.

Looking at the top left cell, we can see that there are 25 cases at the person level, or, to put it another way, there are 25 people in the sample.

Table 3: Person-level variables tabulated at the top level

This table crosstabulates the same two person-level variables, but this time the results are generated at the top level. This means that instead of showing the number of people of a given occupation and gender, each cell now shows the number of households that contain people of the given occupation and gender.

To create this table, use the same structure as for the previous table, but this time change the level to the household (Top) level.

To change the level, press F4 to display the Table Properties tab and choose the Level tab. Select Top from the drop-down list box.

Looking at the top left cell, we can see that the base for the table is the same as in the first table shown above. This is what you would expect because both tables are counting the number of households and are unfiltered, and every household contains at least one person.

Table 4: Trip-level variables tabulated at the trip level

The next table crosstabulates two trip-level variables (country and purpose) and results are generated at the trip level. This means that each cell shows the number of overseas trips that involved a particular country and purpose.

To create this table, expand the Trip loop (which is inside the Person loop) and then add the country variable to the side of the table and the purpose variable to the top of the table. Use the default Level setting.

Looking at the top left cell, we can see that there were a total of 24 overseas trips (or to put it another way, there are 24 cases at the trip level).

Table 5: Trip-level variables tabulated at the person level

The next table crosstabulates the same two trip-level variables, but this time the results are generated at the person level. This means that instead of showing the number of overseas trips that involved a particular country and purpose, each cell now shows the number of people who took trips that involved a particular country and purpose.

To create this table, use the same table structure as in the previous example, but this time change the level to person.

Looking at the top left cell, we can see that the base for the table is 12. This is lower than the base in the Table 2 above (which tabulates two person-level variables at the person level) because some people did not take an overseas trip and therefore there are no records (cases) at the trip level for those people.

Table 6: Variables from different levels tabulated at the default level

You can create tables that use variables from more than one level. The next table crosstabulates a person-level variable (gender) with a trip-level variable (purpose). When you use variables from parent and child levels like this, the generation level defaults to the level of the lowest-level variable, which is the trip level in this example. This means that each cell in this table shows the number of overseas trips for a particular purpose and the gender of the person who took them.

To create this table, expand the Person loop and add the gender variable to the side of the table and then expand the Trip loop and add the purpose variable to the top.

If you look at the Base column, you can see that of the 24 overseas trips that were taken, 11 were taken by males and 13 by females.

Note that the base for the table (24) is the same as the base in Table 4 above (which tabulates two trip-level variables at the trip level).

Table 7: Variables from different levels tabulated at a higher level

The next table crosstabulates the same person-level variable (gender) with the same trip-level variable (purpose). However, this time the results are generated at the person level. This means that instead of showing the number of overseas trips, each cell now shows the number of people of each gender who took trips that involved a particular purpose.

To create this table, use the same table structure as in the previous example, but this time change the level to person.

If we look at the Base column, we can see that of the 12 people who took overseas trips, 6 were males and 6 were females.

The top left cell shows that the base for the table is 12, which corresponds with the base in the fifth table shown above, which tabulates two trip-level variables at the person level. Note that the base counts every person who took one or more overseas trips. People who did not take an overseas trip are not counted in the base because the base calculation considers empty levels to be Null.

Table 8: Tabulating variables from parallel levels

The next table crosstabulates a variable from the vehicle level (vehicletype) with a person-level variable (gender). If you refer to the diagram that shows the levels structure of The Household Sample, you will see that the person and vehicle levels are parallel to each other (on different branches of the tree). This means that the data at the two levels is not directly related to each other. It would therefore make no sense to generate results at either the person or vehicle level and so this is not allowed. However, you can generate results at a higher level that is an ancestor of both of them. In this example, the only level that is an ancestor of both the person and vehicle levels is the top level. Each cell therefore shows the number of households that have the various types of vehicles and that contain people of the given gender.

To create this table, expand the Vehicle loop and add the vehicletype variable to the side of the table, then expand the Person loop and add the gender variable to the top.

Table 9: Tabulating variables from higher levels at a lower level

You can also tabulate higher level variables at a lower level, provided that the variables are on the same branch of the structure and are not on parallel branches. The next table crosstabulates two top-level variables (housetype and region) as for table 1, but this time is populated at the person level.

To create this table, use the same table structure as in table 1, but this time change the level to person.

The counts in the cells refer to people rather than households. Notice that the cell in the top left corner of the table shows that there are 25 people in the sample.

Notice that we set the generation level for tables 3, 5, 7, and 9. For all of the other tables, we used the default level:

• Table 1 has two top-level variables only, so the default level is the top level.

• Table 2 has two person-level variables only, so the default level is the person level.

• Table 4 has two trip-level variables only, so the default level is the trip level.

• Table 6 has one person-level variable and one trip-level variable. The trip level is a child of the person level, so the default level is the trip level.

Note: The Level header/footer field shows the generation level for the table. By default, this is shown in the right header position. You can change this if required. See the topic Changing Headers and Footers for more information.