<< Click to Display Table of Contents >> Navigation: Reference > Functions > %TMED |
This function returns the median value in the cells specified.
Forms of use:
DW wvar = %TMED(table[(part-id)]),
MT table(cell) = %TMED(table[(part-id)]),
Any cells in the argument with value U (undefined) are ignored completely. If all cells are undefined then the result is undefined.
Each cell is treated as a respondent, the value in the cell is treated as the value pertaining to that respondent.
The function makes use of format MDR which specifies the assumed range of values in each cell. For example if F=MDR1, then a value of 12 in a cell is assumed to cover the range 11.5-12.5. This means that where more than one cell contains the same mid-point value, e.g. if the cells have values 10, 11, 12, 12, 13, then the median will be 11.75 - i.e. the value 12 is assumed to be spread across the range of the two cells, and the middle cell thus takes the value 11.5-12.0, and the midpoint of this is 11.75.