Tables and axes > Creating tables > Combining tables > Horizontal and vertical combination
 
Horizontal and vertical combination
Quick reference
To place tables side by side, type a tab statement for the first table and follow it with:
sid row_axis column_axis [;options]
Options are any of anlev=, c=, celllev=, inc=, maxim, means, median, minim and wm=.
More information
To put tables one underneath the other, type a tab statement for the first table and follow it with:
und row_axis column_axis [;options]
Options are any of anlev=, c=, celllev=, inc=, maxim, means, median, minim and wm=.
As mentioned in and statement, there are times when you have several tables all using the same row or column axis. Such tables could be specified more efficiently by using and statements. However, this prints each table on a separate page, making it difficult to compare figures in different tables.
The Quantum statements sid and und provide a means of printing two or more tables on the same page, either side by side or one underneath the other, making comparisons simpler. There are, however, some provisos.
If sid is used:
The overall width of the tables must not exceed the designated table width. The default is 132 characters — this can be changed by using pagwid= on the a statement.
The tables must be two-dimensional.
All tables must contain the same number of rows.
A maximum of 40 sid statements are allowed per tab statement.
If more than one table contains statistics such as means (n12) or standard deviations (n17) you must create the statistics using n25 statements in the axes rather than fac= options on the elements. If you use factors, Quantum takes the factors as they are defined in the earliest table in the group and applies them to all subsequent tables, overriding the factors defined for those tables.
When you use und:
All column axes must have the same number of columns.
The tables must be 2-dimensional.
The total number of elements in all axes in the table must not exceed 500.
Sid and und are formatted as follows:
sid axis1 axis2;[options]
und axis1 axis2;[options]
where axis1 and axis2 are the axes forming the table, and options are any of the keywords:
anlev=
c=
celllev=
inc=
maxim
means
median
minim
wm=
Output options such as the number of decimal places for absolutes, or the amount of spacing between lines in the output are taken from the tab, flt, sectbeg or a statement in that order.
A table created using tab with sid or und has become one table by the time output options are applied at the table formatting (qout) stage of the run. This means that any output options are applied to all elements in both the tab table and the sid or und table. Quantum does not apply output options to the tab and sid/und tables independently and then merge the tables.
So, for example, if you place sort on the tab statement of a tab/und pair, Quantum places the two tables one underneath the other and from then onwards treats the figures as a single table. At the output stage the figures are sorted with no distinction between the tab section and the und section.
For a full list of output options, see Options on a, sectbeg, flt and tab statements.
Any table headings for the second table must be entered as part of the text following the tab statement. If you are printing tables side by side and you want to define the layout of the column headings yourself, you must place the g/p statements in the axis which defines the columns and codes for each element, not all in the one named on the tab statement.
For example:
tab rating sex
sid rating region
l rating
col 120;Base;Very Good;Good;Bad;Very Bad
l sex
col 110;Base;Male;Female
g               Sex
g    Base    Male  Female
p       x       x       x
l region
col 111;North;South;East;West
g               Region
g   North   South    East    West
p       x       x       x       x
If percentage figures are requested or the table is to be sorted (ranked), these tasks are carried out once the tables have been arranged. With sid, if both column axes have base columns, row percentages for the tab and sid tables are created using the appropriate base column. If the tab column axis has a base, but the sid one does not, row percentages for the whole table are generated using the base from the tab column axis. If there is no base in the tab column axis, but one exists in the sid column axis, row percentages are created for the sid table but not for the tab table.
Up to 40 sids and any number unds can follow the tab as long as the overall limits for table sizes are not exceeded.
See also
Combining tables