Kappa {DeltaMAN}R Documentation

Compute the Cohen's kappa coefficient

Description

Kappa() computes de Cohen's kappa coefficient for nominal or ordinal data. If data is ordinal, weigthed kappa can be applied to allow disagreements to be weighted differently.

Usage

Kappa(
  m,
  r = 0,
  alternative = c("two.sided", "less", "greater"),
  conf.level = 0.95,
  partial = FALSE
)

Arguments

m

a squared matrix of frequencies between two observers.

r

an integer (0, 1, or 2) to create a matrix of weigths. See details.

alternative

a string specifying the alternative hypothesis to construct the confidence interval: either "two.sided" (default), "greater" or "less".

conf.level

confidence level of the interval.

partial

a logical value indicating whether to evaluate the degree of agreement of each category by collapsing the contingency table.

Details

The weighted kappa can be computed when data are ordinal and the argument r is eigher 1 or 2:

Value

A list of 3 elements containing the kappa statistic, the standard error and the confidence interval. If "partial = TRUE", a data.frame containing 3 columns (the class, the unweighted partial kappa coefficient for each class and the standards error of each estimate) is added to the list.

Examples

# Create a 3x3 matrix
m = matrix(c(15, 5, 0, 4, 21, 1, 3, 4, 25), ncol = 3)
# Compute the Kapa coefficient for nominal data
Kappa(m, r = 0, partial = TRUE)
# Compute the Kapa coefficient for ordinal data, using linear formula
Kappa(m, r = 1)

[Package DeltaMAN version 0.5.0 Index]