roc_plot: Receiver Operating Characteristic curve

View source: R/roc_plot.R

roc_plotR Documentation

Receiver Operating Characteristic curve

Description

Plot a receiver operating characteristic curve for a binary predictive model

Usage

roc_plot(actual, prob, positive, n.cuts = 20, labelsize = 3, digits = 2)

Arguments

actual

actual class.

prob

predicted probability for the target class

positive

label for the target class

n.cuts

number of probability cut-points to plot

labelsize

size of cutpoint labels

digits

number of decimal digits in the cutpoint labels

Value

a ggplot2 graph

Examples

# logistic regression
fit <- glm(caesarian ~ ., family=binomial, caesarian)
prob <- predict(fit, newdata=caesarian, type="response")
roc_plot(caesarian$caesarian, prob, positive="yes")

Rkabacoff/qacReg documentation built on Aug. 1, 2022, 11:11 p.m.