# Stats [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url] > Standard library statistical functions.
## Installation ```bash npm install @stdlib/stats ```
## Usage ```javascript var statistics = require( '@stdlib/stats' ); ``` #### statistics Standard library statistical functions. ```javascript var stats = statistics; // returns {...} ``` The namespace exposes the following statistical tests:
- [`anova1( x, factor[, opts] )`][@stdlib/stats/anova1]: perform a one-way analysis of variance. - [`bartlettTest( a[,b,...,k][, opts] )`][@stdlib/stats/bartlett-test]: compute Bartlett’s test for equal variances. - [`binomialTest( x[, n][, opts] )`][@stdlib/stats/binomial-test]: exact test for the success probability in a Bernoulli experiment. - [`chi2gof( x, y[, ...args][, opts] )`][@stdlib/stats/chi2gof]: perform a chi-square goodness-of-fit test. - [`chi2test( x[, opts] )`][@stdlib/stats/chi2test]: perform a chi-square independence test. - [`flignerTest( a[,b,...,k][, opts] )`][@stdlib/stats/fligner-test]: compute the Fligner-Killeen test for equal variances. - [`kruskalTest( a[,b,...,k][, opts] )`][@stdlib/stats/kruskal-test]: compute the Kruskal-Wallis test for equal medians. - [`kstest( x, y[, ...params][, opts] )`][@stdlib/stats/kstest]: one-sample Kolmogorov-Smirnov goodness-of-fit test. - [`leveneTest( x[, y, ..., z][, opts] )`][@stdlib/stats/levene-test]: compute Levene's test for equal variances. - [`pcorrtest( x, y[, opts] )`][@stdlib/stats/pcorrtest]: compute a Pearson product-moment correlation test between paired samples. - [`ttest( x[, y][, opts] )`][@stdlib/stats/ttest]: one-sample and paired Student's t-Test. - [`ttest2( x, y[, opts] )`][@stdlib/stats/ttest2]: two-sample Student's t-Test. - [`vartest( x, y[, opts] )`][@stdlib/stats/vartest]: two-sample F-test for equal variances. - [`wilcoxon( x[, y][, opts] )`][@stdlib/stats/wilcoxon]: one-sample and paired Wilcoxon signed rank test. - [`ztest( x, sigma[, opts] )`][@stdlib/stats/ztest]: one-sample z-Test. - [`ztest2( x, y, sigmax, sigmay[, opts] )`][@stdlib/stats/ztest2]: two-sample z-Test.
In addition, it contains an assortment of functions for computing statistics incrementally as part of the `incr` sub-namespace and functions for computing statistics over iterators in the `iterators` namespace.
- [`incr`][@stdlib/stats/incr]: standard library functions for computing statistics incrementally. - [`iterators`][@stdlib/stats/iter]: standard library functions for computing statistics over iterators.
The `base` sub-namespace contains functions to calculate statistics alongside a `dists` namespace containing functions related to a wide assortment of probability distributions. Other statistical functions included are:
- [`kde2d()`][@stdlib/stats/kde2d]: two-dimensional kernel density estimation. - [`lowess( x, y[, opts] )`][@stdlib/stats/lowess]: locally-weighted polynomial regression via the LOWESS algorithm. - [`padjust( pvals, method[, comparisons] )`][@stdlib/stats/padjust]: adjust supplied p-values for multiple comparisons. - [`ranks( arr[, opts] )`][@stdlib/stats/ranks]: compute ranks for values of an array-like object.
## Examples ```javascript var objectKeys = require( '@stdlib/utils/keys' ); var statistics = require( '@stdlib/stats' ); console.log( objectKeys( statistics ) ); ```
* * * ## Notice This package is part of [stdlib][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][stdlib], see the main project [repository][stdlib]. #### Community [![Chat][chat-image]][chat-url] --- ## License See [LICENSE][stdlib-license]. ## Copyright Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].