Examples of using column_weight and/or row_weight

All of the examples of column_weight and row_weight below are written inside of a define block.

Example #1:

This column_weight statement will weight the fourth column by four, however, example 2’s method of doing the same thing is much easier to writeand to check.

tabset={two:column_weight=: values(1,1,1,4)}



Example #2:

tabset={one:column_weight=: total with total with total with 4}



Example #3:

A combination of defined variables and values() is also an acceptable way to achieve the same results as example 1 and 2.

wtby4: 4tabset={three:column_weight=: values(1,1,1) with wtby4}

Example #4:

Here is how to use weights that have been stored in a table. The reason this is useful is that one can write a proc, which runs before the tables, that calculates the weights based on the contentsof the data file being used.

If, in a clean block, one were to do the following two commands:

create tab4(=1, =6)=0m tab4(t by 1 to 4)=values(1,1,1,4)


The following tabset would produce the same results as the previous three examples:

tabset={four:column_weight=: numfrtab(4,tab4(t by 1 to 4))}

Example #5:

This is an example of column_weights being based on each respondent’s answers to certain questions. Notice that the individual fields may be adjusted as in ([2] * 10) below.

wt5: [1] with ([2] * 10) with [3] with [4]tabset={five:column_weight=: wt5}


Neither column_weight nor row_weight has an effect on the summary cells. When column_weight and row_weight are both in effect, each non-summary table cell is multiplied by both of the applicable factors.