rStats.js v1.3.0
    Preparing search index...

    Function pAdjust

    • Adjusts p-values for multiple comparisons. Equivalent to R's p.adjust().

      NaN values are excluded from the adjustment and returned as NaN in place. If n is 1 or less, the p-values are returned unchanged. Differences from R: with "hommel" a non-integer n or an n above 65536 (O(n^2) work, about 6 s at the limit) is an error, and an empty p always gives an empty result.

      Parameters

      Returns number[]

      Adjusted p-values, in the same order as p.

      const p = [0.01, 0.02, 0.03, 0.04, 0.05];
      pAdjust(p); // [0.05, 0.08, 0.09, 0.09, 0.09] (Holm)
      pAdjust(p, "BH"); // [0.05, 0.05, 0.05, 0.05, 0.05]
      pAdjust(p, { method: "bonferroni", n: 10 });