Tables and axes > Statistical functions and totals > Averages
 
Averages
Quick reference
To create an element whose value is the average of the values in the other elements of the axis, type:
n07[element_text]
To exclude zero cells from being counted when calculating the average, type:
n07[element_text];ignorezeros
More information
The average (n07) is calculated by summing up the cell counts generated by n01, col, val, bit and fld statements, and dividing the result by the number of elements summed. Only rows before the n07 are included. If the axis contains more than one n07, the second average deals only with those rows between it and the previous n07.
If you had placed an n07 at the end of the row axis in Figure 19.1, the average for the base column would be:
(1436 + 1552 + 1934 + 1504) / 4 = 1606
By default, Quantum always divides the sum of values by the total number of elements, including cells that are zero. To exclude zero cells from being counted, type:
n07[element_text];ignorezeros
So, if you are calculating the average of four elements whose counts are 10, 20, 0, 10, by default Quantum sums these counts and divides by four. The average of this calculation is 10. However, using ignorezeros excludes the third element from the calculation and gives the average as 13.33. You can specify noignorezeros to revert to the default.
Note You can only use ignorezeros on an n07 statement; it is not valid on any other statements.
Do not confuse the average with the mean. The average is based on counts in the table, and the rows containing those counts; the mean is based on values in the data (or factors associated with those values), and respondents.
For more information on means, see the next section.
The mean figure for the base above is:
(1436 + 1552 + 1934 + 1504) / 1105 = 5.81
The cell counts are the same as for the average because they are read directly from the data with inc=, but instead of dividing by the number of elements you divide by the number of respondents giving those answers.
Note Be careful if you use averages in axes with nets: the net figures will be included in the average which is probably not what you want.
See also
Statistical functions and totals