## Does knowing if a diamond is more than 1.5 carats in weight tell us if the
## price is more than $5,000?
data("diamonds", package = "ggplot2")
x <- ftable(I(price > 5000) ~ I(carat > 1.5), data = diamonds)
sensitivity(x)
specificity(x)
sensitivity(I(price > 5000) ~ I(carat > 1.5), data = diamonds)
specificity(I(price > 5000) ~ I(carat > 1.5), data = diamonds)
confusion_matrix(I(price > 5000) ~ I(carat > 1.5), data = diamonds)
print(confusion_matrix(I(price > 5000) ~ I(carat > 1.5), data = diamonds), digits = 4)
x <- confusion_matrix(I(price > 5000) ~ I(carat > 1.5),
data = diamonds,
boot = TRUE,
boot_samples = 100L)
print(x, digits = 4)
Run the code above in your browser using DataLab