About stdlib...
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, wellwritten, studied, documented, tested, measured, and highquality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Stats
Statistical functions.
Installation
npm install @stdlib/stats
Usage
var statistics = require( '@stdlib/stats' );
statistics
Namespace containing statistical functions.
var stats = statistics;
// returns {...}
The namespace exposes the following statistical tests:

anova1( x, factor[, opts] )
: perform a oneway analysis of variance. 
bartlettTest( a[,b,...,k][, opts] )
: compute Bartlett’s test for equal variances. 
binomialTest( x[, n][, opts] )
: exact test for the success probability in a Bernoulli experiment. 
chi2gof( x, y[, ...args][, options] )
: perform a chisquare goodnessoffit test. 
chi2test( x[, options] )
: perform a chisquare independence test. 
flignerTest( a[,b,...,k][, opts] )
: compute the FlignerKilleen test for equal variances. 
kruskalTest( a[,b,...,k][, opts] )
: compute the KruskalWallis test for equal medians. 
kstest( x, y[, ...params][, opts] )
: onesample KolmogorovSmirnov goodnessoffit test. 
leveneTest( x[, y, ..., z][, opts] )
: compute Levene's test for equal variances. 
pcorrtest( x, y[, opts] )
: compute a Pearson productmoment correlation test between paired samples. 
ttest( x[, y][, opts] )
: onesample and paired Student's tTest. 
ttest2( x, y[, opts] )
: twosample Student's tTest. 
vartest( x, y[, opts] )
: twosample Ftest for equal variances. 
wilcoxon( x[, y][, opts] )
: onesample and paired Wilcoxon signed rank test. 
ztest( x, sigma[, opts] )
: onesample zTest. 
ztest2( x, y, sigmax, sigmay[, opts] )
: twosample zTest.
In addition, it contains an assortment of functions for computing statistics incrementally as part of the incr
subnamespace and functions for computing statistics over iterators in the iterators
namespace.
The base
subnamespace contains functions to calculate statistics alongside a dists
namespace containing functions related to a wide assortment of probability distributions.
Other statistical functions included are:

base
: base (i.e., lowerlevel) statistical functions. 
kde2d()
: twodimensional kernel density estimation. 
lowess( x, y[, opts] )
: locallyweighted polynomial regression via the LOWESS algorithm. 
padjust( pvals, method[, comparisons] )
: adjust supplied pvalues for multiple comparisons. 
ranks( arr[, opts] )
: compute ranks for values of an arraylike object.
Examples
var objectKeys = require( '@stdlib/utils/keys' );
var statistics = require( '@stdlib/stats' );
console.log( objectKeys( statistics ) );
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 20162023. The Stdlib Authors.