Skip to main content
Module

x/simplestatistics/index.js>medianSorted

simple statistics for node & browser javascript
Go to Latest
function medianSorted
import { medianSorted } from "https://deno.land/x/simplestatistics@v7.7.5/index.js";

The median is the middle number of a list. This is often a good indicator of 'the middle' when there are outliers that skew the mean() value. This is a measure of central tendency: a method of finding a typical or central value of a set of numbers.

The median isn't necessarily one of the elements in the list: the value can be the average of two elements if the list has an even length and the two central values are different.

Examples

medianSorted([10, 2, 5, 100, 2, 1]); // => 52.5

Parameters

sorted

input