plot.roc_curve {fake}R Documentation

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 class 'roc_curve'
plot(x, add = FALSE, ...)

Arguments

x

output of ROC.

add

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

...

additional plotting arguments (see par).

Value

A base plot.

See Also

ROC, Concordance

Examples


# 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)


[Package fake version 1.4.0 Index]