Skip to contents

Formula: kappa = (P0 - Pe) / (1 - Pe), Pe = (tp+fn)/n*(tp+fp)/n + (fp+tn)/n*(fn+tn)/n

Usage

Kappacoef(tp, fp, fn, tn)

Arguments

tp

True positives.

fp

False positives.

fn

False negatives.

tn

True negatives.

Value

List with kappa, p0, pe, n.

References

Montesinos Lopez, Montesinos Lopez and Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, doi:10.1007/978-3-030-89010-0. Chapter 4, Sect. 4.5.2, p. 134, which gives kappa = (P0 - Pe)/(1 - Pe) with P0 the proportion correctly classified and Pe as written above; the book attributes it to Cohen (1960). Read from the chapter PDF, not recalled.

Examples

Kappacoef(tp = 40, fp = 10, fn = 5, tn = 45)$kappa
#> [1] 0.7