Skip to main content
Module

x/simplestatistics/index.js>quantileSorted

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

This is the internal implementation of quantiles: when you know that the order is sorted, you don't need to re-sort it, and the computations are faster.

Examples

quantileSorted([3, 6, 7, 8, 8, 9, 10, 13, 15, 16, 20], 0.5); // => 9

Parameters

x

sample of one or more data points

p

desired quantile: a number between 0 to 1, inclusive