plot.roc_curve | R Documentation |
Plots the True Positive Rate (TPR) as a function of the False Positive Rate (FPR) for different thresholds in predicted probabilities.
## S3 method for class 'roc_curve'
plot(x, add = FALSE, ...)
x |
output of |
add |
logical indicating if the curve should be added to the current plot. |
... |
additional plotting arguments (see |
A base plot.
ROC
, Concordance
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.