Learn R Programming

kappaGold (version 0.4.0)

kappa2: 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)

Value

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

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.

See Also

irr::kappa2()

Examples

Run this code
# 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)

Run the code above in your browser using DataLab