Server User Guides > Survey Tabulation > Table specification syntax > Element properties > Specifying factors for special elements
 
Specifying factors for special elements
You can specify factors for elements you define in your script using custom expressions.
This example shows how to specify factor values for elements used to band a numeric variable. This example bands the numeric income variable into three elements, defines a factor for each element, and creates a special mean element based on the factors. Notice that the factor value has been included in the element labels. This is useful for understanding the tabulated results when you use arbitrary values.
income{Low 'Low (1)' expression('income > 0 And Income < 50001') [Factor=1],
Mid 'Middle (2)' expression('income > 50000 And Income < 100001') [Factor=2],
High 'High (3)' expression('income > 100000') [Factor=3],
Mean 'Mean' mean()
Table showing mean element calculated from factors applied to banded elements
Here is a table that has this axis on the side:
This graphic is described in the surrounding text.
However, when banding numeric variables, it is more usual to base the mean on the raw numeric values. When you do this, you do not need to define factors. For example:
income{Low 'Low' expression('income > 0 And Income < 50001'),
Mid 'Middle' expression('income > 50000 And Income < 100001'),
High 'High' expression('income > 100000'),
Mean 'Mean' mean(income)}
When you want to base the statistical element on the raw numeric values, you must specify the name of the variable inside the parentheses that follow the keyword that defines the special element (mean in this example).
Table showing mean element calculated from raw values of banded numeric elements
Here is a table that has this axis on the side:
This graphic is described in the surrounding text.
See also
Element properties