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

    Function kappa2

    • Cohen's kappa for two raters, unweighted or weighted, with the z test of kappa = 0. Equivalent to irr::kappa2(ratings, weight) in R. The ratings are numeric.

      The levels are the distinct ratings of both raters sorted as R sorts their character forms (so 10 sorts before 2, which matters for the weighted kappas). Rows with a missing value (NaN) are dropped. The variance of the test is the one under the null hypothesis; the p-value is computed as 2 Φ(−|z|), so small p-values are more accurate than irr's.

      Parameters

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

        An n × 2 matrix (array of rows): the ratings of the two raters for each subject, with at least 2 complete rows.

      • options: Kappa2Options = {}

      Returns Required<KappaResult>

      kappa2([[1, 1], [2, 2], [3, 2], [1, 1], [2, 3], [3, 3]]); // { value: 0.49999999999999994, statistic: 1.7320508075688772, pValue: 0.08326451666355043 }