The Element List Syntax topic describes the syntax that you use to specify the elements to include in the axis of a table. This topic documents the special elements that you can include in an axis.
By default, the element name is the same as the element type. For example, by default, a Standard Error element is called stderr. However, if you create multiple elements of the same type, you must specify names to ensure that each element is uniquely identified.
The following table provides a summary of the syntax for each element type. The majority of these items can also be added using the Insert Categories dialog box. The Combine and Net elements can be added using the relevant options on the Edit Variable menu.
Description | Syntax |
---|---|
Base | base(['Expression Text']) |
Unweighted base | unweightedbase(['Expression Text']) |
Mean | mean([NumericVariable], ['Expression Text']) |
Standard deviation | stddev([NumericVariable], ['Expression Text']) |
Standard error | stderr([ NumericVariable ], ['Expression Text']) |
Sample variance | sampvar([NumericVariable], ['Expression Text']) |
Total | total() |
Subtotal | subtotal() |
Text (Subheading) | text() |
Minimum | min(NumericVariable, ['Expression Text'] ) |
Maximum | max(NumericVariable, ['Expression Text'] ) |
Net | net({ElementList}) |
Combine | combine({ElementList}) |
Expression (User-defined category) | expression('ExpressionText') |
Numeric | numeric(NumericVariable, ['Expression Text'] ) |
Paired Preference | ppt() |
Derived | derived( 'Expression Text' ) |
Sum | sum(NumericVariable, ['Expression Text']) |
Effective base | effectivebase() |
Median | median(NumericVariable, ['Expression Text'] ) |
Percentile | percentile(NumericVariable, CutOffValue, ['Expression Text']) |
Mode | mode(NumericVariable, ['Expression Text'] ) |
Net Difference | ntd() |
Note: NumericVariable (AnalysisVariable), Multiplier, and Weight properties need to be specified as absolute references. However, variable references in expressions need to be specified as relative references. Using the Household.mdd sample as an example, when editing a categorical variable at the person level, if you want to display the mean of man’s weight, you can add the following mean element: mean(person[..].weight, 'gender.ContainsAny({Male})')
When you create a net, if the name of the net is the same as that of any of the categories in the net, a net expression will be generated on the category, which will slow performance. Because of this, it is recommended that you do not use the same name for a net as for any of the categories in the net (though you can use the same description). For example, instead of:
Blue 'Blue' net({Blue, PaleBlue, DarkBlue})
use:
Blue_net 'Blue' net({Blue, PaleBlue, DarkBlue})