median

median(a, b, c, ...)

median(A)

Try it yourself:


Find the middle value with median

median returns the central value of ordered numeric data, or the average of the two central values for an even number of observations. It is a robust measure of typical value.

Why use median

For 1, 3, and 100, the median is 3 while the mean is pulled upward. Use sort to inspect ordering, quantileSeq for other percentiles, and mad for robust spread.

Caveats

Median needs comparable numeric values and a non-empty collection. It does not describe multimodal data; use mode when the most frequent value is the question.

All functions