Socket
Book a DemoInstallSign in
Socket

stat-fns

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

stat-fns

A statistics utility library

unpublished
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
38
22.58%
Maintainers
1
Weekly downloads
 
Created
Source
>

package version package downloads standard-readme compliant package license make a pull request

A statistics utility library

Table of Contents

Install

This project uses node and npm.

$ npm install stat-fns
$ # OR
$ yarn add stat-fns

Usage

const { Stat } = require('stat-fns')

const s = new Stat('65 72 68 64 60 55 73 71 52 63 61 74 69 67 74 50 4 75 67 62 66 80 64 65')
const s2 = new Stat('132 118 124 109 104 101 125 83 99 131 98 125 97 106 112 92 120 103 111 117 135 143 112 112 116 106 117 119 110 105 128 112 126 105 102')

console.log('=== 1 ===\n')
console.log('mean', s.mean())
console.log('max', s.max())
console.log('min', s.min())
console.log('sum', s.sum())
console.log('range', s.range())
console.log('Q1', s.Q1())
console.log('Q2', s.Q2())
console.log('Q3', s.Q3())
console.log('IQR', s.IQR())
console.log('Outliers', s.outliers())
// === 1 ===
// mean 63.375
// max 80
// min 4
// sum 1521
// range 76
// Q1 61.25
// Q2 65.5
// Q3 71.75
// IQR 10.5
// Outliers [ 4 ]

console.log('=== 2 ===\n')

console.log('mean', s2.mean())
console.log('median', s2.median())
console.log('mode', s2.mode())
console.log('standard deviation', s2.standardDeviation())
console.log('coefficient of variation', s2.cv())
console.log('max', s2.max())
console.log('min', s2.min())
console.log(s2.classInterval(), s2.classWidth())
// === 2 ===
// mean 113
// median 112
// mode [ '112' ]
// standard deviation 12.81293988791911
// coefficient of variation 0.11338884856565584
// max 143
// min 83

Docs

WIP

Contribute

  • Fork it and create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am "Add some feature"
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request

License

MIT

Keywords

stats

FAQs

Package last updated on 24 Nov 2025

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