Learn R Programming

measures (version 0.3)

TNR: True negative rate

Description

Percentage of correctly classified observations in the negative class. Also called specificity.

Usage

TNR(truth, response, negative)

Arguments

truth

vector of true values

response

vector of predicted values

negative

negative class

Examples

Run this code
# NOT RUN {
n = 20
set.seed(125)
truth = as.factor(sample(c(1,0), n, replace = TRUE))
probabilities = runif(n)
response = as.factor(as.numeric(probabilities > 0.5))
negative = 0
TNR(truth, response, negative)
# }

Run the code above in your browser using DataLab