mcc: Matthew's correlation coefficient (MCC)

View source: R/yogitools.R

mccR Documentation

Matthew's correlation coefficient (MCC)

Description

Calculate Matthew's correlation coeffient (MCC). See https://en.wikipedia.org/wiki/Matthews_correlation_coefficient

Usage

mcc(t, scores, truth)

Arguments

t

the score threshold

scores

vector of scores for each measured item

truth

logical vector classifying each item as a member of the hidden true or false classes

Value

a vector listing the MCC value, the precision, and the recall

Examples

patientHasDisease <- sample(c(TRUE,FALSE),100,replace=TRUE)
patientDiganosticScore <- sapply(patientHasDisease,
   function(d) if (d) rnorm(1,20,3) else rnorm(1,18,3)
)
mccval <- mcc(21,patientDiganosticScore,patientHasDisease)

jweile/yogitools documentation built on May 11, 2023, 7:42 p.m.