Unified interface to common inter-rater reliability metrics, so the
researcher can pick a method appropriate to their data. The
method argument chooses among:
Arguments
- ratings
A data frame or matrix where each column is a rater (annotator / model) and each row is an item. Missing values are permitted by
kripp.alphabut not by the others.- method
One of
"cohen","weighted","fleiss","kripp","icc","agree". The default"auto"picks"cohen"for 2 raters + nominal data,"weighted"for 2 raters + ordinal data,"fleiss"for >2 raters + nominal data,"kripp"otherwise.- level
Measurement level:
"nominal","ordinal","interval", or"ratio". Used by"auto","weighted", and"kripp".- weights
For
method = "weighted": either"equal"(linear) or"squared"(quadratic).- ...
Passed to the underlying
irrfunction (e.g.type,modelfor ICC).
Details
"cohen"Cohen's kappa. Two raters, nominal data. Wraps
irr::kappa2(weight = "unweighted")."weighted"Weighted Cohen's kappa. Two raters, ordinal data. Wraps
irr::kappa2()withweight = "equal"(linear) or"squared"(quadratic) via theweightsargument."fleiss"Fleiss' kappa. More than two raters, nominal data. Wraps
irr::kappam.fleiss()."kripp"Krippendorff's alpha. Any number of raters, missing values allowed, any measurement level. Wraps
irr::kripp.alpha()withmethodcontrolled by thelevelargument ("nominal","ordinal","interval","ratio")."icc"Intra-class correlation. Continuous ratings. Wraps
irr::icc(). Usetypeandmodelarguments for the ICC form."agree"Simple percent agreement. Wraps
irr::agree(). Reported alongside other metrics; not a substitute for chance-corrected agreement.
All methods return a tidy one-row data frame with columns
method, value, n_raters, n_items, and any
method-specific fields (e.g., p_value, ci_lower,
ci_upper when available).
Examples
if (FALSE) { # \dontrun{
ratings <- data.frame(
human = c("sup", "opp", "sup", "non"),
gpt5 = c("sup", "opp", "sup", "non"),
gemini = c("sup", "opp", "non", "non")
)
reliab(ratings, method = "kripp", level = "nominal")
reliab(ratings[, 1:2], method = "cohen")
reliab(ratings, method = "fleiss")
} # }