kappa2 | R Documentation |
Cohen's kappa is the classical agreement measure when two raters provide ratings for subjects on a nominal scale.
kappa2(ratings, robust = FALSE, ratingScale = NULL)
ratings |
matrix (dimension nx2), containing the ratings as subjects by raters |
robust |
flag. Use robust estimate for random chance of agreement by Brennan-Prediger? |
ratingScale |
Possible levels for the rating. Or |
The data of ratings must be stored in a two column object, each rater is a column and the subjects are in the rows. Every rating category is used and the levels are sorted. Weighting of categories is currently not implemented.
list containing Cohen's kappa agreement measure (value) or NULL
if
no valid subjects
irr::kappa2()
# 2 raters have assessed 4 subjects into categories "A", "B" or "C"
# organize ratings as two column matrix, one row per subject rated
m <- rbind(sj1 = c("A", "A"),
sj2 = c("C", "B"),
sj3 = c("B", "C"),
sj4 = c("C", "C"))
# Cohen's kappa -----
kappa2(ratings = m)
# robust variant ---------
kappa2(ratings = m, robust = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.