Skip to main content
Module

x/simplestatistics/index.js>quantileRank

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

This function returns the quantile in which one would find the given value in the given array. It will copy and sort your array before each run, so if you know your array is already sorted, you should use quantileRankSorted instead.

Examples

quantileRank([4, 3, 1, 2], 3); // => 0.75 quantileRank([4, 3, 2, 3, 1], 3); // => 0.7 quantileRank([2, 4, 1, 3], 6); // => 1 quantileRank([5, 3, 1, 2, 3], 4); // => 0.8

Parameters

x

input

value