Multidimensional tables
Multidimensional tables are ones created from more than two axes. They occur when a series of tables has the same rows and columns, but each table in the group has additional characteristics which are themselves the conditions of other axes.
For example, a table might have age by sex created by the tab statement:
tab age sex
You want to produce a separate table of age by sex for each region of the country. Whereas before each cell had two conditions (age and sex) it now has three (region, age and sex).
There are two ways of writing this specification.You can write either:
▪as many tab statements as there are regions, and filter each table of age by sex to include only those respondents resident in a given region, or
▪a single tab statement to create a three-dimensional table.
Both methods produce the same results, but the second method involves less work.
The tab statement to create the multidimensional table is:
tab region age sex
Now, if region has four rows and a base:
l region
col 135;Base;hd=Area of Residence;North;South;East;West
Quantum provides five tables:
1 Base: Age by Sex (that is, all respondents included).
2 North: Age by Sex.
3 South: Age by Sex.
4 East: Age by Sex.
5 West: Age by Sex.
When these tables are printed, the region names from the col statement are printed at the top of the table, as you can see from the sample table.
Absolutes/Col percents Area of Residence - North Q2. Age Base: All Respondents Base Male Female
Base 153 76 77
11-20 yrs 39 17 22 25% 22% 29% 21-34 yrs 64 36 38 42% 48% 36% 35-54 yrs 38 19 19 25% 25% 25% 55+ yrs 12 4 8 8% 5% 10% |
Tables can have up to six dimensions: that is, up to six axes can be named on a single tab statement.
It is difficult to visualize a four, five or six-dimensional table. The easiest way is just to think of the higher dimensions as extra conditions, and the multidimensional tab statement as a simpler way of writing them. For example, you might need a four-dimensional table using the axes mstat, region, age and sex:
tab mstat region age sex
Age and sex are the rows and columns respectively, region is the third dimension and mstat (marital status) is the fourth. Mstat is set up as follows:
l mstat
col 134;Base;Single;Married;Divorced;Widowed
so the tables created are:
1. | Mstat Base: | Region Base: | Age by Sex |
2. | | North: | Age by Sex |
3. | | South: | Age by Sex |
4. | | East: | Age by Sex |
5. | | West: | Age by Sex |
6. | Single: | Region Base: | Age by Sex |
7. | | North: | Age by Sex |
The first table of age by sex is for all respondents, since the conditions defined by the higher dimensions are both ‘All respondents’ (that is, Bases). The seventh table is a cross-tabulation of age by sex for all respondents who are single and live in the North.
Altogether this tab statement produces 25 tables because there are five rows in the third and fourth dimension axes.
If the tab statement has options on it, they apply to all the tables in the set. All tables have different page numbers, but they all have the same table number.
See also