cohensKappa: Cohen's kappa coefficient

View source: R/cohensKappa.R

cohensKappaR Documentation

Cohen's kappa coefficient

Description

Calculates Cohen's \kappa (kappa) coefficient for two equal length vectors.

Usage

cohensKappa(x, y, adjusted = TRUE)

Arguments

x

vector, coerced to factor.

y

vector, coerced to factor.

adjusted

logical. If adjusted=FALSE, the unadjusted accuracy is returned instead.

Details

Cohen's kappa coefficient measures the agreement between two categorical vectors. Zero indicates that the agreement is no better than expected by chance, while a value of one indicates perfect correspondence.

Value

If adjusted=TRUE, returns the kappa coefficient [-1,1]. If adjusted=FALSE, returns ordinary accuracy [0,1].

Note

Cases with NA in either input vector are ignored.


MolecularPathologyLab/MmCMS documentation built on Oct. 18, 2023, 10:42 p.m.