Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-statistics

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-statistics

Simple Statistics

  • 7.7.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
141K
decreased by-31%
Maintainers
1
Weekly downloads
 
Created

What is simple-statistics?

The simple-statistics npm package provides a comprehensive set of statistical tools and functions for performing various statistical analyses. It is designed to be easy to use and covers a wide range of statistical operations, from basic descriptive statistics to more complex regression analysis.

What are simple-statistics's main functionalities?

Descriptive Statistics

This feature allows you to calculate basic descriptive statistics such as mean, median, and variance. The code sample demonstrates how to compute these statistics for a given dataset.

const ss = require('simple-statistics');
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const mean = ss.mean(data);
const median = ss.median(data);
const variance = ss.variance(data);
console.log(`Mean: ${mean}, Median: ${median}, Variance: ${variance}`);

Probability Distributions

This feature provides functions to work with various probability distributions, including normal and binomial distributions. The code sample shows how to generate a random normal value and a binomial distribution.

const ss = require('simple-statistics');
const normal = ss.randomNormal(0, 1);
const binomial = ss.binomialDistribution(10, 0.5);
console.log(`Random Normal Value: ${normal}, Binomial Distribution: ${binomial}`);

Regression Analysis

This feature allows you to perform regression analysis, including linear regression. The code sample demonstrates how to compute a linear regression line for a given dataset.

const ss = require('simple-statistics');
const data = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]];
const regression = ss.linearRegression(data);
const regressionLine = ss.linearRegressionLine(regression);
console.log(`Regression Line: y = ${regression.m}x + ${regression.b}`);

Hypothesis Testing

This feature provides functions for performing hypothesis testing, such as t-tests. The code sample shows how to perform a two-sample t-test on two datasets.

const ss = require('simple-statistics');
const tTest = ss.tTestTwoSample([1, 2, 3, 4, 5], [6, 7, 8, 9, 10]);
console.log(`T-Test Result: ${tTest}`);

Other packages similar to simple-statistics

Keywords

FAQs

Package last updated on 13 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc