@leanchuck/core - v0.1.1
    Preparing search index...

    Function quartileByValue

    • Assigns a quartile by where a value sits within the full dataset's range of values (value-based, distribution-aware).

      Larger values map to quartile 1. Internally the values are sorted and the 25th/50th/75th percentile cut points are derived via linear interpolation.

      Parameters

      • value: number

        The value to classify.

      • values: readonly number[]

        The full population of values to compare against.

      Returns Quartile

      The quartile 14.

      const revenues = rows.map((r) => r.revenue);
      quartileByValue(row.revenue, revenues);