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

    Function mcnemarTest

    • McNemar's chi-squared test for symmetry of rows and columns in a square table of counts. Equivalent to R's mcnemar.test(). Takes a matrix, or two factors given as paired category codes.

      Parameters

      • x: readonly (readonly number[])[] | readonly (string | number)[]

        Square table of counts as an array of rows, or the first of two paired samples of category codes.

      • Optionaly: readonly (string | number)[] | McnemarTestOptions

        Second paired sample of category codes, when x is a sample. May be omitted (and the options passed in its place) when x is a table.

      • options: McnemarTestOptions = {}

      Returns McnemarTestResult

      mcnemarTest([[794, 86], [150, 570]]).statistic; // 16.81779661016949