R: Specificity, True negative rate

tnr {ModelMetrics} | R Documentation

## Specificity, True negative rate

### Description

True Negatives / (True Negatives + False Positives)

### Usage

    tnr(actual, predicted, cutoff = 0.5)

### Arguments

`actual` | A vector of the labels
`predicted` | A vector of predicted values
`cutoff` | A cutoff for the predicted values

### Examples

    data(testDF)
    glmModel <- glm(y ~ ., data = testDF, family="binomial")
    Preds <- predict(glmModel, type = 'response')

    tnr(testDF$y, Preds, cutoff = 0)
    specificity(testDF$y, Preds, cutoff = 0)

[Package ModelMetrics version 1.1.0 Index]