specificity: Calculate specificity

Description Usage Arguments Value Examples

View source: R/quiz02Functions.R

Description

Calculate specificity

Usage

1
specificity(pred, truth)

Arguments

pred

number or boolean vector of predicted values (0 or F = negative, 1 or T = positive)

truth

number or boolean vector of true values (0 or F = negative, 1 or T = positive)

Value

The specificity, formula: specificity = # True Negatives / (# True Negatives + # False Positives)

Examples

1
2
specificity(c(0,1,0),c(1,0,1))
specificity(c(1,1,1),c(1,0,0))

hmumme/bmi585hmumme documentation built on Dec. 20, 2021, 4:46 p.m.