Survey Tabulation > Table specification syntax > Special elements > Restricting a mean using an expression
 
Restricting a mean using an expression
This example is based on the Museum sample data set.
mean(visits, 'gender={Male}')
This example uses an expression on the mean element to specify the cases to use in the calculation of the value of the mean for the visits numeric variable. By adding the expression "gender={Male}", you restrict the calculation of the mean to include only those cases where the respondent is male. Apart from the mean element, you can create this type of expression for standard deviation, standard error, sample variance, minimum, and maximum elements. You must include a numeric variable when creating this type of expression, otherwise the expression is ignored and the special element (mean, standard deviation, standard error, or sample variance) is calculated from the assigned factors.
Table showing mean element restricted to include only responses where respondent is male
Here is a table that has this axis on the side:
See also
Special elements