Element Syntax

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.

DescriptionSyntax
Basebase(['Expression Text'])
Unweighted baseunweightedbase(['Expression Text'])
Meanmean([NumericVariable], ['Expression Text'])
Standard deviationstddev([NumericVariable], ['Expression Text'])
Standard errorstderr([ NumericVariable ], ['Expression Text'])
Sample variancesampvar([NumericVariable], ['Expression Text'])
Totaltotal()
Subtotalsubtotal()
Text (Subheading)text()
Minimummin(NumericVariable, ['Expression Text'] )
Maximummax(NumericVariable, ['Expression Text'] )
Netnet({ElementList})
Combinecombine({ElementList})
Expression (User-defined category)expression('ExpressionText')
Numericnumeric(NumericVariable, ['Expression Text'] )
Paired Preferenceppt()
Derivedderived( 'Expression Text' )
Sumsum(NumericVariable, ['Expression Text'])
Effective baseeffectivebase()
Medianmedian(NumericVariable, ['Expression Text'] )
Percentilepercentile(NumericVariable, CutOffValue, ['Expression Text'])
Modemode(NumericVariable, ['Expression Text'] )
Net Differencentd()

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})')

Note on Naming Nets

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})