Learn R Programming

measures (version 0.3)

WKAPPA: Mean quadratic weighted kappa

Description

Defined as: 1 - sum(weights * conf.mat) / sum(weights * expected.mat), the weight matrix measures seriousness of disagreement with the squared euclidean metric.

Usage

WKAPPA(truth, response)

Arguments

truth

vector of true values

response

vector of predicted values n = 20 set.seed(122) truth = as.factor(sample(c(1,2,3), n, replace = TRUE)) response = as.factor(sample(c(1,2,3), n, repla WKAPPA(truth, response)