cohen_k: Cohen k

View source: R/kappa.R

cohen_kR Documentation

Cohen k

Description

Cohen k (psych version)

Usage

cohen_k(x = NULL, y = NULL, conf.level = 0.95)

Arguments

x

a table of agreement, a 2 columns structure or a single vector (first rater) if y is a vector too

y

a vector (second rater) or NULL

conf.level

confidence level for confidence intervals

Examples


rater_a <- c(rep(1,50), rep(2,30), rep(3,20))
rater_b <- c(rep(1, 44), rep(2,  5), rep(3, 1),
       rep(1,  7), rep(2, 20), rep(3, 3),
       rep(1,  9), rep(2,  5), rep(3, 6))
tab <- table(rater_a, rater_b)
rate <- data.frame("A" = rater_a, "B" = rater_b)

cohen_k(rater_a, rater_b)
cohen_k(tab)
cohen_k(rate)

## check with
## ----------
## irr::kappa2(rate)$value
## irr::kappa2(rate, weight = "equal")$value
## irr::kappa2(rate, weight = "squared")$value
## psych::cohen.kappa(rate)


lbraglia/lbagree documentation built on July 3, 2023, 3:32 p.m.