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

26 lines (20 loc) 854 B
<title>How‑to Recipes</title> <description>Short task‑oriented snippets for ALS Statistics.</description> <keywords>how to, recipes, examples, codepen</keywords> # How‑to - **Split a table by predicate and compare groups (Welch):** ```js const { A, B } = Table.split(raw, r => r.group === 'A' ? 'A' : 'B'); const t = A.compareMeans('score','B.score').independentWelch(); ``` - **Detect z‑outliers and keep sorted indices:** ```js const { zScores, indexes } = Stats.zScoresSorted({ values }); const top3 = indexes.slice(-3); // largest |z| ``` - **Compute spectral flatness of a spectrum:** ```js const spd = Stats.spectralPowerDensityArray({ values: magnitudes }); const flat = Stats.spectralPowerDensityMetric({ spectralPowerDensityArray: spd, values: magnitudes }); ``` > Live CodePen demos: _add your links here_.