kappa2: Cohen's kappa for nominal data

kappa2R Documentation

Cohen's kappa for nominal data

Description

Cohen's kappa is the classical agreement measure when two raters provide ratings for subjects on a nominal scale.

Usage

kappa2(ratings, robust = FALSE, ratingScale = NULL)

Arguments

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 NULL.

Details

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.

Value

list containing Cohen's kappa agreement measure (value) or NULL if no valid subjects

See Also

irr::kappa2()

Examples

# 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)


kappaGold documentation built on April 4, 2025, 1:02 a.m.