UNPKG

als-statistics

Version:

Modular JS statistics toolkit for Node.js and the browser: descriptive stats, correlations (Pearson/Spearman/Kendall), t-tests & ANOVA (Student/Welch), reliability (Cronbach’s alpha), regression (linear/logistic), clustering (DBSCAN/HDBSCAN), and table/co

52 lines (30 loc) 3.32 kB
<title>ALS Statistics — Overview</title> <description>A lightweight, browser-and-Node friendly statistics toolkit for JavaScript. Use it like Math for one-liners or compose higher-level analyses: correlations, t-tests, ANOVA, regression (linear, logistic,multiple,..), clustering, and table utilities.</description> <keywords>javascript statistics, t-test, anova, welch, correlation, pearson, spearman, kendall, cronbach, regression, dbscan, hdbscan, descriptive stats, table utilities</keywords> # ALS Statistics **ALS Statistics** is a modular JS toolkit for statistical work. It’s designed to be: [![Goldens verified](https://img.shields.io/badge/Goldens-verified-brightgreen)](#goldens) ![Python parity](https://img.shields.io/badge/Python%20parity-NumPy%2FSciPy%20verified-brightgreen) ![Deterministic tests](https://img.shields.io/badge/tests-deterministic-blue) ![EPS tolerances](https://img.shields.io/badge/EPS-documented-informational) ![Module format](https://img.shields.io/badge/module-ESM-informational) [![npm downloads](https://img.shields.io/npm/dm/als-statistics.svg)](https://www.npmjs.com/package/als-statistics) [![Bundle size](https://img.shields.io/bundlephobia/minzip/als-statistics)](https://bundlephobia.com/package/als-statistics) - **Quality:** **Numerics verified:** this release matches Python (NumPy/SciPy) reference outputs across modules and passes the deterministic **Golden Test Suite** on Node.js 20.x, all within published EPS tolerances. Reproducible via `node goldens/test.js` and `npm test`. - **Easy to use like `Math`** for small one-liners; - **Composable** for multi-step analyses (filter → group → compare → summarize); - **Runtime-agnostic** — the same API in **Node.js** and in the **browser**; - **Data-model light** — works with plain arrays (`number[]`) and small helpers like `Column` and `Table`. - **Browser-ready.** No native dependencies; works in the browser (as ESM or via the included UMD bundle). Think of it as a “batteries-included” **stats toolbox** rather than a full data-frame ecosystem. If you know **SPSS**: ALS gives you many of the common *procedures* (correlations, t-tests, ANOVA, reliability, basic clustering, regression) with code-first ergonomics. If you know **NumPy/SciPy**: ALS focuses on *analytics primitives and convenience wrappers* (no heavy data containers, no plotting). ### Why the rewrite? The v1 architecture had grown too complex (intertwined modules, heavy abstractions), which made adding features and maintaining consistency difficult. v2 was rebuilt from scratch with a simpler core (plain arrays + lightweight `Column`/`Table`), clear module boundaries, and predictable numerics—so new analytical tools can be added quickly without increasing complexity. --- ## Key ideas - **Plain data in / plain results out.** Most functions take `{ [name]: number[] }` or `number[]` and return simple objects (e.g. `{ r, t, df, p }`). - **Two modes of use:** 1. **One-liners** via descriptive helpers (mean, stdDev, percentiles…). 2. **Structured analyzers** for correlations, mean comparisons, regressions, clustering, etc. - **Table utilities.** Sort, filter, split by group, compute derived columns, and feed the result to an analyzer. ---