Package Exports
- simple-statistics
- simple-statistics/src/ckmeans
- simple-statistics/src/error_function
- simple-statistics/src/linear_regression
- simple-statistics/src/linear_regression_line
- simple-statistics/src/max
- simple-statistics/src/mean
- simple-statistics/src/median
- simple-statistics/src/min
- simple-statistics/src/mode
- simple-statistics/src/quantile
- simple-statistics/src/sample_correlation
- simple-statistics/src/sample_standard_deviation
- simple-statistics/src/standard_deviation
- simple-statistics/src/sum
- simple-statistics/src/variance
- simple-statistics/src/z_score
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simple-statistics) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Simple Statistics
A JavaScript implementation of descriptive, regression, and inference statistics.
Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in node.js.
Installation
- I'm using Node.js, Webpack, Browserify, Rollup, or another module bundler,
and install packages from npm.
- First, install the
simple-statisticsmodule, usingnpm install simple-statistics, then include the code with require or import: - I use the
requirefunction to use modules in my project. (most likely)- When you use
require, you have the freedom to assign the module to any variable name you want, but you need to specify the module's name exactly: in this case, 'simple-statistics'. Therequiremethod returns an object with all of the module's methods attached to it.
var ss = require('simple-statistics')
- When you use
- I use
importto use modules in my project. I'm probably using Babel,@std/esm, Webpack, or Rollup.- Import all functions under the ss object:
import * as ss from 'simple-statistics'
Include a specific named export:import {min} from 'simple-statistics'Simple statistics has only named exports for ES6.
- Import all functions under the ss object:
- First, install the
- I'm not using a module bundler. I'm writing a web page, and want to include
simple-statistics using a script tag.
- I want to support all browsers
- When you use simple-statistics from a script tag, you don't get to choose
the variable name it is assigned to: simple-statistics will always become
available globally as the variable
ss. You can reassign this variable to another name if you want to, but doing so is optional.<script src='https://unpkg.com/simple-statistics@7.0.2/dist/simple-statistics.min.js'> </script>
- When you use simple-statistics from a script tag, you don't get to choose
the variable name it is assigned to: simple-statistics will always become
available globally as the variable
- I want to use ES6 modules in a browser and I'm willing to only support new browsers to do it
- This module works great with the
?modulequery parameter of unpkg. If you specifytype='module'in your script tag, you'll be able to import simple-statistics directly - throughindex.jsand with true ES6 import syntax and behavior.This feature is still experimental in unpkg and very bleeding-edge.<script type='module'> import {min} from "https://unpkg.com/simple-statistics@7.0.2/index.js?module" console.log(min([1, 2, 3])) </script>
- This module works great with the
- I want to support all browsers