<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_.
