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

    Function cochranQTest

    • Cochran's Q test for binary responses in an unreplicated complete block design. Equivalent to DescTools::CochranQTest() in R. Takes a matrix: the Friedman test of the 0/1 matrix (with ties), reported as Q.

      Parameters

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

        Blocks as rows, treatments as columns, values 0 or 1. Rows with a missing value are dropped.

      Returns ChisqStatTestResult

      const r = cochranQTest([[1, 1, 0], [1, 0, 0], [1, 1, 1], [0, 0, 0], [1, 1, 0], [1, 0, 1]]);
      r.statistic; // 3.5
      r.pValue; // 0.17377394345044514