R/error.nsc.R

Defines functions error.nsc

error.nsc <-function(object) {
###Computes the roc curve for a nsc model
  yhat <- object$yhat
  y <- object$y
  ny <- table(y)
  errors <- matrix(0, length(object$threshold), length(ny))
  Y <- data.matrix(yhat) != unclass(y)
  yind <- model.matrix( ~ factor(y) - 1, data = list(y = y))
  errors <- t(t(yind) %*% Y)
  apply(errors, 2, mean)
}

Try the pamr package in your browser

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

pamr documentation built on May 2, 2019, 12:35 p.m.