Pooled or stratified outlier removal

Pool two groups that differ in mean or spread, then drop every value more than z standard deviations from the pooled mean. The gap between the groups inflates the pooled SD, so the rule removes the wrong share of points overall and takes them unevenly from the two groups.

What each rule removes

    Each group's distribution, scaled by its share of the data, so equal areas are equal numbers of values in both tiers. Darker fill is removed. Dashed lines are each group's own cutoffs; solid lines are the pooled cutoffs. Zoom stretches both tiers alike to show the thin tails.

    Groups and cutoff

    SD
    ×
    %
    SD

    Share removed, by group

    Across a range of

      Share of each group removed by the pooled rule, with the other parameters held at their current values. The stratified rule removes the same share, 2Φ(−z), from every group. Drag across the chart to set the value; the vertical line marks it.

      How it works

      Why pooling changes the cutoff

      The pooled variance is the average variance within the groups plus the spread between their means: with shares wA and wB it is wAσA² + wBσB² + wAwBΔμ². A mean difference therefore widens the pooled cutoffs, and the values beyond them come mostly from whichever group sits further out or spreads wider.

      With equal groups the pooled rule removes too little. A small group far from the majority is different: its whole upper tail can land beyond the pooled cutoff, so pooling removes several times the nominal share from it while barely touching the majority.

      What to do instead

      Standardise within each known group (sex, batch, tissue, site) before applying a z cutoff, so each value is judged against its own group. When the groups are unknown, a cutoff on pooled data mixes outlier detection with group detection.

      Method

      Both groups are normal. Units are group A's SD, with the pooled mean at 0. Every share is an exact normal tail probability, computed in closed form; nothing is simulated. The display distinguishes values removed by both rules, by pooling only and by stratifying only. The API provides the same computation.