Univariate tests to detect outlier.
Tests available
Grubbs
Dixon
$ npm i univariate-tests
import { grubbs } from 'univariate-tests';
const testValues = [10.45, 10.26, 10.49, 10.36, 10.53, 10.77];
const { test, criticalValue } = grubbs(testValues);
console.log(criticalValue); // 1.82
console.log(test[0]); // { value: 10.45, score: 0.15378928962176208, pass: true }
import { dixon } from 'univariate-tests';
const testValues = [10.45, 10.26, 10.49, 10.36, 10.53, 10.77];
const { test, criticalValue } = dixon(testValues);
console.log(criticalValue); // 0.625
console.log(test[0]); // { value: 10.26, score: 0.1960784313725484, pass: true }
- Miller, J. N., & Miller, J. C. (2010). Statistics and Chemometrics for Analytical Chemistry.