median

Median as a degenerate summary (y, ymin: y, ymax: y).

Uses the same type-7 linear-interpolation rule as _quantile, kept consistent with src/stat/boxplot.typ and median-hilow.

Usage

median(
  values,
)

Parameters

Parameter Default Description
values Array of numbers; non-numeric entries are dropped.

Returns

Dict (y, ymin, ymax) with ymin == ymax == y; all-none if values has no numerics.

Examples

Median of a small sample.

#let s = median((1, 2, 3, 4))
// s.y == 2.5
Back to top