Skip to main content
Module

x/simplestatistics/index.js>variance

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

The variance is the sum of squared deviations from the mean.

This is an implementation of variance, not sample variance: see the sampleVariance method if you want a sample measure.

Examples

variance([1, 2, 3, 4, 5, 6]); // => 2.9166666666666665

Parameters

x

a population of one or more data points