Learn R Programming

OptimalCutpoints (version 1.1-5)

plot.optimal.cutpoints: Default optimal.cutpoints plotting

Description

On the basis of an optimal.cutpoints object, three plots are currently available: (1) a plot of the Receiver Operating Characteristic (ROC) curve; (2) a plot of the Predictive ROC (PROC) curve; and, in some methods, (3) a plot of the values of the optimal criterion used as a function of the cutoffs.

Usage

# S3 method for optimal.cutpoints
plot(x, legend = TRUE, which = c(1,2), ...)

Arguments

x

an object of class optimal.cutpoint as produced by optimal.cutpoints().

legend

a logical value for including the legend of optimal coordinates with specific characteristics. The default is TRUE.

which

a numeric vector with the required plots. By default, both the ROC and the PROC curves are plotted.

further arguments passed to method plot.default.

See Also

optimal.cutpoints, control.cutpoints

Examples

Run this code
# NOT RUN {
library(OptimalCutpoints)
data(elas)
###########################################################
# Youden Index method ("Youden"): Covariate gender
###########################################################
optimal.cutpoint.Youden<-optimal.cutpoints(X = "elas", status = "status", tag.healthy = 0, 
methods = "Youden", data = elas, pop.prev = NULL, categorical.cov = "gender", 
control = control.cutpoints(), ci.fit = TRUE, conf.level = 0.95, trace = FALSE)

# Plot by default
plot(optimal.cutpoint.Youden)

#  Not including the optimal coordinates
plot(optimal.cutpoint.Youden, legend = FALSE)
# Change the colour
plot(optimal.cutpoint.Youden, col = "blue")    
# }

Run the code above in your browser using DataLab