R/TPR.R

Defines functions TNR.table TNR.numeric TNR TPR.table TPR.numeric TPR

# {{{ UseMethod

TPR <- function(x,...){
    UseMethod("TPR",x)
}

TPR.numeric <- function(x,...){
    tmp <- binom.test(x[4],(x[3]+x[4]),...)
    ci.tpr <- c(tmp$estimate,tmp$conf.int)
    names(ci.tpr) <- c("TPR (Sensitivity)","Lower","Upper")
    ci.tpr
}

TPR.table <- function(x,...){
  tmp <- binom.test(x[4],(x[3]+x[4]),...)
  ci.tpr <- c(tmp$estimate,tmp$conf.int)
  names(ci.tpr) <- c("TPR (Sensitivity)","Lower","Upper")
  ci.tpr
}

TNR <- function(x,...){
  UseMethod("TNR",x)
}

TNR.numeric <- function(x,...){
    tmp <- binom.test(x[1],(x[1]+x[2]),...)
    ci.tnr <- c(tmp$estimate,tmp$conf.int)
    names(ci.tnr) <- c("TPR (Specificity)","Lower","Upper")
    ci.tnr
}
TNR.table <- function(x,...){
    tmp <- binom.test(x[1],(x[1]+x[2]),...)
    ci.tnr <- c(tmp$estimate,tmp$conf.int)
    names(ci.tnr) <- c("TPR (Specificity)","Lower","Upper")
    ci.tnr
}

# }}}

Try the ModelGood package in your browser

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

ModelGood documentation built on May 29, 2017, 4:14 p.m.