# MV_MEDIAN_ABSOLUTE_DEVIATION

The MV_MEDIAN_ABSOLUTE_DEVIATION function transforms a multi-valued field into a single-valued field that retains the median absolute deviation. It computes this as a median of the deviation of each datum from the entire sample's median. In other words, for a random variable `X`, the median absolute deviation can be represented as `median(|median(X) - X|)`.

## Syntax

`MV_MEDIAN_ABSOLUTE_DEVIATION(number)`

### Parameters

#### number

A multi-valued expression.

*Notice*: If the field comprises an even amount of values, the median is deduced as an average of the two central values. If the value isn't a floating-point number, the average values are rounded towards 0.

## Examples

```esql
ROW values = [0, 2, 5, 6]
| EVAL median_absolute_deviation = MV_MEDIAN_ABSOLUTE_DEVIATION(values), median = MV_MEDIAN(values)
```

This example illustrates the computation of the median absolute deviation and the median from a list of numerical values.
