R/basic2x2Stats.R

basic2x2Stats <- function(x, y, pos, neg)
{
   out <- vector(length = 4, mode = "numeric")
   out[1] <- sensitivity(x, y, pos)
   out[2] <- specificity(x, y, neg)
   out[3] <- posPredValue(x, y, pos)
   out[4] <- negPredValue(x, y, neg)  
   names(out) <- c("Sensitivity", "Specificity", "Pos Pred Value", "Neg Pred Value")
   out
}

Try the caret package in your browser

Any scripts or data that you put into this service are public.

caret documentation built on May 2, 2019, 5:47 p.m.