Skip to contents

Fleiss' kappa for multiple raters

Usage

fleiss_kappa(ratings_matrix)

Arguments

ratings_matrix

Matrix; rows = subjects, cols = categories, cells = number of raters assigning subject i to category j.

Value

A morie_test_result (subclass of morie_rich_result) with the z statistic, two-sided p-value, kappa as both effect_size and estimate, n (number of subjects), and extra list carrying n_raters and n_categories.

Examples

set.seed(1)
mat <- matrix(0, nrow = 20, ncol = 3)
for (i in seq_len(20)) {
  pick <- sample.int(3, 5, replace = TRUE)
  for (k in pick) mat[i, k] <- mat[i, k] + 1
}
res <- fleiss_kappa(mat)
res$test_statistic
#> [1] 1.178231