Skip to main content
Module

x/simplestatistics/index.js>sampleVariance

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

The sample variance is the sum of squared deviations from the mean. The sample variance is distinguished from the variance by the usage of Bessel's Correction: instead of dividing the sum of squared deviations by the length of the input, it is divided by the length minus one. This corrects the bias in estimating a value from a set that you don't know if full.

References:

Examples

sampleVariance([1, 2, 3, 4, 5]); // => 2.5

Parameters

x

a sample of two or more data points