Home

statistics-calculator-toolkit

Small, dependency-free libraries for the mean, sum of squared deviations, population and sample variance, population and sample standard deviation, coefficient of variation and relative standard deviation (RSD).

Every language exposes the same operations, uses the same numerically careful algorithm, validates input the same way and is tested against the same known values. See the API contract for names, behaviour and floating-point notes.

Install

language registry install docs
Python PyPI pip install sdtoolkit Python guide
JavaScript / TypeScript npm npm install @rameshxyz/sdtoolkit README
Rust crates.io cargo add sdtoolkit README, docs.rs
Go Go modules go get github.com/Ramesh-xyz/statistics-calculator-toolkit/go/sdtoolkit README, pkg.go.dev
R CRAN install.packages("sdcalc") README
Java / Kotlin Maven Central io.github.ramesh-xyz:sdtoolkit README
C# / .NET NuGet dotnet add package SdToolkit README
Ruby RubyGems gem install sdtoolkit README
PHP Packagist composer require ramesh-xyz/sdtoolkit README
Dart / Flutter pub.dev dart pub add sdtoolkit README

Each package is released independently from a git tag; the changelog lists what has shipped. Until a language’s first release, install it from the repository directory linked above.

Example

The classic dataset 2, 4, 4, 4, 5, 5, 7, 9 gives the same results in every language:

statistic value
mean 5
sum of squares 32
population variance / standard deviation 4 / 2
sample variance / standard deviation 4.571428571428571 / 2.138089935299395
RSD, sample / population 42.76 % / 40 %

Guides

Source and issues

Code, issues and pull requests: github.com/Ramesh-xyz/statistics-calculator-toolkit. For an interactive calculator, see standarddeviationcalculator.net.