Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including simple-statistics with all npm packages installed. Try it out:

var simpleStatistics = require("simple-statistics")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

simple-statistics v5.0.1

Simple Statistics

Simple Statistics

A JavaScript implementation of descriptive, regression, and inference statistics.

Circle CI npm version Greenkeeper badge

Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in node.js.


  • I'm using Node.js, Webpack, Browserify, Rollup, or another module bundler, and install packages from npm.
    • First, install the simple-statistics module, using npm install simple-statistics, then include the code with require or import:
    • I use the require function 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'. The require method returns an object with all of the module's methods attached to it.
        var ss = require('simple-statistics')
    • I use import to use modules in my project. I'm probably using Babel, Webpack, or Rollup.
      • This module only supports the 'default' export when you're using ES6 module: so you can import all of its methods, attached to an object, like in this example. Importing specific methods will work in Babel, but not in Rollup.
        import ss from 'simple-statistics';
  • I'm not using a module bundler. I'm writing a web page, and want to include simple-statistics using a script tag.
    • 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.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free