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

    Function friedmanTest

    • Friedman rank sum test for an unreplicated complete block design. Equivalent to R's friedman.test(). Takes a matrix.

      Parameters

      • y: readonly (readonly number[])[]

        Blocks as rows, treatments as columns. Rows with a missing value are dropped.

        There is also a formula form, friedmanTest("y ~ w | b", data) (next overload).

      Returns ChisqStatTestResult

      const r = friedmanTest([[5.4, 5.5, 5.55], [5.85, 5.7, 5.75], [5.2, 5.6, 5.5], [5.55, 5.5, 5.4], [5.9, 5.85, 5.7]]);
      r.statistic; // 0.4
      r.pValue; // 0.8187307530779818
    • Friedman test from a formula and a data frame. As R's friedman.test(formula, data): "y ~ w | b" with the groups w and the blocks b. The rows where y, w or b is missing are dropped first; then every combination of group and block must occur exactly once (else the error not an unreplicated complete block design, so that one missing value fails, unlike the matrix form, which drops its block).

      Parameters

      • formula: string

        "y ~ w | b" (one variable on each side of |).

      • data: DataFrame

        The data frame: an object of columns (null or NaN for a missing value).

      Returns ChisqStatTestResult