Learn R Programming

fake (version 1.4.0)

plot.roc_curve: Receiver Operating Characteristic (ROC) curve

Description

Plots the True Positive Rate (TPR) as a function of the False Positive Rate (FPR) for different thresholds in predicted probabilities.

Usage

# S3 method for roc_curve
plot(x, add = FALSE, ...)

Value

A base plot.

Arguments

x

output of ROC.

add

logical indicating if the curve should be added to the current plot.

...

additional plotting arguments (see par).

See Also

ROC, Concordance

Examples

Run this code
# \donttest{
# Data simulation
set.seed(1)
simul <- SimulateRegression(
  n = 500, pk = 20,
  family = "binomial", ev_xy = 0.8
)

# Logistic regression
fitted <- glm(simul$ydata ~ simul$xdata, family = "binomial")$fitted.values

# Constructing the ROC curve
roc <- ROC(predicted = fitted, observed = simul$ydata)
plot(roc)
# }

Run the code above in your browser using DataLab