Learn R Programming

SDMTools (version 1.1-221)

Kappa: Kappa Statistic

Description

Kappa estimates the Kappa statistic for model accuracy.

Usage

Kappa(mat)

Arguments

mat
a confusion matrix of class 'confusion.matrix' from confusion.matrix

Value

Returns a single value represting the Kappa statistic.

See Also

auc, omission, sensitivity, specificity, prop.correct, confusion.matrix, accuracy

Examples

Run this code
#create some data
obs = c(sample(c(0,1),20,replace=TRUE),NA); obs = obs[order(obs)]
pred = runif(length(obs),0,1); pred = pred[order(pred)]

#calculate the confusion matrix
mat = confusion.matrix(obs,pred,threshold=0.5)

#calculate the Kappa statistic
Kappa(mat)

Run the code above in your browser using DataLab